all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Proulx <bob@proulx.com>
To: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <20160405230440836909377@bob.proulx.com> (raw)
In-Reply-To: <CAJQX3DxGQW1HGH3byD_cPSofoTRavKygE=aMseoJh8TYre4RgQ@mail.gmail.com>

Shiyao Ma wrote:
> Barry Margolin wrote:
> > Shiyao Ma <I@introo.me> wrote:
> > Maybe:
> > M-! /usr/bin/ranger </dev/tty >&/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 <barmar@alum.mit.edu> 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 >/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 >/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



  reply	other threads:[~2016-04-06  5:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.8886.1459691173.843.help-gnu-emacs@gnu.org>
2016-04-03 14:08 ` under termianl emacs, how to start a process and make it believe it's running inside a termial? Pascal J. Bourguignon
2016-04-04  5:40   ` Shiyao Ma
2016-04-04  5:46     ` Shiyao Ma
     [not found]     ` <mailman.8972.1459748791.843.help-gnu-emacs@gnu.org>
2016-04-04 15:00       ` Barry Margolin
2016-04-05  2:11         ` Shiyao Ma
     [not found]         ` <mailman.9050.1459822277.843.help-gnu-emacs@gnu.org>
2016-04-05  2:43           ` Barry Margolin
2016-04-06  2:43             ` Shiyao Ma
2016-04-06  5:27               ` Bob Proulx [this message]
2016-04-04 16:09     ` Yuri Khan
2016-04-03 13:46 Shiyao Ma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160405230440836909377@bob.proulx.com \
    --to=bob@proulx.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.