fix(windows): keep Ctrl-W in Git Bash terminals - #13232
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository 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)
📝 WalkthroughWalkthroughThe terminal shortcut policy identifies unmodified Ctrl+W events. On Windows Git Bash panes, terminal-first mode sends plain Ctrl+W to Git Bash instead of closing the pane. The keyboard handler detects Git Bash from session metadata and Windows terminal-host state. Unit and Windows end-to-end tests cover shortcut routing, pane closure, PTY input, shell overrides, and focus outside terminal surfaces. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/keyboard-handlers.ts (1)
328-350: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd direct coverage for active-pane Git Bash detection.
The new policy test receives an already-resolved
gitBashboolean. It does not test session metadata, tab override, or global Windows shell fallback. Add cases for Git Bash session metadata and non-Git-Bash Windows shells.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1ff8a785-bcaf-40c6-a372-4eee59431c1f
📒 Files selected for processing (3)
src/renderer/src/components/terminal-pane/keyboard-handlers.tssrc/renderer/src/components/terminal-pane/terminal-shortcut-policy-windows-git-bash.test.tssrc/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts
706d01a to
37e585a
Compare
Sync update (
|
37e585a to
7a50a60
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b59f6b2e-532a-45a0-bee0-ca5556950eec
📒 Files selected for processing (5)
src/renderer/src/components/terminal-pane/keyboard-handlers.tssrc/renderer/src/components/terminal-pane/terminal-shortcut-policy-windows-git-bash.test.tssrc/renderer/src/components/terminal-pane/terminal-shortcut-policy.tssrc/renderer/src/components/terminal-pane/windows-git-bash-shortcut.tstests/e2e/terminal-windows-git-bash-ctrl-w.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/renderer/src/components/terminal-pane/keyboard-handlers.ts
- src/renderer/src/components/terminal-pane/terminal-shortcut-policy.ts
7a50a60 to
bbcce40
Compare
Sync update (
|
Description
On native Windows, Git Bash now receives physical Ctrl+W when the terminal-first shortcut policy is enabled instead of Orca closing the active tab. The exception is fail-closed: it requires an active terminal pane,
KeyW, Ctrl with no other modifiers, an authoritative active local-session shell override identifying Git Bash, and a native Windows terminal host.Focused fix
Compatibility and gaps
Evidence
User-regression tradeoffs
Ctrl+W is intentionally consumed by Git Bash only for an authoritative active native Windows Git Bash pane under Terminal first, matching Bash previous-word deletion instead of tab closure.
Fixes #13015