Kenny Woo

finding new ways to procrastinate.

github twitter linkedin email rss
Running Interactive Processes in Tmux
Aug 12, 2015
One minute read

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):
ctrl-b, d

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 ~/.zshrc:

if [ -n "$TMUX" ]; then set -o ignoreeof; fi

Back to posts