Add Emacs/readline editing mode#4270
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR introduces a complete new feature (Emacs/readline editing mode) with ~2200 lines of new logic, new components, global event handling, and settings integration. New features of this scope warrant human review. You can customize Macroscope's approvability policy. Learn more. |
ad28130 to
3d358f3
Compare
66b4b63 to
2fefbf3
Compare
d3bfe6c to
048b91d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 4 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 048b91d. Configure here.

Summary
Why
Browser text controls do not consistently provide Emacs/readline editing shortcuts across platforms, and candidate-selection surfaces only respond to arrow keys. This mode provides a consistent opt-in editing experience throughout T3 Code.
Validation
Note
Medium Risk
A global capture-phase keyboard listener and new precedence between readline chords, default shortcuts, and Lexical composer edits can change keyboard behavior app-wide when the mode is enabled.
Overview
Adds an opt-in
keyboardEditingModeclient setting (defaultvs Emacs / readline) in General settings, persisted through contracts and desktop client settings.When Emacs mode is on,
EmacsReadlineBindingsregisters a capture-phasekeydownhandler that applies readline chords to plain inputs, textareas, and generic contenteditable surfaces, maps Control-N/P to arrow navigation for open candidate pickers (with focus scoping), and skips terminals and keybinding-capture fields. Custom app shortcuts still win over readline via newresolveCustomShortcutCommandand optionalsource(default|user) on resolved keybindings; server runtime marks shipped defaults asdefault.The Lexical composer gets a dedicated plugin that treats mention/skill chips as single logical characters, integrates kill/yank with chip reconstruction, and uses
data-emacs-readline-managedso the global handler defers mutations to the editor.Reviewed by Cursor Bugbot for commit 4189d3c. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Emacs/readline editing mode for text inputs and the composer
EmacsReadlineBindingscomponent that registers a global capture-phase keydown listener, routing Ctrl/Alt chords through an Emacs/readline keybinding engine (emacsReadlineBindings.ts) for all text inputs, textareas, and contenteditable elements.ComposerEmacsReadlinePluginto the Lexical composer, treating inline mention/skill chips as single logical characters and integrating kill/yank with the kill ring; transpose across inline tokens is a no-op.keyboardEditingModesetting ('default'|'emacs') toClientSettings, exposed in the General settings panel; Emacs mode is off by default.sourcefield ('default'|'user') on resolved rules and aresolveCustomShortcutCommandAPI so Emacs key chords can yield to explicit user-defined application shortcuts without conflicting with built-in defaults.Macroscope summarized 4189d3c.