commandLine setting not properly escaping? #8255

Closed
opened 2026-01-31 01:24:42 +00:00 by claunia · 4 comments
Owner

Originally created by @emmatyping on GitHub (May 19, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19592.1001]
Windows Terminal version (if applicable): 0.11.1333.0

Steps to reproduce

Create a profile with the command line setting copied verbatim from https://github.com/microsoft/terminal/blob/master/doc/user-docs/ThirdPartyToolProfiles.md#developer-command-prompt-for-visual-studio

Expected behavior

A new VS Developer Command prompt opens

Actual behavior

A new shell displays

'C:/Program' is not recognized as an internal or external command,
operable program or batch file.

and a normal CMD prompt, as the above indicates the argument isn't being escaped properly.

Originally created by @emmatyping on GitHub (May 19, 2020). # Environment ```none Windows build number: Microsoft Windows [Version 10.0.19592.1001] Windows Terminal version (if applicable): 0.11.1333.0 ``` # Steps to reproduce Create a profile with the command line setting copied verbatim from https://github.com/microsoft/terminal/blob/master/doc/user-docs/ThirdPartyToolProfiles.md#developer-command-prompt-for-visual-studio # Expected behavior A new VS Developer Command prompt opens # Actual behavior A new shell displays ``` 'C:/Program' is not recognized as an internal or external command, operable program or batch file. ``` and a normal CMD prompt, as the above indicates the argument isn't being escaped properly.
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 01:24:42 +00:00
Author
Owner

@DHowett commented on GitHub (May 19, 2020):

I think this actually means that you don't have VS installed in that location. I realize that sounds weird, but...

Here's my profile, with the same level of escaping

{                                                                                                                                                       
    "name": "Developer Pwsh",                                                                                                                           
    "guid": "{1bb0520b-2f63-4db8-943d-8cb18e05957c}",                                                                                                   
    "commandline": "%comspec% /c \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat\" && pwsh -nologo", 
    "icon": "ms-appx:///ProfileIcons/pwsh-preview.png"                                                                                                  
},                                                                                                                                                      

Here's what I get if I specify Enterprise:

image

And if I specify Professional (which I do not have):

image

@DHowett commented on GitHub (May 19, 2020): I think this actually means that you don't have VS installed in that location. I realize that sounds weird, but... Here's my profile, with the same level of escaping ``` { "name": "Developer Pwsh", "guid": "{1bb0520b-2f63-4db8-943d-8cb18e05957c}", "commandline": "%comspec% /c \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat\" && pwsh -nologo", "icon": "ms-appx:///ProfileIcons/pwsh-preview.png" }, ``` Here's what I get if I specify `Enterprise`: ![image](https://user-images.githubusercontent.com/189190/82291586-1a926a00-995e-11ea-92ae-843a26f81a2e.png) And if I specify `Professional` (which I do not have): ![image](https://user-images.githubusercontent.com/189190/82291596-1f571e00-995e-11ea-8ae5-91c0e74698c8.png)
Author
Owner

@DHowett commented on GitHub (May 19, 2020):

(This is the same thing that happens if you specify a path with spaces to a thing that doesn't exist in the Run dialog.)

image
image

@DHowett commented on GitHub (May 19, 2020): (This is the same thing that happens if you specify a path with spaces to a thing that doesn't exist in the Run dialog.) ![image](https://user-images.githubusercontent.com/189190/82291634-36960b80-995e-11ea-8ed5-b43eb39d98f9.png) ![image](https://user-images.githubusercontent.com/189190/82291640-38f86580-995e-11ea-9186-b71ca943660f.png)
Author
Owner

@emmatyping commented on GitHub (May 19, 2020):

D'oh! Thank you, indeed that seems to be the issue. Thank you :)

Unfortunate that the error is rather inscrutable.

@emmatyping commented on GitHub (May 19, 2020): D'oh! Thank you, indeed that seems to be the issue. Thank you :) Unfortunate that the error is rather inscrutable.
Author
Owner

@DHowett commented on GitHub (May 19, 2020):

Alas! It definitely is. I'd say we could make it better, but . . . changing cmd is a no-go 😄

@DHowett commented on GitHub (May 19, 2020): Alas! It definitely is. I'd say we could make it better, but . . . changing `cmd` is a no-go :smile:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8255