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

Re: Zsh: [7] + 23074 suspended (tty output)



es
On Wed, Sep 19, 2018 at 05:38:11AM +0200, TS wrote:
> Hello Peter,
> 
> when emacs is wrapped inside function,
> then emacs is dead when:
> 
> ^Z
> bg
> 
> Does not happen when emacs called w/o function.
> See minimal .zshrc attached.
> 
> 
> % su -l heinb
> Password:
> tosh% emacs
> 
> zsh: suspended  emacs
> tosh% bg
> [1]  + continued  emacs
> tosh%
> [1]  + suspended (tty output)  emacs
> tosh% jobs -l
> [1]  + 20708 suspended (tty output)  emacs
> tosh% fg %1
> [1]  + continued  emacs
> tosh% eclient
> zsh: suspended  eclient
> tosh% jobs -l
> [1]  + 20718 suspended (signal)  eclient
> tosh% bg
> [1]  + continued  eclient
> tosh% jobs -l
> [1]  - 20718 running    eclient
> tosh% fg %1
> [1]  - running    eclient
> <<<#### here terminal is broken
> 
> 
> setopt NO_globalrcs
> eclient () {
> 	=emacs "$@"
> }
> 
> 

This is not a new phenomenon. I can reproduce it with zsh 5.3. ps
shows one difference between the function and the normal emacs case:
there is another zsh instance:
function case after issuing bg:
$ ps -o pid,ppid,state,command
80367 80366 Ss   /bin/zsh
80900 80367 T+   /opt/local/bin/emacs
80902 80367 T    /bin/zsh

normal case after issuing bg:
$ ps -o pid,ppid,state,command
81266 81265 Ss   /bin/zsh
81297 81266 T    /opt/local/bin/emacs

After fg %1, I can revive the function case by sending SIGCONT
directly to the emacs process.

-- 
Best,
Daniel



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