tmux: bind tmux-session-menu

This commit is contained in:
Łukasz Pankowski 2025-04-04 02:19:07 +02:00
parent 29608ff8c4
commit d6ba2a78b9
2 changed files with 8 additions and 1 deletions

View File

@ -12,7 +12,7 @@ bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
bind-key -n M-0 select-window -t 10
#bind-key -n M-0 select-window -t 10
bind-key -n M-! swap-window -t 1
bind-key -n M-@ swap-window -t 2
@ -83,3 +83,5 @@ bind-key -T copy-mode-vi C-M-h swap-pane -s "{left-of}"
bind-key -T copy-mode-vi C-M-j swap-pane -s "{down-of}"
bind-key -T copy-mode-vi C-M-k swap-pane -s "{up-of}"
bind-key -T copy-mode-vi C-M-l swap-pane -s "{right-of}"
bind-key -n M-0 run-shell tmux-session-menu

5
tmux/bin/tmux-session-menu Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
tmux list-sessions -F '#S' \
| awk 'BEGIN {ORS=" "; print "toggle t \"switch-client -l\""} {print $1, NR, "\"switch-client -t", $1 "\""}' \
| xargs tmux display-menu -T "Switch session"