[PR #12437] Don't ever allow ~ as a startingDirectory #29037

Open
opened 2026-01-31 09:32:23 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/12437

State: closed
Merged: Yes


Basically, some WSL distros ship fragments that replace the commandline with the executable for their distro (ubuntu.exe, etc.). We didn't expect that when we changed the startingDirectory for them all to ~.

Unfortunately, ~ is really never a valid path for a process on windows, so those distros would now fail with

[error 2147942667 (0x8007010b) when launching `ubuntu1804.exe']
Could not access starting directory "~"

If we find that we were unable to mangle ~ into the user's WSL commandline, then we will re-evaluate that startingDirectory as %USERPROFILE%, which is at least something sensible, if albeit not what they wanted.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/12437 **State:** closed **Merged:** Yes --- Basically, some WSL distros ship fragments that replace the `commandline` with the executable for their distro (`ubuntu.exe`, etc.). We didn't expect that when we changed the `startingDirectory` for them all to `~`. Unfortunately, `~` is really never a valid path for a process on windows, so those distros would now fail with ``` [error 2147942667 (0x8007010b) when launching `ubuntu1804.exe'] Could not access starting directory "~" ``` If we find that we were unable to mangle `~` into the user's WSL `commandline`, then we will re-evaluate that `startingDirectory` as `%USERPROFILE%`, which is at least something sensible, if albeit not what they wanted. * regressed in #12315 * [x] Closes #12353 * [x] Tested with a (`ubuntu1804.exe`, `~`) profile - launched successfully, where 1.13 in market fails. * [x] added tests
claunia added the pull-request label 2026-01-31 09:32:23 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29037