40

I am using vscode for python development. I sometimes use debug running mode, and vscode always stop at first line even if there are no breakpoints. I attached a screenshot of this phenomenon. It's a little annoying and I want to skip this. Are there any ways to skip this?

My Env

  • Code Runner 0.6.5
  • MagicPython 1.0.3
  • Python 0.5.5
  • Python for VSCode

enter image description here

jef
  • 3,890
  • 10
  • 42
  • 76
  • 2
    Take look to that post **["vscode python debuging stop on first import and when exceptions exist even if not breackpoint"](https://github.com/DonJayamanne/pythonVSCode/issues/519)** where you will have details on how to change settings. – J. Piquard Dec 31 '16 at 11:08
  • Thank you! I can do it by fixing stopEntry to false in launch.json. – jef Dec 31 '16 at 12:48

3 Answers3

55

The launch.json file has the setting "stopOnEntry":true. Change this to false to prevent this.

The docs for this can be found https://code.visualstudio.com/docs/python/debugging#_stoponentry

dalyIsaac
  • 702
  • 8
  • 17
  • 4
    Is there a way I can set it to be false on default? I hate having to reset this on every new configuration I run – Tadaboody Dec 07 '17 at 00:51
  • 1
    What I do is use the `Ctrl` + `H` keyboard shortcut to replace all the `"stopOnEntry": true` entries with `"stopOnEntry": false`. I don't think there is a way to set it by default. – dalyIsaac Dec 07 '17 at 03:04
  • somehow this only works on start but not on restart (when "restart": true) – Andrej K Jul 07 '20 at 05:58
  • 1
    Thanks. Why on earth would people want StopOnEntry to be enabled by default? – Matthew Lock Feb 13 '22 at 08:40
2

There are many of them make sure to make all of them false (Stop on Entry)

gfdgdf
  • 21
  • 1
0

For my embedded project it was "runToMain": false

ohthepain
  • 2,004
  • 3
  • 19
  • 30