From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: 23.0.60; emacsclient -t not working within "less" Date: Thu, 18 Sep 2008 23:28:17 -0700 (PDT) Message-ID: <200809190628.m8J6SHQX000229@mothra.ics.uci.edu> References: <87skrxz4h0.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221805733 10399 80.91.229.12 (19 Sep 2008 06:28:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Sep 2008 06:28:53 +0000 (UTC) Cc: 427@emacsbugs.donarmstrong.com, emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 19 08:29:49 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KgZUy-0001BN-37 for ged-emacs-devel@m.gmane.org; Fri, 19 Sep 2008 08:29:48 +0200 Original-Received: from localhost ([127.0.0.1]:56991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgZTw-0006QC-OG for ged-emacs-devel@m.gmane.org; Fri, 19 Sep 2008 02:28:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KgZTq-0006Q7-W1 for emacs-devel@gnu.org; Fri, 19 Sep 2008 02:28:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KgZTq-0006Pu-79 for emacs-devel@gnu.org; Fri, 19 Sep 2008 02:28:38 -0400 Original-Received: from [199.232.76.173] (port=34831 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KgZTp-0006Pr-VI for emacs-devel@gnu.org; Fri, 19 Sep 2008 02:28:38 -0400 Original-Received: from barrelv2.ics.uci.edu ([128.195.1.114]:34890) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1KgZTp-0004pk-JY for emacs-devel@gnu.org; Fri, 19 Sep 2008 02:28:37 -0400 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by barrelv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m8J6SIjW021498; Thu, 18 Sep 2008 23:28:18 -0700 (PDT) Original-Received: (from dann@localhost) by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id m8J6SHQX000229; Thu, 18 Sep 2008 23:28:17 -0700 (PDT) In-Reply-To: <87skrxz4h0.fsf@cyd.mit.edu> (Chong Yidong's message of "Thu, 18 Sep 2008 14:36:11 -0400") Original-Lines: 31 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: m8J6SIjW021498 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:103967 Archived-At: Chong Yidong 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.