help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: under termianl emacs, how to start a process and make it believe it'


From: Bob Proulx
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
User-agent: Mutt/1.5.24 (2015-08-30)

Shiyao Ma wrote:
> Barry Margolin wrote:
> > Shiyao Ma <address@hidden> 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 <address@hidden> 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...
  address@hidden:~$ stty echo onlcr
  address@hidden:~$ # Usable tty.
  address@hidden:~$ exit
    ...unusable emacs due to tty being in canonical mode...
    ...I should have returned to raw mode first...
  address@hidden:~$ stty -echo -onlcr
  address@hidden:~$ 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 via email to

[Prev in Thread] Current Thread [Next in Thread]