joshmedeski / sesh

Smart session manager for the terminal
MIT License
417 stars 17 forks source link

Binding for Killing a tmux Session #21

Closed RiteshChepuri closed 5 months ago

RiteshChepuri commented 5 months ago

Add a Binding to kill tmux session from the prompt.

joshmedeski commented 5 months ago

Which prompt do you mean?

If fzf, you can add something like this to the command:

sesh connect $(
    sesh list -tz | fzf-tmux -p 55%,60% \
        --no-sort --border-label ' sesh ' --prompt '⚡  ' \
        --header '  ^a all ^t tmux ^x zoxide ^f find ^d kill-session' \
        --bind 'tab:down,btab:up' \
        --bind 'ctrl-a:change-prompt(⚡  )+reload(sesh list)' \
        --bind 'ctrl-t:change-prompt(🪟  )+reload(sesh list -t)' \
        --bind 'ctrl-x:change-prompt(📁  )+reload(sesh list -z)' \
        --bind 'ctrl-f:change-prompt(🔎  )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
        --bind 'ctrl-d:execute(tmux kill-session -t {})+reload(sesh list)'
)"

This is the line that's important:

        --bind 'ctrl-d:execute(tmux kill-session -t {})+reload(sesh list)'