Skip to content

Instantly share code, notes, and snippets.

@Pitometsu
Created October 18, 2014 00:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Pitometsu/cdb491b941d5888e0948 to your computer and use it in GitHub Desktop.
Save Pitometsu/cdb491b941d5888e0948 to your computer and use it in GitHub Desktop.
manage tmux, put at end of ~/.zshrc or ~/.bashrc
#!/bin/bash
# manage Tmux
if [ -n "$TMUX" ]; then # in tmux
if [ -n "$COLORTERM" ]; then # in rich VT
export TERM=xterm-256color-italic
fi
elif tmux list-sessions &> /dev/null; then
tmux attach &> /dev/null # try to attach
else
tmux &> /dev/null # just start new tmux
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment