4

I have an url in a test.txt file, and i want to use it in launch.json. I try many things without success, like setting a var in a task but it is impossible to use it in launch.json according what I've read (is it exact ?).

Exemple of code in launch.json I've tested, doesn't work (I am on macOS), I get the error "command shell not found" in VSCode when I launch the debugger (F5):

 {

"inputs": [
    {
        "id": "DEBUG_URI",
        "type": "command",
        "command": "shell",
        ///"command": "cat test.txt",
        "args": {
            "command": "cat test.txt"
        }
    }
],

"version": "0.2.0",
"configurations": [
    {

        "name": "attach",
        "request": "attach",
        "type": "dart",
        "preLaunchTask": "test.txt generator",           
        "observatoryUri": "${input:DEBUG_URI}" 
    }

]}

I've also tested "shellCommand.execute" (exemple here) instead of "shell" but it doesn't work...

thanks,

1 Answer 1

2

the "shellCommand.execute" comes from Tasks Shell Input extension, with this it works !! :

 "inputs": [
        {
            "id": "DEBUG_URI",
            "type": "command",
            "command": "shellCommand.execute",
                "args": {
                "command": "cat test.txt",
                "useFirstResult": "true",
            }
        }
    ],
"version": "0.2.0",
"configurations": [
    {

        "name": "attach",
        "request": "attach",
        "type": "dart",
        "preLaunchTask": "test.txt generator",           
        "observatoryUri": "${input:DEBUG_URI}" 
    }

]}

with "useFirstResult": "true" you can avoid VSCode prompt

Sign up to request clarification or add additional context in comments.

1 Comment

This extension is necessary to make this work i think marketplace.visualstudio.com/… (Tried on WSL2 )

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.