Skip to content

Conversation

marcotaranta
Copy link

Summary of the Pull Request

Fixing issue with command line parameter --startingDirectory ending in a wrong path because of the way CommandLineToArgvW do its parse.

References and Relevant Issues

https://devblogs.microsoft.com/oldnewthing/20100917-00/?p=12833

Detailed Description of the Pull Request / Additional comments

In this command line example: --startingDirectory "C:\Users\My User\" the CommandLineToArgvW method parses the path excluding the opening quote and maintaining the ending quote, because it is backed by a trailing slash.
I've done a very specific fix to only fix that usage of that parameter, so it doesn't end in any regression.

Validation Steps Performed

Used to fail setting the starting directory (note the trailing backslash):
wt.exe --startingDirectory "c:\A\B B\"

Successfully sets the starting directory:
wt.exe --startingDirectory "c:\A\B B"

PR Checklist

…n a wrong path because of the way CommandLineToArgvW do its parse.
@marcotaranta marcotaranta marked this pull request as draft October 13, 2025 13:50
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.

wt.exe startingDirectory argument fails with path containing spaces and a trailing backslash

1 participant