aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/keybindings.el6
-rw-r--r--tests/test-keybindings-two-column-unbound.el26
2 files changed, 32 insertions, 0 deletions
diff --git a/modules/keybindings.el b/modules/keybindings.el
index 7072cb9c..3e51b2dd 100644
--- a/modules/keybindings.el
+++ b/modules/keybindings.el
@@ -147,6 +147,12 @@ Errors if VAR is unbound, not a non-empty string, or the file does not exist."
;; ---------------------------- General Keybindings ----------------------------
;; Avoid hostile bindings
+;; two-column mode (2C-command): a grazed F2 + a stray 2/s/b replaces the
+;; buffer's mode-line-format with 2C's own retro layout and spawns a 2C/
+;; companion buffer. eat semi-char buffers don't forward F2, so the trap
+;; is armed everywhere. cj/modeline-reset repairs a hijacked buffer.
+(keymap-global-unset "<f2>") ;; 2C-command prefix
+(keymap-global-unset "C-x 6") ;; 2C-command prefix (same map)
(keymap-global-unset "C-x C-f") ;; find-file-read-only
(keymap-global-set "C-x C-f" #'find-file)
(keymap-global-set "C-z" (make-sparse-keymap)) ;; replace suspend-frame with prefix map
diff --git a/tests/test-keybindings-two-column-unbound.el b/tests/test-keybindings-two-column-unbound.el
new file mode 100644
index 00000000..f9bc2c52
--- /dev/null
+++ b/tests/test-keybindings-two-column-unbound.el
@@ -0,0 +1,26 @@
+;;; test-keybindings-two-column-unbound.el --- 2C-command is unbound -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; Two-column mode's global F2 / C-x 6 prefix replaces a buffer's
+;; mode-line-format with its own layout when triggered by a stray
+;; keypress (the 2026-07-01 archsetup agent-buffer incident).
+;; keybindings.el retires both bindings; these tests pin that.
+
+;;; Code:
+
+(require 'ert)
+
+(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
+
+(require 'keybindings)
+
+(ert-deftest test-keybindings-two-column-f2-unbound ()
+ "Normal: F2 no longer reaches the 2C-command prefix."
+ (should-not (keymap-lookup global-map "<f2>")))
+
+(ert-deftest test-keybindings-two-column-c-x-6-unbound ()
+ "Normal: C-x 6 no longer reaches the 2C-command prefix."
+ (should-not (keymap-lookup global-map "C-x 6")))
+
+(provide 'test-keybindings-two-column-unbound)
+;;; test-keybindings-two-column-unbound.el ends here