Exit zsh, but leave running jobs open?

前端 未结 4 1023
温柔的废话
温柔的废话 2021-01-30 01:25

Just switched from bash to zsh.

In bash, background tasks continue running when the shell exits. For example here, dolphin continues running after the

4条回答
  •  长情又很酷
    2021-01-30 01:53

    I typically use screen for keeping background jobs running.

    1) Create a screen session:

    screen -S myScreenName
    

    2) Launch your scripts,services,daemons or whatever

    3) Exit (detach) screen-session with

    screen -d
    

    or shortcut ALT+A then d


    After few hundreds of years - if you want to resume your session (reattach):

    screen -r myScreenName
    

    If you want to know if there's a screen-session, its name and its status (attached or detached):

    screen -ls
    

    This solution works on all terminal interpreters like bash, zsh etc. See also man screen

提交回复
热议问题