Add Alt+esc to close a pane too

This commit is contained in:
David Heinemeier Hansson
2026-05-15 13:39:17 +02:00
parent 2f56b525c6
commit 870fe16b0a
2 changed files with 8 additions and 1 deletions
+2
View File
@@ -15,6 +15,8 @@ bind -T copy-mode-vi y send -X copy-selection-and-cancel
# Pane Controls
bind -n M-Enter split-window -v -c "#{pane_current_path}"
bind -n M-S-Enter split-window -h -c "#{pane_current_path}"
bind -n M-Escape kill-pane
bind h split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
bind x kill-pane
+6 -1
View File
@@ -1,4 +1,4 @@
echo "Add Alt+Enter and Alt+Shift+Enter split keybindings to tmux"
echo "Add Alt+Enter split and Alt+Escape close keybindings to tmux"
tmux_config="$HOME/.config/tmux/tmux.conf"
@@ -15,6 +15,11 @@ if [[ -f $tmux_config ]]; then
changed=1
fi
if ! grep -qxF 'bind -n M-Escape kill-pane' "$tmux_config"; then
printf 'bind -n M-Escape kill-pane\n' >>"$tmux_config"
changed=1
fi
if (( changed )); then
omarchy-restart-tmux
fi