diff options
Diffstat (limited to 'tmux/.local/bin/tmux-tree')
-rwxr-xr-x | tmux/.local/bin/tmux-tree | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tmux/.local/bin/tmux-tree b/tmux/.local/bin/tmux-tree index d60bb44..600fd61 100755 --- a/tmux/.local/bin/tmux-tree +++ b/tmux/.local/bin/tmux-tree @@ -1,16 +1,16 @@ #!/usr/bin/env bash tmux ls -F'#{session_id}' | while read -r s; do - S=$(tmux ls -F'#{session_id}#{session_name}: #{T:tree_mode_format}' | grep ^"$s") - session_info=${S##$s} - session_name=$(echo "$session_info" | cut -d ':' -f 1) - if [[ -n "$1" ]] && [[ "$1" == "$session_name" ]]; then - echo -e "\033[1;34m$session_info\033[0m" - else - echo -e "\033[1m$session_info\033[0m" - fi - tmux lsw -t"$s" -F'#{window_id}' | while read -r w; do - W=$(tmux lsw -t"$s" -F'#{window_id}#{T:tree_mode_format}' | grep ^"$w") - echo " ${W##$w}" - done + S=$(tmux ls -F'#{session_id}#{session_name}: #{T:tree_mode_format}' | grep ^"$s") + session_info=${S##$s} + session_name=$(echo "$session_info" | cut -d ':' -f 1) + if [[ -n "$1" ]] && [[ "$1" == "$session_name" ]]; then + echo -e "\033[1;34m$session_info\033[0m" + else + echo -e "\033[1m$session_info\033[0m" + fi + tmux lsw -t"$s" -F'#{window_id}' | while read -r w; do + W=$(tmux lsw -t"$s" -F'#{window_id}#{T:tree_mode_format}' | grep ^"$w") + echo " ${W##$w}" + done done |