Merged
Conversation
WSL sessions need the project path translated from Windows format (C:\Users\...) to WSL mount format (/mnt/c/Users/...). Pass the converted path via --cd to wsl.exe and use the Windows home dir as the spawn cwd (since wsl.exe itself is a Windows process). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix array mutation bug where shellExtraArgs accumulated --cd flags across sessions (copy array instead of mutating cached profile) - Convert Windows paths to WSL /mnt/ format via --cd flag - Fall back to auto-detected Windows shell for Claude sessions when a WSL profile is selected, since Claude CLI session data lives on the Windows filesystem and isn't accessible from inside WSL - WSL profiles now work correctly for plain terminal sessions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes WSL shell profile issues introduced in the shell profiles feature (#13):
C:\Users\alexh\source\repos\project) are now converted to WSL mount paths (/mnt/c/Users/alexh/source/repos/project) via--cdflag passed towsl.exeshellExtraArgswas mutating the cached profile'sargsarray in place, causing--cdflags to accumulate across session launches. Fixed by copying the array on each use.Changes
main.jswindowsToWslPath()andisWslShell()helpers; WSL--cdpath conversion; spread-copyshellProfile.argsto prevent mutation; Claude sessions fall back to Windows shell when WSL profile is activeTest plan
/mnt/c/...directory--cdarg accumulation (check logs)🤖 Generated with Claude Code