-
Notifications
You must be signed in to change notification settings - Fork 38.1k
Description
With the new feature from July participating debug extensions can now support an
argsproperty that takes a single string that is passed unmodified to the underlying shell (this solves your problem "... a single string that appears as multiple space-separated arguments on the command line").This makes it possible to use a command line like the following in a launch.json:
"args": "`echo hello world` > outfile",Instead of having this command line literal in the launch.json you can use an
${input:commandline}variable that lets the user type the command line in an input box:"args": "${input:commandline}",
Originally posted by @weinand in #83678 (comment)
I was really frustrated when I "debug Python files with arguments", input my space-separated argument list, and see my script treating it like a single argument. So I think it is more sensible to make "args": "${command:pickArgs}" as default, instead of "args": ["${command:pickArgs}"]. More specifically, taking Python for example, I suggest changing the default debug configuration:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python 调试程序: 包含参数的当前文件",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": [
"${command:pickArgs}"
]
}
]
}to:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Python File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": "${command:pickArgs}"
}
]
}