aboutsummaryrefslogtreecommitdiff
path: root/modules/terminal-compat.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-02 08:34:36 -0600
committerCraig Jennings <c@cjennings.net>2026-02-02 08:34:36 -0600
commitd89b1765a1c9f77ef82ab3db5a1e4299299ec6bb (patch)
treed6dc08124e19e26491cbd0f0069b9f8cfeadf689 /modules/terminal-compat.el
parent5bb732910cac405b21a9d6b4ac79280021997cec (diff)
downloaddotemacs-d89b1765a1c9f77ef82ab3db5a1e4299299ec6bb.tar.gz
dotemacs-d89b1765a1c9f77ef82ab3db5a1e4299299ec6bb.zip
feat(keyboard): add GUI key translation for M-S- bindings
Rename terminal-compat.el to keyboard-compat.el and add GUI support. Problem: M-S-o and other Meta+Shift bindings didn't work in GUI mode. GUI Emacs receives M-O (uppercase) but bindings use M-S-o syntax. Terminal can't use M-O due to arrow key escape sequence conflicts. Solution: Use key-translation-map in GUI mode to translate M-O -> M-S-o for all 18 Meta+Shift keybindings. Terminal fixes unchanged. Also fix two test issues: - Remove expected-fail from expand-weekly test (timezone fix resolved it) - Add helpful install messages to dependency-checking tests
Diffstat (limited to 'modules/terminal-compat.el')
-rw-r--r--modules/terminal-compat.el54
1 files changed, 0 insertions, 54 deletions
diff --git a/modules/terminal-compat.el b/modules/terminal-compat.el
deleted file mode 100644
index f959646d..00000000
--- a/modules/terminal-compat.el
+++ /dev/null
@@ -1,54 +0,0 @@
-;;; terminal-compat.el --- Terminal compatibility fixes -*- lexical-binding: t; coding: utf-8; -*-
-;; author: Craig Jennings <c@cjennings.net>
-
-;;; Commentary:
-
-;; Fixes for running Emacs in terminal/console mode, especially over mosh.
-;; - Arrow key escape sequence handling
-;; - Disable graphical icons that show as unicode artifacts
-
-;;; Code:
-
-(require 'host-environment)
-
-(defun cj/terminal-compat-setup ()
- "Set up terminal compatibility after init completes."
- (when (env-terminal-p)
- ;; Fix arrow key escape sequences for various terminal types
- (define-key input-decode-map "\e[A" [up])
- (define-key input-decode-map "\e[B" [down])
- (define-key input-decode-map "\e[C" [right])
- (define-key input-decode-map "\e[D" [left])
-
- ;; Application mode arrows (sent by some terminals)
- (define-key input-decode-map "\eOA" [up])
- (define-key input-decode-map "\eOB" [down])
- (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/terminal-compat-setup)
-
-;; Icon disabling only in terminal mode
-(when (env-terminal-p)
- ;; Disable nerd-icons display (shows as \uXXXX artifacts)
- (with-eval-after-load 'nerd-icons
- (defun nerd-icons-icon-for-file (&rest _) "")
- (defun nerd-icons-icon-for-dir (&rest _) "")
- (defun nerd-icons-icon-for-mode (&rest _) "")
- (defun nerd-icons-icon-for-buffer (&rest _) ""))
-
- ;; Disable dashboard icons
- (with-eval-after-load 'dashboard
- (setq dashboard-display-icons-p nil)
- (setq dashboard-set-file-icons nil)
- (setq dashboard-set-heading-icons nil))
-
- ;; Disable all-the-icons
- (with-eval-after-load 'all-the-icons
- (defun all-the-icons-icon-for-file (&rest _) "")
- (defun all-the-icons-icon-for-dir (&rest _) "")
- (defun all-the-icons-icon-for-mode (&rest _) "")))
-
-(provide 'terminal-compat)
-;;; terminal-compat.el ends here