Skip to content

Allow arguments to single file debugging to be supplied at runtime #19784

Closed as not planned

Description

@rossng

My codebase has various Python scripts that I would like to run inside the VSCode debugger. The easiest way to do that is to add this debug configuration to launch.json:

{
    "name": "Python: Current File",
    "type": "python",
    "request": "launch",
    "program": "${file}",
    "console": "integratedTerminal",
    "justMyCode": true
}

However, there is one critical problem with this - I would like to supply arguments to the scripts I am running. And those arguments are transient - not the same for every single run - so I don't want to write them down in launch.json.

Ideally, I would like to have some option like "promptForArguments": true that causes VSCode to prompt me for the script's arguments each time I start the launch configuration.

(Let me know if this is actually something that needs to be implemented on the VSCode side and I can open an issue there instead.)

some keywords for anyone searching for this issue: single file debugging, parameters, runtime

Activity

  1. rossng commented on Sep 6, 2022

    @rossng
    Author

    Possibly an even better option would be to offer something similar to VSCode's existing JavaScript Debug Terminal for Python.

  2. karthiknadig commented on Sep 6, 2022

    @karthiknadig
    Member

    Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

  3. AntonVucinic commented on Sep 19, 2022

    @AntonVucinic

    This should be a no brainer IMO. Java extension pack already has similar functinoality:

    {
        "type": "java",
        "name": "Launch with Arguments Prompt",
        "request": "launch",
        "mainClass": "",
        "args": "${command:SpecifyProgramArgs}"
    }
    

    This option prompts for arguments before every launch and passes n arguments when input field is left empty.

  4. brettcannon commented on Nov 10, 2022

    @brettcannon
    Member

    Thank you for submitting your feature request and everyone who considered it! Unfortunately, this issue did not receive enough votes over the allotted time, and so we are closing the issue.

  5. locked as resolved and limited conversation to collaborators on Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions