Repository navigation
fix(terminal): retain Japanese middle dots and tildes in file links - #23322
Conversation
Adapt the bounded character extension from PR #23061 and cover all four characters across path styles, delimiters, URIs and Windows location suffixes. Co-authored-by: Yi-111-a <[email protected]>
|
Warning Review limit reachedNext included review available in 20 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
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.
ℹ️ Minor suggestions only.
Reviewed changes
- CJK punctuation in
LOCAL_PATH_REGEX— adds・(U+30FB),・(U+FF65),〜(U+301C), and~(U+FF5E) to the trailing character class so Japanese folder names containing them linkify whole. - CJK path test suite — 60 cases covering posix/Windows-drive/UNC/
./path styles,:line:colresolution, delimiter termination, and the URI pass.
Verified this run: terminal-links-cjk.test.ts and terminal-links.test.ts plus all terminal-link-*.test.ts pass (278 tests); the changed-code quality gate reports 0 new findings. Old-vs-new regex comparison confirms the reported cases (/tmp/前・後/a.txt, C:/tmp/中黒・テスト/a.txt, //nas/base/会社・事業/a.pdf) now match whole.
ℹ️ Nitpicks
- The new comment at
terminal-links.ts:36says "without admitting prose delimiters", but・and〜/~are themselves Japanese prose separators (list elements and ranges). A path immediately followed by one now absorbs the following prose into a single link — e.g./tmp/a.txt〜次was/tmp/a.txtbefore this change and is/tmp/a.txt〜次now — and no test pins that tradeoff.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Thanks — that ambiguity is real. Allowing these four filename characters also allows adjacent Japanese list/range prose such as |
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.
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.

ELI5
Orca cut some Japanese file paths halfway through their names. Keep four middle-dot and tilde characters so supported terminal links reach the intended file.
What Changed
Extend the existing desktop path detector with
・,・,〜, and~. For example,C:/tmp/中黒・テスト/a.txtremains a complete link. Add 60 cases for path styles, delimiters, URI handling and Windows line/column suffixes.Why
Reusing the detector with four explicit characters preserves the existing excluded delimiters, such as comma and full stop. These four admitted characters may also be used as Japanese prose separators, so adjacent text such as
/tmp/a.txt〜次is now one candidate; the detector cannot infer whether that is a filename or prose. Accepting entire Unicode punctuation blocks would also absorb delimiters. Adapted from Yi-111-a’s #23061 proposal, with coauthor attribution preserved.Linked Issue
Related to #23019. Native Windows opening from that report remains unproven; this PR does not claim that platform behavior is verified.
Visual Proof
Attached before/after captures come from the accepted macOS audit of the identical detector source: before, the full path offers no file action; after, the full destination appears and the controlled file contents open. The published images are labeled crops/redactions that remove local path prefixes and terminal identity while preserving the CJK suffix, Open file action and rendered contents. These are real pointer/popover clicks in a hidden, isolated Electron renderer, not a fresh publication-build run or a native PTY encoding test.
Testing
Fresh integration validation on macOS, with
ORCA_BACKGROUND_LAUNCH=1:node node_modules/vitest/vitest.mjs run --config config/vitest.config.tswith the 12 focused detector, URI, performance, click/open routing, SSH, WSL, wrapped-range and runtime path-resolution test files: 233 passed.node node_modules/typescript/bin/tsc --noEmit -p config/tsconfig.tc.web.json: passed.node config/scripts/check-changed-code-quality.mjsagainst pinned publication main: passed, no new findings.Historical regression evidence: 56 of the new 60 cases failed before the fix. Historical counts overlap with the fresh 233 tests and are not additional coverage.
Review
Independent review of this exact publication head found no patch-introduced correctness, security or maintainability issues. It independently passed the same 233 tests plus Unicode and real xterm cell probes. Current-head CI passed: all eight test shards, relay integration, static analysis, typechecking, both package lanes and aggregate
verify. Pullfrog passed; its adjacent-prose nit is documented above and its pre-existing relative-path suggestion was answered with the bounded scope. CodeRabbit was rate-limited and supplied no completed review. Additional native Windows validation could not start and remains a documented evidence gap.Agent skill upstream boundary
Notes
Native Windows/Linux, live SSH opening, folder UI, native PTY encoding and PDF opening remain untested. Routing tests are not native platform proof. Mobile remains unchanged. Unprefixed first directories such as
会社・事業/a.txtretain the existing limitation;./会社・事業/a.txtis covered. Existing hard-row CJK reconstruction and wide-character wrap-filler limitations also remain unchanged. No filesystem authorization, remote protocol, Git/provider behavior, or path encoding changed.Checklist