[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#427: 23.0.60; emacsclient -t not working within "less"
From: |
Dan Nicolaescu |
Subject: |
bug#427: 23.0.60; emacsclient -t not working within "less" |
Date: |
Thu, 18 Sep 2008 23:28:17 -0700 (PDT) |
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.