microsoft / microsoft/vscode-cpptools

Support 'argsCanBeInterpretedByShell' property as part of DAP

Open
#10,654 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

debugger Feature Request
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the C++ extension's handling of the DAP RunInTerminalRequest and launch.json args parsing; the issue does not name specific files or tests. Check how argsCanBeInterpretedByShell is represented and verify that a promptString value such as "epex epex" is accepted and passed to the underlying program without the current parse error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.