From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: under termianl emacs, how to start a process and make it believe it's running inside a termial? Date: Tue, 5 Apr 2016 23:27:28 -0600 Message-ID: <20160405230440836909377@bob.proulx.com> References: <878u0urdis.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1459920472 23947 80.91.229.3 (6 Apr 2016 05:27:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Apr 2016 05:27:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 06 07:27:48 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ang0J-0006uS-FW for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Apr 2016 07:27:47 +0200 Original-Received: from localhost ([::1]:40924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ang0F-0005kD-N6 for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Apr 2016 01:27:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ang06-0005k7-0o for help-gnu-emacs@gnu.org; Wed, 06 Apr 2016 01:27:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ang02-0006Ff-Pi for help-gnu-emacs@gnu.org; Wed, 06 Apr 2016 01:27:33 -0400 Original-Received: from havoc.proulx.com ([96.88.95.61]:58455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ang02-0006FM-Kj for help-gnu-emacs@gnu.org; Wed, 06 Apr 2016 01:27:30 -0400 Original-Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id 4E24BEF5 for ; Tue, 5 Apr 2016 23:27:29 -0600 (MDT) Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id ED69521237 for ; Tue, 5 Apr 2016 23:27:28 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id CBD812DC4D; Tue, 5 Apr 2016 23:27:28 -0600 (MDT) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 96.88.95.61 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109726 Archived-At: Shiyao Ma wrote: > Barry Margolin wrote: > > Shiyao Ma wrote: > > Maybe: > > M-! /usr/bin/ranger &/dev/tty > > Looks like the right direction. > > But after running it, I got: > zsh:1: device not configured: /dev/tty > On 5 April 2016 at 10:43, Barry Margolin wrote: > > > The tty should just be inherited from the terminal that you're running > > Emacs in. You're using "emacs -nw" to run it in the terminal window, > > aren't you? > > I am using emacs -nw under iTerm2. For what it is worth I see exactly the same behavior here. Running 'emacs -nw' in an XTerm from the bash prompt. I don't have a solution but here is some data for the thread. Trying this: Shell command: /bin/bash /dev/tty 2>&1 Yields this message. /bin/bash: /dev/tty: No such device or address I don't have systemd installed and so this isn't related to that side of things. /dev/tty exists but isn't associated with a terminal at that point. If I use job control to suspend (C-x C-z suspend-frame) then of course I drop back to the command line prompt. Looking at the vim_file_chooser reference in the first posting I can see what is attempted to be created. I can tell that even though the job control gets back to the command line and a terminal that it isn't helpful in trying to make that task work. I am just noting it in passing. If I look to see what tty I am on before launching emacs then I can associate with it. tty /dev/pts/4 emacs -nw Shell command: /bin/bash /dev/pts/4 2>&1 bash: cannot set terminal process group (11594): Inappropriate ioctl for device bash: no job control in this shell ...tty is in raw mode with echo turned off... rwp@havoc:~$ stty echo onlcr rwp@havoc:~$ # Usable tty. rwp@havoc:~$ exit ...unusable emacs due to tty being in canonical mode... ...I should have returned to raw mode first... rwp@havoc:~$ stty -echo -onlcr rwp@havoc:~$ exit ...usable emacs... And so while that is another data point it is rather useless information for getting to the goal. Emacs is running attached to the tty device. Running the shell-command routine detaches it from the terminal. Seems like there should be a way in elisp to run a shell command without having it detached from the tty. Bob