Search code examples
pythonvisual-studio-code

VS Code 1.94 - Run selection/line in Python terminal very slow


I've just started using VSCode (moving over from Spyder) and I regularly run lines/selections from my code in the terminal.

When I have a terminal open, shift + enter runs my selection in a new terminal and is incredibly slow.

The below takes about 5 seconds to send

 print(1)

If i copy and paste it in the new terminal, it runs instantly. Why is it slow? I want to continue using shift+enter to run my selection.

Why does it need to open a new terminal anyway? It can run in the existing terminal, where i start with

py

which begins a python interactive session.


Solution

  • As for the delay, according to this post on GitHub, the issue seems to be with the latest version (v2024.16.0) of the Python extension for VS Code. Downgrading it (and restarting the app) seems to do the trick for the time being.