Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

long-standing tty related issue: wrapped Emacs not suspended



A long-standing tty related issue...

I often run Emacs in background:

  emacs &

This makes sense as it has its own X interface. But I sometimes do
this when I forgot that I was in a SSH session with no X forwarding,
and this makes the terminal unusable since Emacs is not suspended
and both zsh and Emacs try to get terminal input.

Now I've noticed that when I run the Emacs binary directly, Emacs
is suspended as expected. But when Emacs is wrapped in a function,
it is not suspended. After "zsh -f":

zira% e() { emacs -nw "$@"; }
zira% e &

I cannot quit Emacs or get the zsh prompt. I need to kill the
terminal.

I've tested the same thing with other shells: dash behaves like
zsh, and bash, ksh93 and mksh immediately terminate.

The same thing happens when using a sh script instead of a function.

Is this a bug? In any case, can this be solved?

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Messages sorted by: Reverse Date, Date, Thread, Author