Created
October 18, 2014 00:46
-
-
Save Pitometsu/cdb491b941d5888e0948 to your computer and use it in GitHub Desktop.
manage tmux, put at end of ~/.zshrc or ~/.bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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