mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-27 11:47:46 -07:00
2fdd259666
This PR implements a workaround for issue #26902 where terminal link handlers on Windows (specifically in the Antigravity editor and standard VS Code) fail to correctly parse and open absolute file paths that include `:line:column` suffixes. On Windows, colons are invalid characters in file paths (except for the drive letter), causing `FileSystemError` when these links are clicked. ### Changes: - Added `stripLineColumnSuffixes` utility in `packages/core/src/utils/textUtils.ts`. - Applied this utility across various output formatting paths to ensure safe link generation on Windows: - `packages/cli/src/ui/utils/textOutput.ts` (Non-interactive mode) - `packages/cli/src/ui/utils/markdownParsingUtils.ts` (Agent output in interactive mode) - `packages/core/src/utils/debugLogger.ts` (Core debug logging) - `packages/cli/src/ui/utils/ConsolePatcher.ts` (Interactive mode console redirection) - Added comprehensive unit tests in `packages/core/src/utils/textUtils.test.ts`. These changes are only active when running on Windows (`process.platform === 'win32'`). Fixes #26902 cc @google-gemini/gemini-cli-maintainers