Parsing "-d" argument has minor issues #13596

Closed
opened 2026-01-31 03:46:58 +00:00 by claunia · 2 comments
Owner

Originally created by @tavrez on GitHub (Apr 23, 2021).

Greeting,
I want to have something like this in registry for some operations:

wt -d "%V"

a small note about %V: for folders when it's resolved it has no \ at the end but for root drives it has(c:\ vs c:\folder).
So the command is going to be in one of these forms:

wt -d "C:\folder"
wt -d "C:\"

First line is fine, however, second line will instantly crash.
The problem with it is the \", which is parsed like ", if I do one of these:

wt -d "c:\\"
wt -d "c:"
wt -d c:\
wt -d c:

Everything become perfect, however, this is not something %V is going to be resolved into.
I also cannot use wt -d %V(without quotes) in registry, because it makes trouble for folders with space.

Originally created by @tavrez on GitHub (Apr 23, 2021). Greeting, I want to have something like this in registry for some operations: ```cmd wt -d "%V" ``` **a small note about `%V`:** for folders when it's resolved it has no `\` at the end but for root drives it has(`c:\` vs `c:\folder`). So the command is going to be in one of these forms: ```cmd wt -d "C:\folder" wt -d "C:\" ``` First line is fine, however, second line will instantly crash. The problem with it is the `\"`, which is parsed like `"`, if I do one of these: ```cmd wt -d "c:\\" wt -d "c:" wt -d c:\ wt -d c: ``` Everything become perfect, however, this is not something `%V` is going to be resolved into. I also cannot use `wt -d %V`(without quotes) in registry, because it makes trouble for folders with space.
claunia added the Resolution-Duplicate label 2026-01-31 03:46:58 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 29, 2021):

Thanks for reporting this! I think we've got another thread tracking the same underlying issue here. From that thread:

As a quick hack for %V, you might be able to use.. hmm. "%V\."?

/dup #4571

@zadjii-msft commented on GitHub (Apr 29, 2021): Thanks for reporting this! I think we've got another thread tracking the same underlying issue here. From that thread: > As a quick hack for %V, you might be able to use.. hmm. `"%V\."`? /dup #4571
Author
Owner

@ghost commented on GitHub (Apr 29, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Apr 29, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13596