Skip to content

Fix WSL CWD: use --cd arg injection instead of UNC paths#11

Merged
halilc4 merged 3 commits intomainfrom
dev
Feb 15, 2026
Merged

Fix WSL CWD: use --cd arg injection instead of UNC paths#11
halilc4 merged 3 commits intomainfrom
dev

Conversation

@halilc4
Copy link
Owner

@halilc4 halilc4 commented Feb 15, 2026

Summary

  • Fix WSL2 working directory not being set when opening workspaces (working directory not working in wsl2 #10)
  • Use --cd argument injection into WSL shell commands instead of UNC paths (\wsl.localhost\...) which WSL doesn't support natively

Test plan

  • Open a workspace with CWD set on a WSL profile
  • Verify terminal opens in the correct directory
  • Verify non-WSL profiles still work correctly

🤖 Generated with Claude Code

halilc4 and others added 3 commits February 15, 2026 10:46
Convert Unix CWD paths to UNC format (\wsl.localhost\<distro>\<path>)
for WSL profiles so Tabby's fsSync.existsSync() validation passes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous UNC path approach (commit 62d20bf) failed because:
- isWslProfile() checked profile.type but Tabby sets type='local' for ALL
  built-in shells (CMD, PowerShell, WSL). Detection must use profile.id.
- UNC paths (\wsl.localhost\...) are unreliable: Tabby validates CWD with
  fs.existsSync() which can fail if WSL isn't fully ready, and wsl.exe
  doesn't guarantee translating Windows UNC CWD to Linux CWD.

New approach: inject `--cd <path>` into wsl.exe args, which directly sets
the Linux working directory. This bypasses fs.existsSync validation and
works for all WSL profiles (default and named distros).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@halilc4 halilc4 merged commit 23b33a6 into main Feb 15, 2026
2 of 3 checks passed
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.

1 participant