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
Tasks: Single/double quotes not quoted/escaped #46709
Comments
Same when using a task provider. |
Same for $
This will print the $PATH variable, I was expecting the $ to be escaped |
@chrmarti and I discussed this a little and here is what we should do:
This might be problematic so under cmd.exe since it doesn't support escaping. I fall back to strong quoting for cmd.exe. @ramya-rao-a I think the current behaviour is correct since escaping is more used like weak quoting than strong quoting. So |
More complicated. In both bash and PowerShell you can't escape stuff in a strong quoted arg. This makes sense since in a strong quotes string is not interpreted by the shell. |
You can escape " in weak quoting. There is not need to escape ' in weak quotes since ' will not be interpreted in weak quoted args. |
Tested a little more:
|
Here is what I fixed:
|
To verify: {
"version": "2.0.0",
"tasks": [
{
"label": "dir",
"type": "shell",
"command": "echo",
"args": [
{
"value": "'Hello World'",
"quoting": "escape"
}
],
"problemMatcher": []
}
]
} Should print |
1.22 insiders on Linux. Testing #46567.
Default quoting does not quote/escape when using a single or double quote in an argument or the command name.
The text was updated successfully, but these errors were encountered: