Repository navigation
Conversation
stablyai#13399 widened the local-path trailing class to \p{L}\p{M}\p{N} plus a few ASCII path characters, which fixed letters but left category Po out. Japanese folder names routinely contain the katakana middle dot, so the match stopped in front of it and the rest of the path was never clickable: //nas/base/会社・事業/個人事業主/確定申告/R7確定申告送信票.pdf -> link ended at 会社, the file part was not a link Take the four name characters that show up in real CJK paths -- U+30FB/U+FF65 middle dots and U+301C/U+FF5E tildes -- in the class. \p{Po} as a whole is not safe here: it reintroduces the ASCII delimiters the spaced detectors trim on, and the fullwidth forms of comma/period are sentence punctuation that would swallow the prose printed after a path. Refs stablyai#23019
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe terminal path regex now permits kana middle dots within paths and requires a valid character at the start of a relative path. The matcher trims Japanese wave dashes and following text from the final path segment. Tests cover punctuation retention, delimiters, and bullet-prefixed absolute paths. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to This change retains CJK punctuation in paths while trimming range-style wave-dash suffixes from final segments. The committed test expectations match that behavior, and no concrete merge-blocking risk remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to More CJK paths can be opened from terminal output after a user activates a link. The change does not appear to bypass the existing file-opening checks, but the full authorization behavior was not verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 532b638a-b7f4-4fce-80b9-3303c92fbbbd
📒 Files selected for processing (2)
src/renderer/src/lib/terminal-links.test.tssrc/renderer/src/lib/terminal-links.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — one behavioral regression worth a look.
Reviewed changes
- Widened
LOCAL_PATH_REGEX's trailing class insrc/renderer/src/lib/terminal-links.tsto accept\u30FB/\uFF65(kana middle dots) and\u301C/\uFF5E(wave dash / fullwidth tilde), so CJK folder names stay inside a detected path. - Added two regression tests covering the reported UNC and drive-letter paths, plus the existing ASCII-delimiter stop behavior.
ℹ️ Nitpicks
- Only
\u30FBis exercised by the new tests;\uFF65,\u301C, and\uFF5Ehave no regression guard, so a typo in any of the three would pass CI. Worth a case per added code point if the tildes stay.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ots in relative prefix - 〜/~ are Japanese range punctuation, so a path followed by a range expression (`/var/log/app.log〜古いものは削除`) absorbed the prose and the link stopped resolving. Keep only the kana middle dots. - Accept the middle dots in the relative first-directory prefix too, so `会社・事業/file.txt` is linked whole instead of from `事業/`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @pullfrog and CodeRabbit. You're right, the wave dash and fullwidth tilde are range punctuation, not name punctuation. Fixed in c07aa5b:
|
There was a problem hiding this comment.
ℹ️ No critical issues — the round-two commit resolves the earlier regression cleanly; one leading-class edge is worth a look inline.
Reviewed changes
- Dropped
\u301C/\uFF5E(wave dash / fullwidth tilde) fromLOCAL_PATH_REGEX's trailing class — they are Japanese range punctuation, so a path followed by a range now stops at the path instead of absorbing the prose, and a test pins that. - Widened the leading alternation with
\u30FB/\uFF65(kana middle dots) so a relative path whose first directory contains a middle dot (会社・事業/file.txt) is claimed whole rather than starting at事業/, with a regression test. - Kept the ASCII delimiter behavior covered by the existing stop-at-
,/;test.
ℹ️ Nitpicks
\uFF65(halfwidth kana middle dot) still has no dedicated test in the leading or trailing class.- The PR description says the leading alternation is untouched and only four trailing-class code points were added; commit c07aa5b changed both. Worth updating so reviewers see the current trade-off.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ The delta resolves the earlier wave-dash regression cleanly; one leading-class edge remains open, so this review does not approve.
Reviewed changes
This run re-reviewed only the delta since the prior pullfrog review (88c847a5 → c07aa5b4), on top of the original widening.
- Dropped the wave dashes from the path class.
\u301C/\uFF5Eare range punctuation in Japanese, so a path followed by a range expression (/var/log/app.log〜古いものは削除) no longer absorbs the following prose. Both forms now stop at the path, pinned by a new test that fails on the previous class. - Added the kana middle dots to the relative first-directory class.
会社・事業/file.txtnow links whole instead of starting at事業/; the new test fails on the prior class. - Updated the class comment to record why
\p{Po}and the wave dashes stay out.
ℹ️ Leading middle dot is claimed as a path prefix
The leading-class widening also lets a bare ・/・ start a relative segment: ・/tmp/foo.txt now matches as ・/tmp/foo.txt instead of the absolute /tmp/foo.txt, so it resolves against the cwd and fails where it previously opened. The open inline thread at src/renderer/src/lib/terminal-links.ts:44 carries the repro and a suggested fix; I reproduced both sides independently and confirmed the proposed [\p{L}\p{N}\p{M}._-][\p{L}\p{N}\p{M}._\-\u30FB\uFF65]*[\\/] keeps 会社・事業/file.txt whole while restoring /tmp/foo.txt.
Technical details
# Leading middle dot absorbed as a relative-path prefix
## Affected sites
- `src/renderer/src/lib/terminal-links.ts:44` — `[\p{L}\p{N}\p{M}._\-\u30FB\uFF65]+[\\/]` added to the leading alternation.
## Evidence
- On `・/tmp/foo.txt`: old class matches `/tmp/foo.txt`; new class matches `・/tmp/foo.txt`.
- On `・/tmp/foo.txt ・/tmp/bar.txt`: new class matches both bullet-prefixed spans as relative paths.
- The proposed first-char guard matches `/tmp/foo.txt` and `/tmp/bar.txt` and still matches `会社・事業/file.txt` whole.
## Required outcome
- A path preceded by a bare `・`/`・` links the absolute path, while `会社・事業/file.txt` stays whole.
## Suggested approach
- Require a non-middle-dot first segment character: `[\p{L}\p{N}\p{M}._-][\p{L}\p{N}\p{M}._\-\u30FB\uFF65]*[\\/]`, plus a bullet-prefixed case in the regression tests.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
A bare bullet such as `・/tmp/foo.txt` began a relative segment and was linked as one path. Require one letter/number/mark/._- before the middle-dot run in the relative prefix, and pin the bullet case. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Good catch, @pullfrog. Fixed in the latest commit. The relative prefix now needs a name character before the middle-dot run ( |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the delta since the prior Pullfrog review (c07aa5b4 → 60be095), on top of the kana middle-dot widening.
- Require a name character before a leading middle dot. The relative prefix now starts with one
\p{L}\p{N}\p{M}._-before the middle-dot run, so a bare bullet・/tmp/foo.txtlinks the absolute/tmp/foo.txtinstead of absorbing the dot and resolving against the cwd, while会社・事業/file.txtstill links whole. Independently reproduced both forms against the old and new classes. - Pinned the bullet case. A new test asserts
・/tmp/foo.txtand・/tmp/foo.txtlink/tmp/foo.txt; it matches the old class as one link, so it would fail on the prior regex. - The earlier wave-dash regression stays fixed and covered — the tildes remain outside the class.
The one collateral change is ・会社/file.txt (a bullet as the first character of the first segment) now linking 会社/file.txt rather than the bullet-prefixed span. That is the documented trade-off the leading class comment records, and a bullet-first directory is far rarer than a bullet-prefixed list item, so I consider it the right call.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed only the delta since the prior pullfrog review (c07aa5b4 → 60be095), on top of the earlier widening.
- Required a name character before a leading middle dot. The leading alternation changed from
[\p{L}\p{N}\p{M}._\-\u30FB\uFF65]+[\\/]to[\p{L}\p{N}\p{M}._-][\p{L}\p{N}\p{M}._\-\u30FB\uFF65]*[\\/], so・/tmp/foo.txtlinks the absolute/tmp/foo.txtinstead of absorbing the bullet as a relative prefix. - Added the regression test for it. A new case covers both
・and・(the latter finally exercises\uFF65), and会社・事業/file.txtstill matches whole. - Extended the class comment to record the first-character rule.
Verified independently: the head regex returns /tmp/foo.txt for ・/tmp/foo.txt and ・/tmp/foo.txt, keeps 会社・事業/file.txt, C:/tmp/中黒・テスト/a.txt and the UNC path whole, and still stops /var/log/app.log〜古いものは削除 at the path. terminal-links.test.ts passes 57/57 at head; the new bullet assertion fails against the c07aa5b4 class, so it is a real guard.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Keep kana middle dots in CJK path names, including the first relative segment, and keep wave dashes out so a range marker after a path is not part of the link. stablyai#23322 added the dashes to the continuation class; the tests on this branch still stop at them.
|
Merged current main. The only overlap was |
|
| // as `・/tmp/foo.txt` links the absolute path rather than absorbing the dot. | ||
| const LOCAL_PATH_REGEX = | ||
| /(?:~[\\/]|[\\/]|\.{1,2}[\\/]|[A-Za-z]:[\\/]|[\p{L}\p{N}\p{M}._-]+[\\/])[\p{L}\p{N}\p{M}._~\-/%+@\\()[\]\u30FB\uFF65\u301C\uFF5E]*(?::\d+)?(?::\d+)?/gu | ||
| /(?:~[\\/]|[\\/]|\.{1,2}[\\/]|[A-Za-z]:[\\/]|[\p{L}\p{N}\p{M}._-][\p{L}\p{N}\p{M}._\-\u30FB\uFF65]*[\\/])[\p{L}\p{N}\p{M}._~\-/%+@\\()[\]\u30FB\uFF65]*(?::\d+)?(?::\d+)?/gu |
There was a problem hiding this comment.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 645d2ba5-8915-44df-9756-455e1467c7e9
📒 Files selected for processing (1)
src/renderer/src/lib/terminal-links.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| // as `・/tmp/foo.txt` links the absolute path rather than absorbing the dot. | ||
| const LOCAL_PATH_REGEX = | ||
| /(?:~[\\/]|[\\/]|\.{1,2}[\\/]|[A-Za-z]:[\\/]|[\p{L}\p{N}\p{M}._-]+[\\/])[\p{L}\p{N}\p{M}._~\-/%+@\\()[\]\u30FB\uFF65\u301C\uFF5E]*(?::\d+)?(?::\d+)?/gu | ||
| /(?:~[\\/]|[\\/]|\.{1,2}[\\/]|[A-Za-z]:[\\/]|[\p{L}\p{N}\p{M}._-][\p{L}\p{N}\p{M}._\-\u30FB\uFF65]*[\\/])[\p{L}\p{N}\p{M}._~\-/%+@\\()[\]\u30FB\uFF65]*(?::\d+)?(?::\d+)?/gu |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,110p' src/renderer/src/lib/terminal-links-cjk.test.ts
sed -n '28,55p' src/renderer/src/lib/terminal-links.ts
sed -n '115,190p' src/renderer/src/lib/terminal-links.test.ts
rg -n 'terminal-links-cjk|terminal-links.test|vitest' package.json src/renderer/package.json vitest.config.* src/renderer/vitest.config.* 2>/dev/nullRepository: stablyai/orca
Length of output: 7373
🏁 Script executed:
#!/bin/bash
set -u
echo '--- focused diff against merge base ---'
git diff --stat a5c7dd9671e9f3675ac36c2e99f1c5cecddda853 d4cb008e1dbae93dcd6fe30178bfec5068f40ce8 -- src/renderer/src/lib/terminal-links.ts src/renderer/src/lib/terminal-links.test.ts src/renderer/src/lib/terminal-links-cjk.test.ts
git diff --unified=35 a5c7dd9671e9f3675ac36c2e99f1c5cecddda853 d4cb008e1dbae93dcd6fe30178bfec5068f40ce8 -- src/renderer/src/lib/terminal-links.ts src/renderer/src/lib/terminal-links.test.ts src/renderer/src/lib/terminal-links-cjk.test.ts
echo '--- test configuration and scripts ---'
sed -n '1,80p' package.json
fd -i 'vitest.*config.*|package.json' . | head -40
for f in config/vitest.config.ts src/renderer/vitest.config.ts vitest.config.ts; do
if [ -f "$f" ]; then
echo "--- $f ---"
sed -n '1,180p' "$f"
fi
done
echo '--- concise history for focused files ---'
git log --oneline -15 -- src/renderer/src/lib/terminal-links.ts src/renderer/src/lib/terminal-links.test.ts src/renderer/src/lib/terminal-links-cjk.test.tsRepository: stablyai/orca
Length of output: 21032
🏁 Script executed:
#!/bin/bash
set -u
echo '--- unit test inclusion ---'
sed -n '1,220p' config/scripts/ci-unit-files.mjs
rg -n 'terminal-links-cjk|detectTerminalFileLinkRanges|LOCAL_PATH_REGEX|SPACED_LOCAL_PATH_REGEXES|extractTerminalFileLinks|mergeTerminalFileLinkRanges' src/renderer/src/lib config/scripts/ci-unit-files.mjs
echo '--- extraction pipeline ---'
sed -n '80,330p' src/renderer/src/lib/terminal-links.ts
sed -n '1,260p' src/renderer/src/lib/terminal-file-link-detection-ranges.ts
echo '--- relevant history ---'
git show --stat --oneline c07aa5b4f10
git show --format=fuller --no-ext-diff --unified=18 c07aa5b4f10 -- src/renderer/src/lib/terminal-links.ts src/renderer/src/lib/terminal-links.test.ts src/renderer/src/lib/terminal-links-cjk.test.tsRepository: stablyai/orca
Length of output: 28319
🏁 Script executed:
#!/bin/bash
set -u
echo '--- URI detector and explicit target parsing ---'
sed -n '1,260p' src/renderer/src/lib/terminal-file-uri-link.ts
sed -n '1,300p' src/renderer/src/lib/explicit-file-link-target.ts
echo '--- focused CJK test with line numbers ---'
sed -n '1,70p' src/renderer/src/lib/terminal-links-cjk.test.ts | cat -nRepository: stablyai/orca
Length of output: 7386
🏁 Script executed:
#!/bin/bash
set -u
sed -n '1,240p' src/shared/terminal-file-url-target.ts
rg -n 'function parseFileLinkLocation|export function parseFileLinkLocation|parseFileLinkLocation' src/shared
sed -n '1,220p' src/shared/file-link-location.tsRepository: stablyai/orca
Length of output: 3729
Split the local-path and URI wave-dash cases in terminal-links-cjk.test.ts.
The local path assertions for U+301C and U+FF5E conflict with the intended matcher contract and can fail in the supported Vitest workflow. Keep the local-path delimiter behavior. Keep URI coverage in separate tests because file URIs use a different detector.
Suggested test correction
- for (const character of ['・', '・', '〜', '~']) {
+ for (const character of ['・', '・']) {
...
- it(`keeps URI handling separate for ${character}`, () => {
- expect(extractTerminalFileLinks(`https://example.com/前${character}後/a.txt`)).toEqual([])
- expect(extractTerminalFileLinks(`file:///tmp/前${character}後/a.txt`)[0]?.pathText).toBe(
- `/tmp/前${character}後/a.txt`
- )
- })
}
+
+ for (const character of ['・', '・', '〜', '~']) {
+ it(`keeps URI handling separate for ${character}`, () => {
+ expect(extractTerminalFileLinks(`https://example.com/前${character}後/a.txt`)).toEqual([])
+ expect(extractTerminalFileLinks(`file:///tmp/前${character}後/a.txt`)[0]?.pathText).toBe(
+ `/tmp/前${character}後/a.txt`
+ )
+ })
+ }There was a problem hiding this comment.
Important
Merging main pulled #23322's terminal-links-cjk.test.ts into this branch, and this PR's regex now fails it — the branch is not mergeable until the wave-dash expectations are reconciled.
Reviewed changes
This run re-reviewed only the delta since the prior Pullfrog review (60be095 → d4cb008).
- Merged
maininto the branch.mainhad already landed#23322— the same middle-dot widening plus\u301C/\uFF5Ein the continuation class, with its ownsrc/renderer/src/lib/terminal-links-cjk.test.ts. The merge kept this branch's narrower regex (no wave dashes), so the branch tree now carries a test that contradicts it. - Added a comment recording the
#23322decision. Two comment lines now state that#23322added the wave dashes to the continuation class and this branch keeps them out.
⚠️ This branch reverts part of a merged PR and carries its failing test
#23322 is already on main: it added \u301C/\uFF5E to the path class and a test asserting both wave dashes are retained. The merge brought that test into this branch unchanged, so the branch fails terminal-links-cjk.test.ts even though the diff here does not touch that file. This is not a line-level nit — the two test files encode opposite expectations, and only the author can decide whether wave dashes belong in the class (keep #23322) or out (update/trim #23322's test and accept that this PR supersedes it). The concrete repro is in the inline comment on the class.
Technical details
# Branch regex conflicts with #23322's merged test
## Affected sites
- `src/renderer/src/lib/terminal-links.ts:48` — trailing class omits `\u301C`/`\uFF5E`, reverting part of `#23322`.
- `src/renderer/src/lib/terminal-links-cjk.test.ts:5` — iterates `['・','・','〜','~']` and expects each retained; brought in by the merge from `main`.
- `src/renderer/src/lib/terminal-links.test.ts:162` — this branch's own test expects `\u301C`/`\uFF5E` to stop the path, the inverse expectation.
## Evidence
- At head `d4cb008`, `pnpm test src/renderer/src/lib/terminal-links-cjk.test.ts` fails: 28 assertions across the `〜` and `~` groups (path splits into `['/tmp/前','後/a.txt']`, `resolveTerminalFileLinkText` returns `null`, the URI case yields `後/a.txt`).
- `git show origin/main:src/renderer/src/lib/terminal-links.ts` still contains `[\u30FB\uFF65\u301C\uFF5E]`; `#23322` merged `2026-09-26`.
## Required outcome
- The branch's test suite passes: wave dashes either retained (align with `#23322`) or their `#23322` test cases removed/updated alongside a documented decision to supersede `#23322`.
## Open questions for the human
- Is this PR intended to supersede `#23322`, or should it fold into the already-merged behavior? If superseding, `terminal-links-cjk.test.ts` must drop the `〜`/`~` expectations.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
stablyai#23322 expects a wave dash inside a directory name. A dash in the final segment is still range prose, so the link stops there.
|
Directory names keep their wave dash, which is what terminal-links-cjk.test.ts from #23322 checks. A dash in the final segment is still trimmed, so |
| const lastSeparator = Math.max(range.text.lastIndexOf('/'), range.text.lastIndexOf('\\')) | ||
| const dashAt = range.text.slice(lastSeparator + 1).search(/[\u301C\uFF5E]/) | ||
| if (dashAt < 0) { | ||
| return range |
There was a problem hiding this comment.
Wave dash merges separate paths When terminal output shows two paths separated by a wave dash, such as
/tmp/a.txt〜/tmp/b.txt, the widened regex matches them as one range. This trim checks only after the last slash, so it leaves one link to the nonexistent combined path instead of linking the two printed paths.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed only the delta since the prior Pullfrog review (d4cb008 → 794aaf82), on top of the CJK widening.
- Put the wave dashes back in the continuation class.
\u301C/\uFF5Eare accepted again, so a directory name like前〜後links whole andterminal-links-cjk.test.ts(from #23322 onmain) passes — resolving the prior blocker. - Added
trimFinalSegmentWaveDash. A wave dash in the final path segment still ends the link (/var/log/app.logfromapp.log〜古い), so the branch's own range-prose test keeps passing while a dash in an earlier directory stays inside the path. - Rewrote the class comment to record the directory-vs-final-segment distinction.
Verified at head: terminal-links-cjk.test.ts 60/60 and terminal-links.test.ts 57/57 (117 total, the #23322 conflict is gone). Probed independently: /tmp/前〜後/a.txt links whole, /var/log/app.log〜古いものは削除 stops at the path, and /tmp/a〜b〜c/d.txt and /tmp/foo〜/bar.txt link whole. The final-segment trim is deliberately permissive — a real filename like /tmp/app〜old.log now links only /tmp/app — but that is exactly the trade-off the new comment documents.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Related pre-existing hard-wrap coverage gap, not a regression introduced by this PR: #14291 (comment). On Orca 1.4.218/macOS, a valid CJK/parentheses local file link printed by Codex CLI becomes unclickable when the TUI inserts a newline inside the path. Replaying the same text with no Codex process, using the real pinned xterm buffer and unmodified Orca detector, gives:
The standalone Python fixture and scope of the GUI/parser evidence are in the linked comment. Ordinary I have not run this PR's full branch, so this is not a claimed branch-test failure or a reason to block the narrower punctuation fix. It identifies a complementary hard-wrap regression to cover separately: the complete path and xterm cell range should be identical when hovering/clicking either row, without merging adjacent prose or sibling links. |

ELI5
If a folder in your path had a Japanese middle dot in its name —
会社・事業— Orca's terminalonly underlined the part of the path in front of the dot, and clicking the file part did nothing.
Now the whole path comes out as one link, the same way it already did for letters, digits and
accents.
What Changed
LOCAL_PATH_REGEXinsrc/renderer/src/lib/terminal-links.ts— the detector that claims localpaths in terminal output — accepted
\p{L}\p{M}\p{N}plus a handful of ASCII path characters afterthe first separator. Category
Powas not in the class, and U+30FB・(KATAKANA MIDDLE DOT),U+FF65
・(HALFWIDTH KATAKANA MIDDLE DOT), U+301C〜(WAVE DASH) and U+FF5E~(FULLWIDTHTILDE) are all
Po. The match stopped in front of the first one and the remainder of the path wasnever part of the link.
//nas/base/会社・事業/個人事業主/確定申告/R7確定申告送信票.pdf会社C:/tmp/中黒・テスト/a.txt中黒The four characters are added to the trailing class. Nothing else about the detector changed: the
leading alternation, the
:line:colsuffixes,isInsideUriScheme, the spaced-path passes, theboundary-punctuation trimming and the ReDoS profile are untouched.
Why
\p{Po}as a whole is not usable here. It reintroduces,;"'<>|, which areexactly the delimiters the boundary trimmer and the spaced-path passes rely on to stop a link
before prose. Widening the class that way would make
/tmp/report.txt, thenone link.shape:
,and。are sentence punctuation, socat /tmp/報告.txt,確認would link/tmp/報告.txt,確認instead of stopping at the path. I left the block out for that reason.platform, none of them reads as a delimiter next to a path, and together they cover the CJK
folder names that the report's table reproduces.
\u30FBand\uFF65look identical in a source file but are different code points, so the classuses escapes rather than literals.
Scope note:
mobile/src/terminal/terminal-path-tap.tshas its own ASCII-only copy of this regexfor the mobile tap detector. It is a separate detector with a separate matcher, and the report is
about the desktop hover/click path, so I left it alone rather than widening this PR.
Linked Issue
Fixes #23019
Visual Proof
N/A — no visual or interaction change beyond the link range growing to cover the characters above.
The rendering of an already-detected link is unchanged; there is no new UI surface.
Testing
Ran the detectors and their regression suites on Linux with the repo's own config
(
config/vitest.config.ts):src/renderer/src/lib/terminal-links.test.ts,src/renderer/src/lib/terminal-links-redos.test.ts,src/renderer/src/lib/terminal-file-uri-link.test.tsand
src/shared/file-link-location.test.ts— 71 tests, all passing.oxfmt --checkandoxlint --config .oxlintrc.jsonare clean on both changed files.The two new tests fail on the unmodified
LOCAL_PATH_REGEXand pass with the change, so they are areal regression guard:
keeps CJK name punctuation in the detected range— the two rows from the report's table.still stops a CJK path at ASCII delimiters— a CJK path followed by,and;still stops atthe path, which is the property the narrower choice above protects.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
I could not drive a real terminal on all three platforms from this environment, so the manual
checkbox is unticked. The detector is platform-independent — it is one regex shared by the local
and SSH/remote terminal link providers, and the new characters are not path separators — so
macOS/Windows/SSH share the same behaviour; the report's own repro was on Windows and the fix is
verified by the unit tests rather than by a hand-run session.
AI Disclosure
This PR was produced with OpenCode (
opencode/space-bunny-free) driving a local checkout. Thereporter supplied the diagnosis, the repro table and the character-class analysis in #23019; the
implementation is the four-character class widening plus the two regression tests, with a
deliberately narrower set than the report proposed. The full
pnpm lint/pnpm typecheck/pnpm buildmatrix was not run here (nopnpm installin this environment) — the targeted vitestsuite,
oxfmtandoxlintwere, and CI covers the rest.Review
Agent review of the diff:
platform branch. The characters are valid in paths on Windows, macOS and Linux. Windows drive
letters and UNC
//host/shareprefixes still match the leading alternation unchanged.the fix with no extra work. No path is resolved on the remote host by this change.
profile.
terminal-links-redos.test.ts(the large-line budget test) still passes.a path. The new delimiter test pins the ASCII
,/;behaviour that\p{Po}would havebroken. Spaced paths were never affected — their negated class already accepted these characters.
resolveTerminalFileLinkTargetor theauthorizeExternalPathgate. A longer detected range means a longer path handed to the existingauthorization check, which is the check that already gates every opened path.
touches no agent, runtime or provider code.
Agent skill upstream boundary
comments or documentation are copied or translated.
Notes
No security, backwards-compatibility, mobile or remote-SSH impact beyond what is listed above.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass — targeted vitest,oxfmtandoxlintpass locally; the full matrix is left to CI