Created
February 12, 2015 12:56
-
-
Save kidpixo/3f6a5891323491891997 to your computer and use it in GitHub Desktop.
List hierarchically all window and panes in the input tmux session
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
# list all panes in the session specified in input | |
function tmux_list_all_panes | |
if not set -q $argv | |
echo $argv | |
for el in (tmux list-windows -t $argv) | |
echo " "$el | |
for elem in (tmux list-pane -t $argv:(echo $el | cut -d":" -f 1)) | |
echo " "$elem | |
end | |
end | |
else | |
echo "Specify an input target session with -t NAME" | |
end | |
end | |
# add completion to the previous function | |
complete -x -c tmux_list_all_panes -a '(tmux list-sessions | cut -d":" -f 1)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment