summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/vterm-config.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/vterm-config.el b/modules/vterm-config.el
index 0817c3d9..70f5d60a 100644
--- a/modules/vterm-config.el
+++ b/modules/vterm-config.el
@@ -215,6 +215,17 @@ because tmux never sees the events."
(interactive)
(cj/vterm--send-mouse-wheel 65))
+(defun cj/vterm-send-escape ()
+ "Send the ESC byte to the program running in this vterm.
+
+`<escape>' is bound globally to `keyboard-escape-quit' (see
+`modules/keybindings.el'), so without this override Emacs swallows
+the key before it can reach the pty. Forwarding it here lets tmux
+copy-mode cancel, vi-mode exits, and any other in-terminal program
+that relies on Escape see the key."
+ (interactive)
+ (vterm-send-string "\e"))
+
(use-package vterm
:defer .5
:commands (vterm vterm-other-window)
@@ -255,7 +266,8 @@ ai-vterm.el is loaded."
("<wheel-up>" . cj/vterm-mouse-wheel-up)
("<wheel-down>" . cj/vterm-mouse-wheel-down)
("<mouse-4>" . cj/vterm-mouse-wheel-up)
- ("<mouse-5>" . cj/vterm-mouse-wheel-down))
+ ("<mouse-5>" . cj/vterm-mouse-wheel-down)
+ ("<escape>" . cj/vterm-send-escape))
:custom
(vterm-kill-buffer-on-exit t)
(vterm-max-scrollback 100000)