2

I have the "Launch Chrome against local host" option in my debugger list in VS Code. Definitely don't remember how I got it, but, I use it, and it's great. But every time I start it, it opens up the launch.json for setup, with the url set to localhost:8080.

These days I'm using it with React, so I always have to change it to localhost:3000.

I see that the launch file is located in a .vscode folder but that appears to be created anew in each project once I start the debugger?

Where do I set the "default" configuration(s) for the Chrome debugger setup so it always loads the same? I'm on a Mac, if that helps.

Jonathan Tuzman
  • 11,568
  • 18
  • 69
  • 129

3 Answers3

2

According to the official documentation you can add in the settings.json (the global one) a launch argument with default configurations/compounds that you can run from all of your projects.

see https://vscode.readthedocs.io/en/latest/getstarted/settings/

For example

    "launch": {
        "configurations": [
           {
            "name": "Python: DEFAULT Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "autoReload": {"enable": true},
            "justMyCode": false
          }
        ],
    "compounds": []
    }

This will add a Python: DEFAULT Current File configuration to all of your projects.

I've tried setting a specific option (and not a configuration) and it didn't work, but I think setting a global configuration is a good solution for your problem

Dvir Itzko
  • 404
  • 4
  • 17
  • Does it work for task.json as well? – fytao Dec 12 '22 at 02:49
  • the link is now broken. The official docs can be found at [https://code.visualstudio.com/docs/getstarted/settings](https://code.visualstudio.com/docs/getstarted/settings) – Falconius Jan 10 '23 at 21:57
0

The simplest way to go about this is to simply locate your file folder and delete the launch.js file or delete the .vscode folder. This should return your launcher settings to default.

S.B
  • 13,077
  • 10
  • 22
  • 49
-2

Jonathan Tuzman for setting up a terminal you can refer to the following doc or additionally you can edit the settings.json file and adding the following command:

"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"

The simplest way to reset VS Code back to the default settings is to clear your user settings.json file contents which is found in Settings editor. You can navigate to Settings editor by File > Preferences > Settings and clicking on Edit in settings.json. For more information on this topic please refer to this document

manish pamnani
  • 139
  • 2
  • 11
  • 2
    Thanks for your interest, but I am not trying to set up a terminal, nor am I trying to reset a default, but rather trying to set a default. I have looked through the settings.json file but couldn't find anything that seemed relevant. Also I'm on a Mac. – Jonathan Tuzman Mar 15 '19 at 12:31