Skip to content

fix(input): allow escape as a prefix-mode keybinding - #2322

Open
fraidev wants to merge 2 commits into
herdrdev:masterfrom
fraidev:fix/prefix-escape-keybind
Open

fix(input): allow escape as a prefix-mode keybinding#2322
fraidev wants to merge 2 commits into
herdrdev:masterfrom
fraidev:fix/prefix-escape-keybind

Conversation

@fraidev

@fraidev fraidev commented Aug 4, 2026

Copy link
Copy Markdown

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.

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.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 751498e6-96e8-48e1-8fd3-dda00116c8ec

📥 Commits

Reviewing files that changed from the base of the PR and between 2b1f50d and 2c7990b.

📒 Files selected for processing (1)
  • src/app/input/navigate.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/input/navigate.rs

📝 Walkthrough

Walkthrough

Escape now supports configured prefix-mode bindings through esc or escape. Unbound Escape still exits prefix mode. Tests cover parsing, dispatch, fallback behavior, and copy-mode entry. Documentation describes the updated behavior in English, Japanese, and Chinese.

Changes

Escape prefix bindings

Layer / File(s) Summary
Escape key alias parsing
src/config/keybinds.rs
Tests verify case-insensitive esc and escape aliases for prefix bindings.
Prefix dispatch and fallback
src/app/input/navigate.rs
Prefix handling dispatches configured Escape bindings before using unbound Escape to exit prefix mode. Tests cover copy-mode entry and cancellation.
Documented Escape behavior
docs/next/CHANGELOG.md, docs/next/website/src/content/docs/*/configuration.mdx
The changelog and configuration guides document Escape aliases, prefix bindings, and fallback behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes allowing Escape as a prefix-mode keybinding.
Description check ✅ Passed The description accurately explains the previous behavior and the new bound and unbound Escape behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 4, 2026
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown

Greptile Summary

This PR allows Escape to act as a configured prefix-mode RHS while preserving cancellation for unbound Escape.

  • Removes unconditional early cancellation so existing prefix-action dispatch can match Escape.
  • Adds runtime and configuration tests for esc and escape aliases.
  • Documents the behavior in the changelog and translated configuration guides.

Confidence Score: 5/5

The 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.

Important Files Changed

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]
Loading

Reviews (1): Last reviewed commit: "style: rustfmt prefix-escape copy mode t..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants