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

Support 'argsCanBeInterpretedByShell' property as part of DAP #10654

Open
ansonmiu0214 opened this issue Mar 10, 2023 · 1 comment
Open

Support 'argsCanBeInterpretedByShell' property as part of DAP #10654

ansonmiu0214 opened this issue Mar 10, 2023 · 1 comment

Comments

@ansonmiu0214
Copy link

Feature Request

Can we support the "argsCanBeInterpretedByShell" property in the RunInTerminalRequest as part of the Debug Adapter Protocol? Official release notes - https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_70.md#argscanbeinterpretedbyshell-for-runinterminalrequest

This feature is supported by the VS Code Node debugger.

This will allow us to supply unmodified argument strings to the underlying C++ program when debugging. A use-case for this feature is to support prompting the user for command line arguments to pass to the underlying C++ program using VS Code's promptString variable substitution:

// launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug with Args",
            "type": "cppdbg",
            "request": "launch",
            // Resolved by CMake Tools:
            "program": "${command:cmake.launchTargetPath}",
            "args": "${input:commandLineArgs}",
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [
                {
                    // add the directory where our target was built to the PATHs
                    // it gets resolved by CMake Tools:
                    "name": "PATH",
                    "value": "${env:PATH}:${command:cmake.getLaunchTargetDirectory}"
                },
            ],
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
        }
    ],
    "inputs": [
        {
            "type": "promptString",
            "id": "commandLineArgs",
            "description": "Args to pass to executable",
            "default": ""
        }
    ]
}

This launch.json file currently fails with a parse error:

Unable to start debugging. Error converting value "epex epex" to type 'System.Collections.Generic.List`1[System.String]'. Path 'args', line 1, position 121.
@roblourens
Copy link
Member

Would also like to see this, as I went to clean up the old workaround that we have (an arg of exactly ">" or "<" will not be escaped) but see that C++ hasn't adopted it.

Full context is in microsoft/debug-adapter-protocol#146 and microsoft/vscode#148887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants