Skip to content

fix(cli-ui): revert backspace handling to fix Windows regression#25941

Merged
scidomino merged 1 commit intomainfrom
tomm_win_revert
Apr 24, 2026
Merged

fix(cli-ui): revert backspace handling to fix Windows regression#25941
scidomino merged 1 commit intomainfrom
tomm_win_revert

Conversation

@scidomino
Copy link
Copy Markdown
Collaborator

@scidomino scidomino commented Apr 24, 2026

Summary

This reverts commit 80764c8.

Details

The original PR (#21447) assumed that a plain backspace on Windows always sends \x7f and that \b is only sent for Ctrl+Backspace. This does not seem to be true for some windows users using node 22.

Related Issues

Fixes #25856

This reverts commit 80764c8.

The original PR (#21447) assumed that a plain backspace on Windows always sends \x7f and that \b is only sent for Ctrl+Backspace. This assumption breaks terminals like VS Code and Git Bash which often send \b for a plain backspace, resulting in the whole word being deleted instead of a single character.

Fixes #25856
@scidomino scidomino requested a review from a team as a code owner April 24, 2026 20:17
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 backspace handling within the CLI UI. The previous implementation incorrectly assumed that '\b' was exclusively used for Ctrl+Backspace on Windows, which caused issues in common terminal emulators that use '\b' for standard backspace. By reverting this logic and treating both '\b' and '\x7f' as standard backspace inputs, the fix restores expected behavior across various platforms and terminal environments.

Highlights

  • Reversion of Backspace Handling: Reverted the logic that treated '\b' as a Ctrl+Backspace signal on Windows, as it caused regressions in terminals like VS Code and Git Bash.
  • Unified Key Handling: Updated the keypress handler to treat both '\b' and '\x7f' as standard backspace events, ensuring consistent behavior across different terminal environments.
  • Test Cleanup: Removed obsolete test cases that were specifically validating the now-reverted Windows-specific backspace logic.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@scidomino scidomino enabled auto-merge April 24, 2026 20:20
@github-actions
Copy link
Copy Markdown

Size Change: -214 B (0%)

Total Size: 33.7 MB

Filename Size Change
./bundle/chunk-5KKZE4NG.js 0 B -3.8 kB (removed) 🏆
./bundle/chunk-CCSBTLO5.js 0 B -3.43 kB (removed) 🏆
./bundle/chunk-EKACZSMX.js 0 B -669 kB (removed) 🏆
./bundle/chunk-KSHEKKW7.js 0 B -14.6 MB (removed) 🏆
./bundle/chunk-RUMNK5DB.js 0 B -2.73 MB (removed) 🏆
./bundle/chunk-ZT7HP3LQ.js 0 B -49.2 kB (removed) 🏆
./bundle/core-TD3ZAZZY.js 0 B -47.7 kB (removed) 🏆
./bundle/devtoolsService-WLVIGRDN.js 0 B -27.8 kB (removed) 🏆
./bundle/gemini-PNCVIZ5S.js 0 B -578 kB (removed) 🏆
./bundle/interactiveCli-Y57RG4Y4.js 0 B -1.29 MB (removed) 🏆
./bundle/liteRtServerManager-XXPPDGSO.js 0 B -2.08 kB (removed) 🏆
./bundle/oauth2-provider-XPBKWHDF.js 0 B -9.16 kB (removed) 🏆
./bundle/chunk-2PWB6IDC.js 3.8 kB +3.8 kB (new file) 🆕
./bundle/chunk-3RVAWGVE.js 2.73 MB +2.73 MB (new file) 🆕
./bundle/chunk-53YJNGG7.js 3.43 kB +3.43 kB (new file) 🆕
./bundle/chunk-C6UY6WDG.js 49.2 kB +49.2 kB (new file) 🆕
./bundle/chunk-MQD667BY.js 14.6 MB +14.6 MB (new file) 🆕
./bundle/chunk-XXYVEUAG.js 669 kB +669 kB (new file) 🆕
./bundle/core-LSJPMZVE.js 47.7 kB +47.7 kB (new file) 🆕
./bundle/devtoolsService-7CTVGYIP.js 27.8 kB +27.8 kB (new file) 🆕
./bundle/gemini-WTPDAU3K.js 578 kB +578 kB (new file) 🆕
./bundle/interactiveCli-JFCUVBPF.js 1.29 MB +1.29 MB (new file) 🆕
./bundle/liteRtServerManager-FRE7ESLW.js 2.08 kB +2.08 kB (new file) 🆕
./bundle/oauth2-provider-6ESFQSCI.js 9.16 kB +9.16 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/chunk-MTD736U4.js 1.97 MB 0 B
./bundle/chunk-RJTRUG2J.js 39.8 kB 0 B
./bundle/cleanup-WJO4E4E3.js 0 B -932 B (removed) 🏆
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-T73EYRDX.js 356 B 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/examples/hooks/scripts/on-start.js 188 B 0 B
./bundle/examples/mcp-server/example.js 1.43 kB 0 B
./bundle/gemini.js 4.97 kB 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/memoryDiscovery-NSOLCG4U.js 980 B 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/start-6NCMHHVA.js 0 B -622 B (removed) 🏆
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/cleanup-H2RJC6QD.js 932 B +932 B (new file) 🆕
./bundle/start-QWII7P6B.js 622 B +622 B (new file) 🆕

compressed-size-action

@gemini-cli gemini-cli Bot added the priority/p1 Important and should be addressed in the near term. label Apr 24, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies backspace handling in the CLI by treating both \b and \x7f as standard backspace characters, eliminating environment-specific logic for Windows and Windows Terminal. Related test files were updated to reflect these changes, including the removal of now-obsolete test cases and the adjustment of backspace character constants. I have no feedback to provide.

@scidomino scidomino added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit 048bf6e Apr 24, 2026
32 checks passed
@scidomino scidomino deleted the tomm_win_revert branch April 24, 2026 20:46
@scidomino
Copy link
Copy Markdown
Collaborator Author

/patch preview

@github-actions
Copy link
Copy Markdown

🚀 [Step 1/4] Patch workflow(s) waiting for approval!

📋 Details:

  • Channels: preview
  • Commit: 048bf6e51459f629d9e242e670a2e6d3abdd992b
  • Workflows Created: 1

⏳ Status: The patch creation workflow has been triggered and is waiting for deployment approval. Please visit the specific workflow links below and approve the runs.

🔗 Track Progress:

@github-actions
Copy link
Copy Markdown

🚀 [Step 2/4] Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. Review and approve the hotfix PR: #25942
  2. Once merged, the patch release will automatically trigger
  3. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions
Copy link
Copy Markdown

🚀 [Step 3/4] Patch Release Waiting for Approval!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.40.0-preview.3
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.40.0-preview.3-pr-25941

⏳ Status: The patch release has been triggered and is waiting for deployment approval. Please visit the specific workflow run link below and approve the deployment. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions
Copy link
Copy Markdown

[Step 4/4] Patch Release Complete!

📦 Release Details:

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

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

Labels

priority/p1 Important and should be addressed in the near term.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect backspace behaviour

2 participants