List Info

Thread: garbage characters inserted after "emacsclient -t"




garbage characters inserted after "emacsclient -t"
user name
2007-10-23 07:55:35
When I attach to an already-running emacs session with
"emacsclient -t"
from an gnome-terminal window, the characters
">1;1609;0c" get inserted
into whatever buffer is first shown in the terminal.

That looks sort of like an ANSI escape sequence, so I
imagine it's some
feature connected with term/xterm.el that isn't properly
being handled
by Emacs in this case?

Thanks,

-Miles

-- 
Suburbia: where they tear out the trees and then name
streets after them.


_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel

Re: garbage characters inserted after "emacsclient -t"
country flaguser name
United States
2007-10-23 09:28:23
Miles Bader <miles.badernecel.com> writes:

  > When I attach to an already-running emacs session
with "emacsclient -t"
  > from an gnome-terminal window, the characters
">1;1609;0c" get inserted
  > into whatever buffer is first shown in the terminal.
  > 
  > That looks sort of like an ANSI escape sequence, so I
imagine it's some
  > feature connected with term/xterm.el that isn't
properly being handled
  > by Emacs in this case?

Sort of, emacs sends an escape sequence and expects a reply
back from
the terminal, it just does not wait long enough for the
reply.  I
increased the timeout in question.  Does it work now?


_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel

Re: garbage characters inserted after "emacsclient -t"
user name
2007-10-23 09:53:44
> When I attach to an already-running emacs session with
"emacsclient -t"
> from an gnome-terminal window, the characters
">1;1609;0c" get inserted
> into whatever buffer is first shown in the terminal.

> That looks sort of like an ANSI escape sequence, so I
imagine it's some
> feature connected with term/xterm.el that isn't
properly being handled
> by Emacs in this case?

I'd guess it comes from term/xterm.el's terminal-init-xterm
where it does:

    ;; Try to turn on the modifyOtherKeys feature on modern
xterms.
    ;; When it is turned on many more key bindings work:
things like
    ;; C-. C-, etc.
    ;; To do that we need to find out if the current
terminal supports
    ;; modifyOtherKeys. At this time only xterm does.
    (let ((coding-system-for-read 'binary)
	  (chr nil)
	  (str nil))
      ;; Try to find out the type of terminal by sending a
"Secondary
      ;; Device Attributes (DA)" query.
      (send-string-to-terminal "e[>0c")

      ;; The reply should be of the form: e [ > NUMBER1
; NUMBER2 ; NUMBER3 c
      (when (equal (read-event nil nil 0.1) ?e)
	(when (equal (read-event nil nil 0.1) ?[)
	  (while (not (equal (setq chr (read-event nil nil 0.1))
?c))
	    (setq str (concat str (string chr))))
	  (when (string-match ">0;\([0-9]+\);0"
str)

Maybe some other event (like switch-frame or some such) gets
in the way?
Maybe C-h l can give us a clue?


        Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel

Re: garbage characters inserted after "emacsclient -t"
user name
2007-10-23 11:09:52
Stefan Monnier <monnieriro.umontreal.ca>
writes:
> Maybe some other event (like switch-frame or some such)
gets in the way?
> Maybe C-h l can give us a clue?

I did C-h l, and it shows nothing unusual before the
"ESC [ ..." (the
escape and bracket are there).

-Miles
-- 
Somebody has to do something, and it's just incredibly
pathetic that it
has to be us.  -- Jerry Garcia


_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )