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.
|
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughEscape now supports configured prefix-mode bindings through ChangesEscape prefix bindings
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 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 RHS while preserving cancellation for unbound Escape.
Confidence Score: 5/5The PR appears safe to merge with bound and unbound Escape paths behaving as documented. Prefix-mode Escape now reaches the existing binding precedence before the unchanged cancellation fallback, while input lease handling prevents repeats or releases from executing an additional action.
|
| Filename | Overview |
|---|---|
| src/app/input/navigate.rs | Defers Escape cancellation until after prefix binding dispatch and tests both bound and unbound behavior. |
| src/config/keybinds.rs | Adds coverage confirming case-insensitive esc and escape aliases produce an Escape prefix trigger without diagnostics. |
| docs/next/website/src/content/docs/configuration.mdx | Documents Escape aliases, bound prefix behavior, and unbound cancellation. |
| docs/next/website/src/content/docs/ja/configuration.mdx | Updates the Japanese configuration guide with the new Escape prefix-binding behavior. |
| docs/next/website/src/content/docs/zh-cn/configuration.mdx | Updates the Simplified Chinese configuration guide with the new Escape prefix-binding behavior. |
| docs/next/CHANGELOG.md | Records the corrected Escape prefix-mode dispatch behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Escape pressed in Prefix mode] --> B{prefix+esc binding matches?}
B -->|Yes| C[Execute configured prefix action]
B -->|No| D[Leave prefix mode]
Reviews (1): Last reviewed commit: "style: rustfmt prefix-escape copy mode t..." | Re-trigger Greptile
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; unbound Esc still cancels prefix mode.
Happy to adjust anything if needed.