Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe change standardizes WSL path handling in terminal file routing. Existing WSL UNC paths are normalized to Windows backslash UNC format. Absolute POSIX paths are converted through 🚥 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: Pro Plus
Run ID: 04a3b0c1-8368-4950-bd5d-4208aedb4368
📥 Commits
Reviewing files that changed from the base of the PR and between a70291a and 170601f35a2d797c3151ca536ae50644dbecc125.
📒 Files selected for processing (2)
src/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-link-handlers.test.ts
| const distro = wslDistro?.trim() || parseWslUncPath(worktreePath)?.distro | ||
| if (!distro || !filePath.startsWith('/') || filePath.startsWith('//')) { | ||
| if (!distro || !filePath.startsWith('/')) { | ||
| return filePath | ||
| } | ||
| // Why: /mnt/<drive> is a Windows drive mounted into WSL — reach it directly | ||
| // instead of routing a native file back through the 9P share. | ||
| if (/^\/mnt\/[a-z](\/|$)/.test(filePath)) { | ||
| return toWindowsWslPath(filePath, distro) | ||
| } | ||
| return `//wsl.localhost/${distro}${filePath}` | ||
| return toWindowsWslPath(filePath, distro) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Preserve non-WSL // UNC paths.
If filePath is //server/share/file.md, parseWslUncPath returns null, but this branch converts it through toWindowsWslPath when distro exists. The result becomes \\wsl.localhost\Ubuntu\\server\share\file.md instead of preserving the network-share path. Keep the // exclusion for non-WSL UNC inputs. WSL UNC inputs already return from the preceding branch.
Proposed fix
- if (!distro || !filePath.startsWith('/')) {
+ if (!distro || !filePath.startsWith('/') || filePath.startsWith('//')) {
return filePath
}Add a regression test for //server/share/file.md.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const distro = wslDistro?.trim() || parseWslUncPath(worktreePath)?.distro | |
| if (!distro || !filePath.startsWith('/') || filePath.startsWith('//')) { | |
| if (!distro || !filePath.startsWith('/')) { | |
| return filePath | |
| } | |
| // Why: /mnt/<drive> is a Windows drive mounted into WSL — reach it directly | |
| // instead of routing a native file back through the 9P share. | |
| if (/^\/mnt\/[a-z](\/|$)/.test(filePath)) { | |
| return toWindowsWslPath(filePath, distro) | |
| } | |
| return `//wsl.localhost/${distro}${filePath}` | |
| return toWindowsWslPath(filePath, distro) | |
| const distro = wslDistro?.trim() || parseWslUncPath(worktreePath)?.distro | |
| if (!distro || !filePath.startsWith('/') || filePath.startsWith('//')) { | |
| return filePath | |
| } | |
| // Why: /mnt/<drive> is a Windows drive mounted into WSL — reach it directly | |
| // instead of routing a native file back through the 9P share. | |
| return toWindowsWslPath(filePath, distro) |
|
Ready for review (contributor priority pack)
Part of a short priority list for maintainers: P0 |
Forward-slash //wsl.localhost links opened as a different path string than the Files sidebar's backslash UNC, so file watchers did not refresh the editor. Canonicalize WSL UNC to \\wsl.localhost\... at map time. Fixes stablyai#13349
170601f to
b361a68
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Summary
//wsl.localhost/Ubuntu/...opened files under a different path string than the Files sidebar (\\wsl.localhost\Ubuntu\...).//and\\inputs) to the Windows backslash form when mapping terminal paths so open + watch match the sidebar.Test plan
terminal-link-handlerstests (98)//wsl.localhost/...terminal link, edit file in WSL, editor should refreshFixes #13349