Terminal local file links are mis-tokenized around CJK punctuation

Open
#318,709 2 comments 0 reactions 1 assignee View on GitHub

@anthonykim1 is already working on this.

Since May 28, 2026.

Assessment

This issue has not been assessed yet.

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.121.0 (All Versions)
  • OS Version: Windows 11 (All Platforms)

Steps to Reproduce:

  1. Open a folder in VS Code and create a file:

    mkdir -p src
    touch src/main.ts
    touch src/utils.ts
    touch src/view.ts
    touch src/a.ts
    touch src/b.ts
    touch '《论文》.docx'
    
  2. In the integrated terminal, print localized output that includes paths next to CJK sentence/separator punctuation:

    printf '%s\n' \
      'ASCII baseline: file: src/main.ts' \
      'CJK fullwidth colon before path: 请打开文件:src/main.ts。' \
      'CJK comma/full stop: 問題在:src/utils.ts,建議檢查。' \
      'CJK list separator: 関連ファイル:src/a.ts、src/b.ts。' \
      'CJK exclamation/question: 请检查:src/view.ts!是否存在:src/utils.ts?' \
      'CJK punctuation in filename: 请打开:《论文》.docx。'
    
  3. Hold Ctrl/Cmd and hover or click the file path portions in each line.

Actual:

  • The ASCII baseline, file: src/main.ts, is detected as a local file link.
  • Paths next to CJK sentence/separator punctuation appear to be mis-tokenized as candidates that include surrounding text or punctuation, causing local file validation to fail:
    • src/main.ts is effectively tokenized as 请打开文件:src/main.ts。
    • src/utils.ts is effectively tokenized as 問題在:src/utils.ts,建議檢查。
    • src/a.ts and src/b.ts should be two separate links, but the text is effectively tokenized as 関連ファイル:src/a.ts、src/b.ts。
    • src/view.ts and src/utils.ts should be two separate links, but the text is effectively tokenized as 请检查:src/view.ts!是否存在:src/utils.ts?
    • 《论文》.docx is effectively tokenized as 请打开:《论文》.docx。

Expected:

  • The local file link text should be the path itself, without surrounding natural-language text or CJK sentence/separator punctuation:
    • 请打开文件:src/main.ts。 should link src/main.ts
    • 問題在:src/utils.ts,建議檢查。 should link src/utils.ts
    • 関連ファイル:src/a.ts、src/b.ts。 should produce two links: src/a.ts and src/b.ts
    • 请检查:src/view.ts!是否存在:src/utils.ts? should produce two links: src/view.ts and src/utils.ts
  • Bracket-like CJK punctuation such as 《》 is more likely to be part of an actual file name, so it should be preserved when it is inside the path. This is different from CJK sentence/separator punctuation, which appears around or between paths in these examples.
    • 请打开:《论文》.docx。 should link 《论文》.docx

Local file links should still work when paths are surrounded by common CJK sentence/separator punctuation.

These are common shapes in localized CJK terminal output where punctuation is used as a label separator, trailing sentence punctuation, or list separator. This is also common in natural language output from tools and AI coding assistants.

Notes:

  • I could not find a setting that works around this. terminal.integrated.wordSeparators is documented and wired up for double-click word selection and fallback word/search link detection, while terminal local file links are parsed separately by the local file link parser.
  • This is specific to terminal local file link parsing. URL link detection does not have the same issue with these CJK punctuation boundaries, and already has explicit handling for several CJK punctuation characters as link terminators. Local file link parsing appears to have a smaller hardcoded delimiter set.
  • Terminal local file link detection is already heuristic and optimizes for likely clickable paths rather than all syntactically valid file names. ASCII punctuation such as : and ; is already treated as separators even though some of these characters may be valid in file names on some platforms.
  • A reasonable scope would be CJK sentence/separator punctuation such as / / / / / / , which commonly appears around or between paths in localized and natural-language terminal output. Bracket-like CJK punctuation such as 【】, 《》, 「」, and () is more likely to be part of actual file or directory names, so it should be preserved when it appears inside the path rather than treated as the same kind of delimiter.

🙋 I can work on a PR for this if the proposed scope sounds reasonable.

Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.