Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arguments passed in launch terminal #96091

Closed
andreeis opened this issue Apr 24, 2020 · 1 comment
Closed

Arguments passed in launch terminal #96091

andreeis opened this issue Apr 24, 2020 · 1 comment
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@andreeis
Copy link

We want to implement in the CMake Tools VSCode extension arguments passing to the launch terminal. We realized that there are numerous situations of quoting and escaping that we would need to handle in order for the arguments to be passed properly in all the available types of terminals.

We were wondering if this is already handled centrally by VSCode, so that all the other extensions wouldn't have to worry all about the same thing. Is there some API we that can act as an intermediary between an array of arguments and any type of terminal supported in VSCode?

Or how do you suggest we best approach this on our side if there is nothing available from your side?

@Tyriar
Copy link
Member

Tyriar commented Apr 27, 2020

For sendText you can send whatever you want, for args quoting is done for you if you pass in a string[], some cases might not work there which is why we let you use string here if you want to pass in a pre-quoted args string:

vscode/src/vs/vscode.d.ts

Lines 8044 to 8048 in 84ac04e

/**
* Args for the custom shell executable. A string can be used on Windows only which allows
* specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).
*/
shellArgs?: string[] | string;

The built-in capability is only provided for args as string[], not for args as string or sendText.

@Tyriar Tyriar closed this as completed Apr 27, 2020
@Tyriar Tyriar added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Apr 27, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants