unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* 23.0.60; emacsclient -t not working within "less"
@ 2008-09-18 18:36 Chong Yidong
  2008-09-19  6:28 ` Dan Nicolaescu
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2008-09-18 18:36 UTC (permalink / raw)
  To: emacs-devel; +Cc: 427

From bug 427:

> 1) start emacs with "emacs -q -f server-start &"
> 2) export VISUAL="emacsclient -t"
> 2) less .bashrc
> 3) within less type "v" to edit file with $VISUAL 
>
> the result is that less writes a line "!emacsclient -t +18 .bashrc" on
> the terminal, but other than that the terminal is still showing the
> output of less. emacsclient is not taking over the terminal, and no
> editing is possible.

This looks like a serious bug that needs to be addressed.  Does anyone
have a clue about how to fix/debug this?




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

* Re: 23.0.60; emacsclient -t not working within "less"
  2008-09-18 18:36 23.0.60; emacsclient -t not working within "less" Chong Yidong
@ 2008-09-19  6:28 ` Dan Nicolaescu
  2008-09-19 15:51   ` Chong Yidong
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Nicolaescu @ 2008-09-19  6:28 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 427, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

  > From bug 427:
  > 
  > > 1) start emacs with "emacs -q -f server-start &"
  > > 2) export VISUAL="emacsclient -t"
  > > 2) less .bashrc
  > > 3) within less type "v" to edit file with $VISUAL 
  > >
  > > the result is that less writes a line "!emacsclient -t +18 .bashrc" on
  > > the terminal, but other than that the terminal is still showing the
  > > output of less. emacsclient is not taking over the terminal, and no
  > > editing is possible.
  > 
  > This looks like a serious bug that needs to be addressed.  Does anyone
  > have a clue about how to fix/debug this?

You can edebug `server-process-filter'.  Doing that shows quickly the
problem: emacsclient passes the tty as: -tty /dev/tty.
/dev/tty means one thing for emacsclient and another one for emacs...

emacsclient.c computes the tty like this:

      tty_name = ttyname (fileno (stdin));

changing it to:

      tty_name = ttyname (fileno (stdout));

gets the right terminal and this problem seems to be fixed.





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

* Re: 23.0.60; emacsclient -t not working within "less"
  2008-09-19  6:28 ` Dan Nicolaescu
@ 2008-09-19 15:51   ` Chong Yidong
  2008-09-19 16:30     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2008-09-19 15:51 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 427-done, Andreas Amann, emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> You can edebug `server-process-filter'.  Doing that shows quickly the
> problem: emacsclient passes the tty as: -tty /dev/tty.
> /dev/tty means one thing for emacsclient and another one for emacs...
>
> emacsclient.c computes the tty like this:
>
>       tty_name = ttyname (fileno (stdin));
>
> changing it to:
>
>       tty_name = ttyname (fileno (stdout));
>
> gets the right terminal and this problem seems to be fixed.

That seems to work fine for me too.  I checked in the fix.  Thanks.




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

* Re: 23.0.60; emacsclient -t not working within "less"
  2008-09-19 15:51   ` Chong Yidong
@ 2008-09-19 16:30     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2008-09-19 16:30 UTC (permalink / raw)
  To: Chong Yidong; +Cc: dann, andreas.amann, emacs-devel

> From: Chong Yidong <cyd@stupidchicken.com>
> Date: Fri, 19 Sep 2008 11:51:09 -0400
> Cc: 427-done@emacsbugs.donarmstrong.com, Andreas Amann <andreas.amann@web.de>,
> 	emacs-devel@gnu.org
> 
> Dan Nicolaescu <dann@ics.uci.edu> writes:
> 
> > You can edebug `server-process-filter'.  Doing that shows quickly the
> > problem: emacsclient passes the tty as: -tty /dev/tty.
> > /dev/tty means one thing for emacsclient and another one for emacs...
> >
> > emacsclient.c computes the tty like this:
> >
> >       tty_name = ttyname (fileno (stdin));
> >
> > changing it to:
> >
> >       tty_name = ttyname (fileno (stdout));
> >
> > gets the right terminal and this problem seems to be fixed.
> 
> That seems to work fine for me too.  I checked in the fix.  Thanks.

Yes, but is this the right fix?  The `tty' command prints "/dev/tty"
as well in the situation described by the original bug report.  Why
doesn't Emacs DTRT with that name?  Can it fail in a similar way with
the name of the device connected to stdout?




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

end of thread, other threads:[~2008-09-19 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-18 18:36 23.0.60; emacsclient -t not working within "less" Chong Yidong
2008-09-19  6:28 ` Dan Nicolaescu
2008-09-19 15:51   ` Chong Yidong
2008-09-19 16:30     ` Eli Zaretskii

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).