From 4107446a1c809209e01831a121d842bd7aa57bed Mon Sep 17 00:00:00 2001 From: thek4n Date: Fri, 6 Mar 2026 16:41:03 +0300 Subject: [PATCH] fix tmux kill --- home/user/.config/tmux/mappings.conf | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/home/user/.config/tmux/mappings.conf b/home/user/.config/tmux/mappings.conf index 9495613..09befe3 100644 --- a/home/user/.config/tmux/mappings.conf +++ b/home/user/.config/tmux/mappings.conf @@ -62,17 +62,21 @@ bind n new-session -c ~ # Switch new named session bind N command-prompt -p "New session:" "new-session -A -s '%1' -c ~" -bind x if-shell '[ "$(tmux display-message -p "#S")" != "landing" ]' \ +bind x if -F "#{?#{==:#{client_session},landing},0,1}" \ "confirm-before -p \"kill current session? (y/n)\" kill-session" \ - "display-message 'Нельзя закрыть сессию landing'" + "display-message 'Cannot kill session: landing'" -bind X confirm-before -p "kill last session [#{client_last_session}]? (y/n)" "kill-session -t #{client_last_session} \; display-message \"Killed last session\"" +bind X if -F "#{?#{==:#{client_last_session},landing},0,1}" \ + "confirm-before -p \"kill last session [#{client_last_session}]? (y/n)\" \"kill-session -t #{client_last_session} \\; display-message 'Killed last session'\"" \ + "display-message 'Cannot kill session: landing'" -bind C-x confirm-before -p "kill other sessions? (y/n)" "kill-session -a" +bind q if -F "#{?#{==:#{client_session},landing},0,1}" \ + "confirm-before -p \"kill current pane? (y/n)\" kill-pane" \ + "display-message 'Cannot kill session: landing'" -bind q confirm-before -p "kill current pane? (y/n)" "kill-pane" -bind Q confirm-before -p "kill current window? (y/n)" "kill-window" -bind C-q confirm-before -p "kill other windows? (y/n)" "kill-window -a" +bind Q if -F "#{?#{==:#{window_name},landing},0,1}" \ + "confirm-before -p \"kill current window? (y/n)\" kill-window" \ + "display-message 'Cannot kill session: landing'" bind d detach bind D choose-client -Z