microsoft / microsoft/WSL

Spaces in windows PATH break when appendWindowsPath is true

Open
#13,794 8 comments 0 reactions 1 assignee Claimed by @OneBlue View on GitHub
emailed-logs
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

### Windows Version

Microsoft Windows [Version 10.0.26200.7171]

### WSL Version

2.5.9.0

### Are you using WSL 1 or WSL 2?

- [x] WSL 2
- [ ] WSL 1

### Kernel Version

6.6.87.2-1

### Distro Version

Ubuntu 24.04

### Other Software

VS Code - 1.106.2
Cursor - 2.1.25

### Repro Steps

```sh
>>> code .
command code not found
>>> cursor .
command cursor not found
```

### Expected Behavior

```sh
>>> code . # opens VS Code
>>> cursor . # opens Cursor
```

### Actual Behavior

```sh
>>> code .
command code not found
>>> cursor .
command cursor not found
```

### Diagnostic Logs

```sh
>>> echo $PATH
# ... bunch of normal linux paths like /usr/bin]
# broken Windows Paths, note ":" where spaces should be
/mnt/c/Program:Files/dotnet/:Files/Git/cmd:Files/Amazon/AWSCLIV2/:/Docker/host/bin:Files/cursor/resources/app/bin:Files/PowerShell/7/:/mnt/c/Users/Cooper/.local/bin:/mnt/c/Users/Cooper/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Cooper/AppData/Local/Programs/Microsoft:VS:Code/bin:
# bunch of other stufff
```

A workaround is for me to manually add the correct paths to my `.bashrc`

```sh
# temporary, hopefully. not sure why this suddenly stopped working...
export PATH="$PATH:/mnt/c/Users/Cooper/AppData/Local/Programs/Microsoft VS Code/bin"
export PATH="$PATH:/mnt/c/Program Files/cursor/resources/app/bin"
```

This made it work!

This was never a problem until I restarted my device recently (and presumbaly some updates were applied).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.