0

Moving to using VSCode under CentOS 7.

With the following tasks.json under ${workspaceFolder}/.vscode:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Test task",
            "type": "shell",
            "command": "echo ${input.param}",
            "problemMatcher": []
        }
    ],
    "inputs": [
        {
            "id": "param",
            "description": "Type some text",
            "type": "promptString",
            "default": "Hello world!"
        }
    ]
}

It is possible to launch the "Test task" by selecting "Terminal -> Run Task" in the menu bar.

The task starts but the "param" input prompt does not show up. The terminal output is then:

 *  Executing task: echo ${input.libraryName} 

/bin/bash: ${input.libraryName}: bad substitution

 *  The terminal process "/bin/bash '-c', 'echo ${input.libraryName}'" failed to launch (exit code: 1). 
 *  Terminal will be reused by tasks, press any key to close it. 

Output from VSCode Help->About:

Version: 1.83.1
Commit: f1b07bd25dfad64b0167beb15359ae573aecd2cc
Date: 2023-10-10T23:45:31.402Z
Electron: 25.8.4
ElectronBuildId: 24154031
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 3.10.0-1160.45.1.el7.x86_64
3
  • the syntax is ${input:name} and name must be found in the inputs array
    – rioV8
    Commented Apr 5 at 15:01
  • have you tried the examples on the variables doc page
    – rioV8
    Commented Apr 5 at 15:03
  • Thanks a thousands @rioV8! Had missed the colon sign 🙄. It works perfectly fine with this correction.
    – FrncsJRC
    Commented Apr 5 at 16:00

1 Answer 1

0

Thanks to @rioV8's prompt suggestion, the working solution is:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Test task",
            "type": "shell",
            "command": "echo ${input:param}",
            "problemMatcher": []
        }
    ],
    "inputs": [
        {
            "id": "param",
            "description": "Type some text",
            "type": "promptString",
            "default": "Hello world!"
        }
    ]
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.