fix(input): allow escape as a prefix-mode keybinding - #2322
Conversation
Prefix mode always canceled on Esc before binding lookup, so configs like copy_mode = "prefix+esc" (tmux bind Escape copy-mode) never ran. Unbound Esc still cancels prefix mode via the unmatched-key path.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughEscape now supports configured prefix-mode bindings through ChangesEscape prefix bindings
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant PrefixMode
participant KeybindingResolver
participant CopyMode
User->>PrefixMode: Press prefix then Escape
PrefixMode->>KeybindingResolver: Resolve configured Escape binding
KeybindingResolver->>CopyMode: Execute copy-mode action
PrefixMode-->>User: Exit prefix mode when Escape is unbound
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR allows Escape to act as a configured prefix-mode key while preserving cancellation for unbound Escape.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/app/input/navigate.rs | Removes unconditional Escape cancellation so configured prefix bindings execute, while unmatched Escape still exits prefix mode; tests cover bound and unbound behavior. |
| src/config/keybinds.rs | Adds tests confirming the supported Escape aliases parse into the expected prefix trigger without diagnostics. |
| docs/next/website/src/content/docs/configuration.mdx | Documents Escape aliases and the distinction between bound prefix behavior and unbound cancellation. |
Reviews (4): Last reviewed commit: "Merge branch 'master' into fix/prefix-es..." | Re-trigger Greptile
|
Hey @ogulcancelik, could you take a look at this? I’m using a fork for now because I’m really used to this keybind in tmux. |
Hey!
Esc always canceled prefix mode before keybinds ran, so copy_mode = "prefix+esc" (like tmux bind Escape copy-mode) never worked even though the config accepted it.
This treats Esc as a normal prefix RHS when bound, and unbound Esc still cancels prefix mode.
Happy to adjust anything if needed.