如果作业停止/暂停,有没有办法不退出 shell?

如果作业停止/暂停,有没有办法不退出 shell?

如果键入一个作业exit并停止/暂停,shell 将打印一条警告消息而不是退出。

1: some_command &
[1] 4018347
2: exit
zsh: you have suspended jobs.

但如果再次输入exit,shell 将退出。

3: exit
<session terminates>

有没有办法防止这种情况发生,以及绝不如果有停止/暂停的作业,请退出?

3: exit
zsh: you have suspended jobs.
4: exit
zsh: you have suspended jobs.
5: exit
zsh: you have suspended jobs.
6: exit
zsh: you have suspended jobs.

相关内容