You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(terminal): link bare file:line locations followed by a colon - #52634
When a compiler or test runner reports a failure, it prints the file and line with a colon after it, like main_test.go:15: expected 1, got 2. You should be able to click that to jump to the line. Orca's terminal did not link these, because it treated the last colon as part of the file name, so the name never matched a file. Now Orca drops that trailing colon, the same way it already drops a trailing period or comma, and the link works.
What Changed
Before: a bare location followed by a colon (main_test.go:15:, test_x.py:6:, foo.c:10:5:, Makefile:12:) stayed plain text. Locations with a path separator (./foo.c:10:5:) already linked. After: these locations link to the file and line, and to the column when there is one.
Mechanism: the bare-filename token regex keeps : on purpose so the suffix parser can read :line:col. The colon that ends the location stayed in the token because TRAILING_TRIM_CHARS in src/shared/terminal/links/terminal-file-link-detection-ranges.ts did not include :. parseExplicitFileLinkTarget needs the token to end in :\d+, so it failed, and looksLikeFilename then rejected the whole token. The fix adds : to TRAILING_TRIM_CHARS, so trimTerminalPathBoundaryPunctuation strips it together with ,, ; and ..
A related improvement: spaced-path segments like name.ts:12: now link at line 12. Before, they produced a path ending in : that could never resolve.
Why
These are the most common failure lines people see in a terminal. The fix is at the source: the trailing-punctuation trim already handles the same boundary for ,;.. Adding one character there is simpler than writing a separate pattern for each tool's output.
No screenshots: Electron was not launched for this change. The links are the text ranges below, which the terminal link provider underlines on hover. Output of extractTerminalFileLinks on main and on this branch (text | path | line | col | range):
Input
Before
After
main_test.go:15: expected 1, got 2
no link
main_test.go:15 → main_test.go, line 15
test_x.py:6: AssertionError
no link
test_x.py:6 → line 6
foo.c:10:5: error: expected ;
no link
foo.c:10:5 → line 10, col 5
Makefile:12: *** missing separator. Stop.
no link
Makefile:12 → line 12
note: in file included from bar.h:5:
no link
bar.h:5 → line 5
(foo.ts:10:)
no link
foo.ts:10 → line 10
These inputs give the same result on both: foo:, C:, C:\, C:\x.ts:10: err, http:, https://host:, mailto:, ::1, fe80::1:, [::1]:8080, 12:30:, ./foo.c:10:5: err, file:///, Error: something.
Testing
New case in src/shared/terminal/links/terminal-links.test.ts that covers go test, gcc and make lines. It fails on main (expected [] to deeply equal [{ pathText: 'main_test.go', ... }]) and passes with the fix.
vitest run --config config/vitest.config.ts on src/shared/terminal/links, src/shared/native-chat, src/shared/file-links and src/renderer/src/components/terminal-pane/links: 23 files, 145 tests passed.
A 42-input probe compared main with this branch. Every change is listed above or is a word ending in : (for example package.json:), which is now a candidate just like the same word without the colon already was.
Static gates on the touched files are clean: oxlint, oxfmt, anti-slop, code-quality native plugins, ast-grep, and the changed-code quality gate.
Tested on macOS at unit level. The change is string handling with no platform-specific branches.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
None, because this adds one entry to a Set that the trim loop already checks. Detection runs on hover (xterm provideLinks) and during native-chat linkify, not on the terminal output stream. Measured mean per call for extractTerminalFileLinkReadings, main → branch:
plain 93-char line: 4.72 µs → 4.35 µs
go/gcc/make line: 3.18 µs → 3.34 µs (it now returns the links)
2000 fN.c:N: tokens: 494 µs → 571 µs
adversarial input, 200 KB of colons: 242 µs → 1.03 ms
All cases are linear and far below 16 ms. The change adds no I/O, polling or caches, and its cost does not grow with the number of tabs or panes.
Risk
Level: Low
A bare word that ends in :, like README: or config.yaml:, now becomes a link candidate. It is only underlined when the file exists, because terminal file links are confirmed with an existence check first. Filenames that really end in : lose the colon. Windows does not allow such names, and they are very rare elsewhere. No settings, saved data or IPC change, and local, SSH and WSL terminals behave the same. A plain revert backs this out.
Review
Native chat calls the same extractTerminalFileLinkReadings. Prose links there still need a path separator, and the native-chat suites pass. No new input reaches the file opener: the target is the same path and line the detector already produced for file:line without the colon.
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Terminal file-link parsing now trims a trailing colon from location text. Tests cover Go-style file and line locations, C-style file, line, and column locations, and a Makefile diagnostic.
Severity of issue fixed: Low
Merge Risk: Low · up to ffdff
Terminal output such as main_test.go:15: will now link to the file and line. A file whose real name ends in a colon is very rare, but it would no longer resolve literally. The risk is small and mergeable with awareness.
Pre-merge checks: 4
Check name
Status
Explanation
Linked Issues check
[#52622] requires bare file locations followed by a colon (for example main_test.go:15: expected 1, got 2, foo.c:10:5: error, Makefile:12: ***) to produce links. The whole-PR diff adds : to `T…
Out of Scope Changes check
The whole-PR diff changes one line in terminal-file-link-detection-ranges.ts, adding : to the trailing trim set. The test file adds coverage for the same objective. The change does not add unrelat…
Title check
The title names the main change: bare file:line locations followed by a colon (for example main_test.go:15:) now become terminal file links. The changeset adds ':' to TRAILING_TRIM_CHARS and adds test…
Description check
The description follows the repository template closely. It has ELI5, What Changed (before/after and mechanism), Why, a linked issue (Fixes #52622), Visual Proof (a substitute table of extractor outpu…
Full details: Linked Issues check
Explanation
[#52622] requires bare file locations followed by a colon (for example main_test.go:15: expected 1, got 2, foo.c:10:5: error, Makefile:12: ***) to produce links. The whole-PR diff adds : to TRAILING_TRIM_CHARS in src/shared/terminal/links/terminal-file-link-detection-ranges.ts. The trim step runs on bare-filename tokens before parseExplicitFileLinkTarget, so the trailing colon no longer blocks parsing. The PR summary reports a new test in src/shared/terminal/links/terminal-links.test.ts covering go test, gcc and make lines. That test fails on main and passes with the change. I did not run the test suite. The code path is consistent with the reported behavior.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff changes one line in terminal-file-link-detection-ranges.ts, adding : to the trailing trim set. The test file adds coverage for the same objective. The change does not add unrelated behavior. A side effect is that tokens such as foo.c: with no line number now trim to foo.c and may link. This follows directly from the same trim rule and is not a separate unrelated change. The PR description also names the risk for filenames that end in :. The description and the linked issue cover this behavior.
Full details: Title check
Explanation
The title names the main change: bare file:line locations followed by a colon (for example main_test.go:15:) now become terminal file links. The changeset adds ':' to TRAILING_TRIM_CHARS and adds tests for those locations, so the title matches the change. The 'fix(terminal)' prefix follows a conventional-commit style and is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description follows the repository template closely. It has ELI5, What Changed (before/after and mechanism), Why, a linked issue (Fixes #52622), Visual Proof (a substitute table of extractor output, with no screenshots and a reason given), Testing with specific test and gate results, a Performance line with measurements, a Risk section with level and revert plan, Review, the skill-boundary checkbox, and the checklist. The AI Disclosure section is left as the template comment, which is acceptable for an internal contributor. The Performance section starts with 'None, because' and gives a reason, as the template asks.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Preserve literal paths that end in a colon.
On a POSIX host, src/a: can be a valid filename. The local-path branch now passes src/a to the location parser instead, so the link cannot open src/a: and can open a different file if src/a exists. Preserve a literal candidate for host resolution alongside the trimmed diagnostic candidate.
Bare locations such as `main_test.go:15:`, `foo.c:10:5:` and
`Makefile:12:` kept the trailing colon in the token, so the explicit
location parser failed and the filename check rejected the token.
Trim a trailing `:` with the other trailing punctuation.
Fixesstablyai#52622
nwparker
changed the title
fix(terminal): link bare file locations followed by a colon
fix(terminal): link bare file:line locations followed by a colon
Nov 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When a compiler or test runner reports a failure, it prints the file and line with a colon after it, like
main_test.go:15: expected 1, got 2. You should be able to click that to jump to the line. Orca's terminal did not link these, because it treated the last colon as part of the file name, so the name never matched a file. Now Orca drops that trailing colon, the same way it already drops a trailing period or comma, and the link works.What Changed
Before: a bare location followed by a colon (
main_test.go:15:,test_x.py:6:,foo.c:10:5:,Makefile:12:) stayed plain text. Locations with a path separator (./foo.c:10:5:) already linked.After: these locations link to the file and line, and to the column when there is one.
Mechanism: the bare-filename token regex keeps
:on purpose so the suffix parser can read:line:col. The colon that ends the location stayed in the token becauseTRAILING_TRIM_CHARSinsrc/shared/terminal/links/terminal-file-link-detection-ranges.tsdid not include:.parseExplicitFileLinkTargetneeds the token to end in:\d+, so it failed, andlooksLikeFilenamethen rejected the whole token. The fix adds:toTRAILING_TRIM_CHARS, sotrimTerminalPathBoundaryPunctuationstrips it together with,,;and..A related improvement: spaced-path segments like
name.ts:12:now link at line 12. Before, they produced a path ending in:that could never resolve.Why
These are the most common failure lines people see in a terminal. The fix is at the source: the trailing-punctuation trim already handles the same boundary for
,;.. Adding one character there is simpler than writing a separate pattern for each tool's output.Linked Issue
Fixes #52622
Visual Proof
No screenshots: Electron was not launched for this change. The links are the text ranges below, which the terminal link provider underlines on hover. Output of
extractTerminalFileLinksonmainand on this branch (text | path | line | col | range):main_test.go:15: expected 1, got 2main_test.go:15→main_test.go, line 15test_x.py:6: AssertionErrortest_x.py:6→ line 6foo.c:10:5: error: expected ;foo.c:10:5→ line 10, col 5Makefile:12: *** missing separator. Stop.Makefile:12→ line 12note: in file included from bar.h:5:bar.h:5→ line 5(foo.ts:10:)foo.ts:10→ line 10These inputs give the same result on both:
foo:,C:,C:\,C:\x.ts:10: err,http:,https://host:,mailto:,::1,fe80::1:,[::1]:8080,12:30:,./foo.c:10:5: err,file:///,Error: something.Testing
New case in
src/shared/terminal/links/terminal-links.test.tsthat covers go test, gcc and make lines. It fails onmain(expected [] to deeply equal [{ pathText: 'main_test.go', ... }]) and passes with the fix.vitest run --config config/vitest.config.tsonsrc/shared/terminal/links,src/shared/native-chat,src/shared/file-linksandsrc/renderer/src/components/terminal-pane/links: 23 files, 145 tests passed.A 42-input probe compared
mainwith this branch. Every change is listed above or is a word ending in:(for examplepackage.json:), which is now a candidate just like the same word without the colon already was.Static gates on the touched files are clean: oxlint, oxfmt, anti-slop, code-quality native plugins, ast-grep, and the changed-code quality gate.
Tested on macOS at unit level. The change is string handling with no platform-specific branches.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
None, because this adds one entry to a Set that the trim loop already checks. Detection runs on hover (xterm
provideLinks) and during native-chat linkify, not on the terminal output stream. Measured mean per call forextractTerminalFileLinkReadings,main→ branch:fN.c:N:tokens: 494 µs → 571 µsAll cases are linear and far below 16 ms. The change adds no I/O, polling or caches, and its cost does not grow with the number of tabs or panes.
Risk
Level: Low
A bare word that ends in
:, likeREADME:orconfig.yaml:, now becomes a link candidate. It is only underlined when the file exists, because terminal file links are confirmed with an existence check first. Filenames that really end in:lose the colon. Windows does not allow such names, and they are very rare elsewhere. No settings, saved data or IPC change, and local, SSH and WSL terminals behave the same. A plain revert backs this out.Review
Native chat calls the same
extractTerminalFileLinkReadings. Prose links there still need a path separator, and the native-chat suites pass. No new input reaches the file opener: the target is the same path and line the detector already produced forfile:linewithout the colon.Original fix by @hsusul in #52634.
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)