Created
March 14, 2018 09:55
-
-
Save thiemok/4c7e32c2f21609c5d4505e19436541fb to your computer and use it in GitHub Desktop.
Auto launch tmux, add this to your .bashrc or similar
This file contains hidden or 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
[[ $- != *i* ]] && return | |
if [[ -z "$TMUX" ]] ;then | |
ID="`tmux ls | grep -vm1 attached | cut -d: -f1`" # get the id of a deattached session | |
if [[ -z "$ID" ]] ;then # if not available create a new one | |
tmux new-session | |
else | |
tmux attach-session -t "$ID" # if available attach to it | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment