fix(cli): restrict ctrl+backspace detection to Windows Terminal only#25882
fix(cli): restrict ctrl+backspace detection to Windows Terminal only#25882dogukanozen wants to merge 4 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a regression in keypress handling on Windows environments. Previously, the logic for detecting Ctrl+Backspace was too broad, causing standard backspace inputs in legacy Windows terminals like cmd.exe and PowerShell to be incorrectly interpreted as word-deletion commands. The changes refine this detection to target only Windows Terminal sessions, restoring expected behavior for other terminal emulators. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refines the handling of the backspace character (\b) in Windows environments within the KeypressContext. It restricts the automatic assignment of the ctrl modifier to cases where the WT_SESSION environment variable is present, ensuring that plain backspace inputs in cmd.exe and PowerShell are not incorrectly interpreted as Ctrl+Backspace. Corresponding unit tests have been updated to verify this new behavior. I have no feedback to provide.
The previous fix (google-gemini#21447) treated OS=Windows_NT as sufficient to mark \b as Ctrl+Backspace, but cmd.exe and PowerShell also send \b for plain backspace, causing every backspace to delete a whole word on those terminals. Scope the ctrl=true path to WT_SESSION only (Windows Terminal), which is the terminal that actually sends \b for Ctrl+Backspace and \x7f for plain backspace. Update the corresponding test expectation. Fixes google-gemini#25867
2ac920b to
49eb0fd
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the KeypressContext to change how the backspace character (\b) is handled. Specifically, it removes the logic that previously marked \b as a control key on Windows systems or within Windows Terminal sessions. The unit tests in KeypressContext.test.tsx have been updated to verify that \b is no longer treated as a control character in these environments. I have no feedback to provide.
|
closing this as it’s resolved by #25941 |
Summary
ctrl+backspaceword deletion for Windows, but the conditionOS === 'Windows_NT'was too broadDetails
Related Issues
Fixes #25867 #25856 #25907 #25926 #25934
How to Validate
Pre-Merge Checklist