Last active
August 29, 2015 14:03
-
-
Save kunev/79c58d7066d16a916ef7 to your computer and use it in GitHub Desktop.
tmux attach with percol
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
function pattach() { | |
if [[ $1 == "" ]]; then | |
PERCOL=percol | |
else | |
PERCOL="precol --query $1" | |
fi | |
sessions=$(tmux ls) | |
[ $? -ne 0 ] && return | |
session=$(echo $sessions | eval $PERCOL | cut -d : -f 1) | |
if [[ -n "$session" ]]; then | |
tmux att -t $session | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment