刚从bash切换到zsh。
这是bash的行为(使用海豚作为随机示例):
$ dolphin . ^Z [1]+ Stopped dolphin . $ bg [1]+ dolphin . & $ exit
所以它让海豚跑。
这就是我想要的默认行为。
相比之下,这是zsh的行为:
% dolphin . ^Z zsh: suspended dolphin . % bg [1] + continued dolphin . % exit zsh: you have running jobs. % exit
所以它首先警告我有运行的工作。
我如何使zsh的默认行为在这里像bash的?
从
zsh documentation:
原文链接:/bash/389727.html
HUP
… In zsh,if you have a background job running when the shell exits,the shell will assume you want that to be killed; in this case it is sent a particular signal called
SIGHUP
… If you often start jobs that should go on even when the shell has exited,then you can set the optionNO_HUP
,and background jobs will be left alone.
所以只要设置NO_HUP选项:
% setopt NO_HUP