unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* garbage characters inserted after "emacsclient -t"
@ 2007-10-23 12:55 Miles Bader
  2007-10-23 14:28 ` Dan Nicolaescu
  2007-10-23 14:53 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Miles Bader @ 2007-10-23 12:55 UTC (permalink / raw)
  To: emacs-devel

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: garbage characters inserted after "emacsclient -t"
  2007-10-23 12:55 garbage characters inserted after "emacsclient -t" Miles Bader
@ 2007-10-23 14:28 ` Dan Nicolaescu
  2007-10-23 14:53 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Nicolaescu @ 2007-10-23 14:28 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

Miles Bader <miles.bader@necel.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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: garbage characters inserted after "emacsclient -t"
  2007-10-23 12:55 garbage characters inserted after "emacsclient -t" Miles Bader
  2007-10-23 14:28 ` Dan Nicolaescu
@ 2007-10-23 14:53 ` Stefan Monnier
  2007-10-23 16:09   ` Miles Bader
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2007-10-23 14:53 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: garbage characters inserted after "emacsclient -t"
  2007-10-23 14:53 ` Stefan Monnier
@ 2007-10-23 16:09   ` Miles Bader
  0 siblings, 0 replies; 4+ messages in thread
From: Miles Bader @ 2007-10-23 16:09 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-10-23 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-23 12:55 garbage characters inserted after "emacsclient -t" Miles Bader
2007-10-23 14:28 ` Dan Nicolaescu
2007-10-23 14:53 ` Stefan Monnier
2007-10-23 16:09   ` Miles Bader

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).