aboutsummaryrefslogtreecommitdiff
path: root/modules/keyboard-compat.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/keyboard-compat.el')
-rw-r--r--modules/keyboard-compat.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/keyboard-compat.el b/modules/keyboard-compat.el
index 9395b9c8..73138ca5 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
@@ -95,8 +98,7 @@ Meta+Shift+letter triggers M-S-letter keybindings."
(define-key key-translation-map (kbd "M-D") (kbd "M-S-d"))
(define-key key-translation-map (kbd "M-I") (kbd "M-S-i"))
(define-key key-translation-map (kbd "M-C") (kbd "M-S-c"))
- (define-key key-translation-map (kbd "M-B") (kbd "M-S-b"))
- (define-key key-translation-map (kbd "M-K") (kbd "M-S-k"))))
+ (define-key key-translation-map (kbd "M-B") (kbd "M-S-b"))))
;; In daemon mode, no frame exists at startup so env-gui-p returns nil.
;; Use server-after-make-frame-hook to set up translations when the first