Files
gemini-cli/packages/cli
gemini-cli[bot] 2fdd259666 fix: strip line/column suffixes from Windows path links
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
2026-05-14 15:57:19 +00:00
..