How can I get bash-like job control in zsh?

2

I want to configure zsh so that its job control behaves more like (I think) bash does by default. In particular:

  1. When I start a background job, it is by default owned by the shell and can be controlled via its job control.
  2. When I try to quit once, I get a warning.
  3. When I quit again, it is automatically disowned (i.e. not terminated) and zsh ends.

I've been testing this by executing sleep 1000 & to create a background job. Putting setopt CHECK_JOBS in my ~/.zshrc appears to address point (2) above. However, I cannot get (3) to work; zsh always kills the process when the shell quits. How can I stop this?

Andrew Ferrier

Posted 2013-02-14T11:42:18.197

Reputation: 1 604

Answers

4

Unset the HUP option using one of the following

setopt NO_HUP
unsetopt HUP

chepner

Posted 2013-02-14T11:42:18.197

Reputation: 5 645