Skip to content

fix windows escaping (and broken tests) - #19011

Merged
scidomino merged 1 commit into
mainfrom
tomm_win_fix
Feb 13, 2026
Merged

fix windows escaping (and broken tests)#19011
scidomino merged 1 commit into
mainfrom
tomm_win_fix

Conversation

@scidomino

@scidomino scidomino commented Feb 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix window escaping. Also fixes some broken tests

Related Issues

Fixes test failures introduced in #18965

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @scidomino, 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 refines the path escaping logic specifically for Windows environments by adjusting which characters are considered 'special' and therefore require quoting. This change ensures that paths containing tildes are handled correctly without unnecessary escaping, and a corresponding test has been updated to reflect and validate this improved behavior.

Highlights

  • Windows Path Escaping: The escapePath utility function has been updated to no longer treat the tilde (~) character as a special character requiring escaping on Windows platforms. This aligns the function's behavior with Windows' native path handling.
  • Test Fix: A related test in text-buffer.test.ts was fixed to correctly apply path escaping to all file paths within the test case, ensuring accurate validation of the useTextBuffer hook's behavior.
Changelog
  • packages/cli/src/ui/components/shared/text-buffer.test.ts
    • Updated a test case to ensure all file paths are correctly escaped when pasted, aligning with the expected behavior of escapePath.
  • packages/core/src/utils/paths.ts
    • Modified the escapePath function to exclude the tilde (~) character from the list of special characters that trigger double-quoting on Windows.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@github-actions

github-actions Bot commented Feb 13, 2026

Copy link
Copy Markdown

Size Change: +1 B (0%)

Total Size: 24.4 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 24.4 MB +1 B (0%)
./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

compressed-size-action

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

Copy link
Copy Markdown
Contributor

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 fixes an issue with path escaping on Windows by no longer treating the tilde (~) as a special character, and also corrects a related test. The changes are valid. I've identified an opportunity to make the Windows path escaping more robust, aligning with best practices for sanitizing file paths in utility functions. The regular expression for detecting special characters is missing < and >, which are redirection operators in the Windows command shell. I've added a suggestion to include them to prevent potential misinterpretation by the shell and mitigate potential path traversal or command injection vulnerabilities.

Comment thread packages/core/src/utils/paths.ts Outdated
@scidomino
scidomino force-pushed the tomm_win_fix branch 2 times, most recently from e7ba69c to 9785cd3 Compare February 13, 2026 20:11
@scidomino scidomino changed the title fix windows escaping (and broken test) fix windows escaping (and broken tests) Feb 13, 2026
@scidomino
scidomino marked this pull request as ready for review February 13, 2026 20:11
@scidomino
scidomino requested a review from a team as a code owner February 13, 2026 20:11
@scidomino
scidomino enabled auto-merge February 13, 2026 20:12
@scidomino
scidomino added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit e7e4c68 Feb 13, 2026
28 checks passed
@scidomino
scidomino deleted the tomm_win_fix branch February 13, 2026 22:31
kuishou68 pushed a commit to iOfficeAI/gemini-cli-pro that referenced this pull request Feb 27, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
@sripasg sripasg added the size/s A small PR label Jun 2, 2026
software-0ficial pushed a commit to software-0ficial/gemini-cli that referenced this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s A small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants