fix(tmux): sesh selection now works in fish

Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
This commit is contained in:
2025-11-12 11:48:10 +02:00
parent 62eb417935
commit ded4bf3bb3
3 changed files with 27 additions and 24 deletions

18
config/tmux/sesh-tmux.fish Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env fish
set selection (sesh list --icons | fzf-tmux -p 80%,70% \
--no-sort --ansi --border-label ' sesh ' --prompt '⚡ ' \
--header ' ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \
--bind 'tab:down,btab:up' \
--bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \
--bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list -t --icons)' \
--bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c --icons)' \
--bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z --icons)' \
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
--bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \
--preview-window 'right:55%' \
--preview 'sesh preview {}')
if test -n "$selection"
sesh connect "$selection"
end

View File

@@ -103,32 +103,16 @@ unbind p
bind p paste-buffer
# tms bindings
bind -N "tms" t display-popup -E "tms"
bind -N "tms" T display-popup -E "tms"
bind -N "tms windows" C-w display-popup -E "tms windows"
bind -N "tms switch" C-s display-popup -E "tms switch"
bind -N "tms refresh" C-r display-popup -E "tms refresh"
# global sessions
# bind-key "K" display-popup -h 90% -w 50% -E "sesh ui"
bind-key "K" run-shell "sesh connect \"$(
sesh list --icons --hide-duplicates | fzf-tmux -p 100%,100% --no-border \
--list-border \
--no-sort --prompt '⚡ ' \
--input-border \
--header-border \
--bind 'tab:down,btab:up' \
--bind 'ctrl-b:abort' \
--bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \
--bind 'ctrl-t:change-prompt( )+reload(sesh list -t --icons)' \
--bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c --icons)' \
--bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z --icons)' \
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
--bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \
--preview-window 'right:70%' \
--preview 'sesh preview {}' \
)\""
bind-key "N" display-popup -E "sesh ui"
bind -N "sesh selection" t run-shell "$HOME/.dotfiles/config/tmux/sesh-tmux.fish"
bind -N "last-session (via sesh) " L run-shell "sesh last"
bind -N "sesh ui" N display-popup -E "sesh ui"
# ╭──────────────────────────────────────────────────────────╮
# │ Plugins │

View File

@@ -33,8 +33,10 @@ Leader: `<ctrl><space>`
? List key bindings
D Choose and detach a client from a list
E Spread panes out evenly
L Switch to the last client
L last-session (via sesh)
M Clear the marked pane
N sesh ui
T tms
] Paste the most recent paste buffer
c Create a new window
d Detach the current client
@@ -46,7 +48,7 @@ Leader: `<ctrl><space>`
o Select the next pane
q Display pane numbers
s Choose a session from a list
t tms
t sesh selection
w Choose a window from a list
x Kill the active pane
z Zoom the active pane
@@ -74,8 +76,6 @@ Leader: `<ctrl><space>`
M-Left Resize the pane left by 5
M-Right Resize the pane right by 5
C-o Rotate through the panes
C-r tms refresh
C-s tms switch
C-w tms windows
C-z Suspend the current client
C-Up Resize the pane up
@@ -87,3 +87,4 @@ Leader: `<ctrl><space>`
S-Left Move the visible part of the window left
S-Right Move the visible part of the window right
```