Skip to content

Instantly share code, notes, and snippets.

@erronjason
Last active August 15, 2016 13:08
Show Gist options
  • Save erronjason/97b7f52c7f05f76bd78f to your computer and use it in GitHub Desktop.
Save erronjason/97b7f52c7f05f76bd78f to your computer and use it in GitHub Desktop.
Re-attach to same tmux session for terminals

Gnome-terminal:

/bin/bash -c "TERM=screen-256color-bce tmux attach -t main || TERM=screen-256color-bce tmux new -s main;"

iTerm2:

/bin/bash -c "TERM=screen-256color-bce /usr/local/bin/tmux attach -t main || TERM=screen-256color-bce /usr/local/bin/tmux new -s main;"

As of 9/15/2016, my iterm uses bash -l tmux attach -t base || tmux new -s base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment