diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-11 00:02:50 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-11 00:02:50 -0500 |
| commit | 287ca3a7cb8a351e5cae1b2480fbe2baf42e2fc8 (patch) | |
| tree | 174f94f42a6a6df1f52fb32364ae3cbcdc36ec5b /modules/keyboard-compat.el | |
| parent | 0cd82cab2699ae4cba5772da8a69d5402fd391b6 (diff) | |
| download | dotemacs-287ca3a7cb8a351e5cae1b2480fbe2baf42e2fc8.tar.gz dotemacs-287ca3a7cb8a351e5cae1b2480fbe2baf42e2fc8.zip | |
fix(keyboard-compat): register terminal arrow-key setup on tty-setup-hook
The arrow-key decodings ran on emacs-startup-hook, but input-decode-map is terminal-local and a daemon's startup hook fires once with no tty. So every emacsclient -t frame opened later missed the decodings, and arrow keys broke in terminal frames. tty-setup-hook runs for each new tty frame, daemon and non-daemon alike. The GUI half already frame-scopes itself. A test pins the hook so a regression back to emacs-startup-hook fails.
Diffstat (limited to 'modules/keyboard-compat.el')
| -rw-r--r-- | modules/keyboard-compat.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/keyboard-compat.el b/modules/keyboard-compat.el index 9395b9c8..b72362e7 100644 --- a/modules/keyboard-compat.el +++ b/modules/keyboard-compat.el @@ -45,8 +45,11 @@ This runs after init to override any package settings." (define-key input-decode-map "\eOC" [right]) (define-key input-decode-map "\eOD" [left]))) -;; Run after init completes to override any package settings -(add-hook 'emacs-startup-hook #'cj/keyboard-compat-terminal-setup) +;; `input-decode-map' is terminal-local, and a daemon's `emacs-startup-hook' +;; runs once with no tty, so a startup-hook registration never reaches the +;; `emacsclient -t' frames that need it. `tty-setup-hook' runs for each new +;; tty frame (daemon and non-daemon alike), which is where the decodings belong. +(add-hook 'tty-setup-hook #'cj/keyboard-compat-terminal-setup) ;; Icon-rendering functions return blank on terminal frames so unicode ;; artifacts don't show up. The check runs per call against the selected |
