I’ve been using
tmux for my remote sessions to preserve jobs in case I get disconnected. The following have been extremely helpful.
Attach/Detach to Sessions
New tmux session:
tmux new -s <session name>
Detach from session (default):
Re-attach to session:
tmux attach -t <session name>
Run commands in new [detatched] tmux session:
tmux new -[d]s <session name> "cmd1; cmd2"
Disable Sending EOF (via CTRL-d) to ZSH
Note: This is the same as
export IGNOREEOF=10 in BASH.
Add the following to your
if [ -n "$TMUX" ]; then set -o ignoreeof; fi