Skip to main content
deleted 75 characters in body
Source Link
Kamil Maciorowski
  • 24.5k
  • 2
  • 69
  • 129

Thanks to -d the client will start a new session (dispatch the job), but it won't attach the new session to the terminal. The client won't put you into the session, it will exit almost immediately, this will make the shell interpreting the script continue. (Note nohup is similar in this matter: it exits after setting up a job.)

This means most likely you don't need to worry. If you start your job in tmux in the right way (described above) and if you don't create additional panes or windows in the session, then the session will exit automatically when the job is done. Compare this anotherother answer of mine.

Thanks to -d the client will start a new session (dispatch the job), but it won't attach the new session to the terminal. The client won't put you into the session, it will exit almost immediately, this will make the shell interpreting the script continue. (Note nohup is similar in this matter: it exits after setting up a job.)

This means most likely you don't need to worry. If you start your job in tmux in the right way (described above) and if you don't create additional panes or windows in the session, then the session will exit automatically when the job is done. Compare this another answer of mine.

Thanks to -d the client will start a new session (dispatch the job), but it won't attach the new session to the terminal. The client won't put you into the session, it will exit almost immediately, this will make the shell interpreting the script continue.

This means most likely you don't need to worry. If you start your job in tmux in the right way (described above) and if you don't create additional panes or windows in the session, then the session will exit automatically when the job is done. Compare this other answer of mine.

edited body
Source Link
Kamil Maciorowski
  • 24.5k
  • 2
  • 69
  • 129

It will dispatch a job and terminate immediately. Check tmux ls. Wait few seconds, then tmux attach -t myloop and you will see the job has been running since and still is. When attached, terminate the loop (with Ctrl+Cc); the session (and possibly the tmux server) will terminate automatically*, check tmux ls again to confirm.

It will dispatch a job and terminate immediately. Check tmux ls. Wait few seconds, then tmux attach -t myloop and you will see the job has been running since and still is. When attached, terminate the loop (with Ctrl+C); the session (and possibly the tmux server) will terminate automatically*, check tmux ls again to confirm.

It will dispatch a job and terminate immediately. Check tmux ls. Wait few seconds, then tmux attach -t myloop and you will see the job has been running since and still is. When attached, terminate the loop (with Ctrl+c); the session (and possibly the tmux server) will terminate automatically*, check tmux ls again to confirm.

added 1 character in body
Source Link
Kamil Maciorowski
  • 24.5k
  • 2
  • 69
  • 129

*Options that alter the behavior: remain-on-exit, exit-empty.

*Options that alter the behavior: remain-on-exit exit-empty.

*Options that alter the behavior: remain-on-exit, exit-empty.

Bounty Awarded with 50 reputation awarded by Charlie Parker
added 959 characters in body
Source Link
Kamil Maciorowski
  • 24.5k
  • 2
  • 69
  • 129
Loading
Source Link
Kamil Maciorowski
  • 24.5k
  • 2
  • 69
  • 129
Loading