Last active
December 26, 2015 19:19
-
-
Save wx13/7200432 to your computer and use it in GitHub Desktop.
Easy selection of available tmux sessions
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
#!/bin/bash | |
LD_LIBRARY_PATH=$HOME/local/lib | |
k=0 | |
choices=() | |
while read line | |
do | |
k=$((k+1)) | |
echo $k "$line" | |
choices[$k]=${line%%:*} | |
done < <(tmux list-sessions) | |
echo -n "choice: " | |
read ans | |
tmux attach-session -t ${choices[$ans]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment