Created
July 17, 2016 11:27
-
-
Save kunev/dccfd344802c3b602c4936aa2abf576c to your computer and use it in GitHub Desktop.
fzf menu to start/attach a tmux session
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
if [[ -z $TMUX ]]; then | |
new_session_token='START NEW SESSION' | |
no_session='DO NOT START TMUX' | |
choice=$( (echo $new_session_token; echo $no_session; tmux ls) | fzf | cut -d':' -f 1) | |
case "$choice" in | |
"$new_session_token") | |
tmux new-session | |
exit | |
;; | |
"$no_session") | |
;; | |
*) | |
tmux att -t $choice | |
exit | |
;; | |
esac | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment