Skip to content

fix(terminal): resolve WSL file links from the execution runtime, not the worktree path - #12465

Merged
OrcaWin merged 1 commit into
mainfrom
fix/wsl-terminal-file-link-distro
Aug 8, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
fix/wsl-terminal-file-link-distro

Conversation

@nwparker

@nwparker nwparker commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

mapTerminalFilePath derived the WSL distro only from the shape of worktreePath. A worktree on a native Windows drive whose project runs under the WSL runtime gets a shell whose paths are POSIX, so no distro was found, the path went verbatim to a Win32 stat probe, and the candidate was dropped — no underline, no tooltip, inert Ctrl+click.

Fix

Resolve the pane's distro from the execution runtime, falling back to the old worktree-shape derivation so existing behaviour is unchanged. Note the half of #8156 covered by merged #8215 (worktree on the WSL filesystem) was already fixed; this closes the remaining gap.

Verification

  • pnpm typecheck clean on this branch
  • This branch's own tests pass; the new cases fail before the change and pass after
  • Split out of the original combined branch; the union of all 12 split branches was diffed back against it to prove nothing was lost

Fixes #8156

Made with Orca 🐋

… the worktree path

`mapTerminalFilePath` derived the WSL distro only from the *shape* of `worktreePath`. A worktree on a native Windows drive whose project runs under the WSL runtime gets a shell whose paths are POSIX, so no distro was found, the path went verbatim to a Win32 stat probe, and the candidate was dropped — no underline, no tooltip, inert Ctrl+click.

Resolve the pane's distro from the execution runtime, falling back to the old worktree-shape derivation so existing behaviour is unchanged. Note the half of #8156 covered by merged #8215 (worktree on the WSL filesystem) was already fixed; this closes the remaining gap.

Fixes #8156

Co-authored-by: Orca <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@nwparker, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 58c91a6a-f3a1-4e8c-87c1-972a3b790261

📥 Commits

Reviewing files that changed from the base of the PR and between c498d2d and f4e56ed.

📒 Files selected for processing (7)
  • src/renderer/src/components/terminal-pane/terminal-file-link-hit-testing.ts
  • src/renderer/src/components/terminal-pane/terminal-file-open-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-link-handlers.test.ts
  • src/renderer/src/components/terminal-pane/terminal-link-handlers.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-routing.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-wsl-distro.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker

nwparker commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Proof status — partial, and I want to be precise about which half

This fix has two halves. Only one of them is demonstrated below.

The path-mapping half — demonstrated on the real platform. On win-old (Windows 11 / WSL2 Ubuntu 26.04) a POSIX path from a WSL shell is unusable by the Win32 stat probe, while its mapped UNC twin resolves:

GUEST : /root/.local/share/... (a POSIX path as printed by a WSL shell)
  Test-Path   -> False
  resolves to -> C:\root\.local\share\...        <- Win32 rebases the leading / onto the current drive

UNC   : \\wsl.localhost\Ubuntu\root\.local\share\...
  Test-Path   -> True

That is exactly the failure this issue describes: pathExists returns false for the terminal's POSIX path, the candidate is dropped, and the link never underlines — no tooltip, inert Ctrl+click.

The half this PR actually changes — NOT demonstrated end to end. The gap fixed here is narrower than the issue title. mapTerminalFilePath already handled a worktree on the WSL filesystem (merged #8215). What was still broken is a worktree on a native Windows drive whose project runs under the WSL runtime: the distro was derived only from the shape of worktreePath, so no distro was found and the mapping above never got a chance to run. The fix resolves the distro from the execution runtime instead.

Proving that requires a Windows Orca build with a WSL-runtime project and a real clickable link in a terminal pane. I did not build Orca on the Windows host, so there is no recording of the link becoming clickable. That half rests on the unit tests in this PR.

Warning

Treat this as partial proof. The mechanism is confirmed on real WSL; the specific distro-resolution change is covered by unit tests only. If you want the end-to-end recording before merging, say so and I will build Orca on win-old and capture it.

@OrcaWin
OrcaWin merged commit d0baa20 into main Aug 8, 2026
43 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
… the worktree path (stablyai#12465)

`mapTerminalFilePath` derived the WSL distro only from the *shape* of `worktreePath`. A worktree on a native Windows drive whose project runs under the WSL runtime gets a shell whose paths are POSIX, so no distro was found, the path went verbatim to a Win32 stat probe, and the candidate was dropped — no underline, no tooltip, inert Ctrl+click.

Resolve the pane's distro from the execution runtime, falling back to the old worktree-shape derivation so existing behaviour is unchanged. Note the half of stablyai#8156 covered by merged stablyai#8215 (worktree on the WSL filesystem) was already fixed; this closes the remaining gap.

Fixes stablyai#8156

Co-authored-by: Orca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows + WSL worktree: terminal file-path links (POSIX paths) never become clickable

2 participants