Search code examples
pythonvisual-studio-code

Vscode will not autofocus on integrated terminal while running code


When I run without debugging in python on vscode it no longer autofocuses on the terminal forcing me to click into the terminal everytime to input data. Is there any solution to cause vscode to autofocus when code is running?


Solution

  • The following solution to this issue has been tested on Visual Studio Code 1.74.3.

    1. Install the Python extension for Visual Studio Code.
    2. Go to File >> Preferences >> Settings.
    3. In the Search settings field enter, "Python › Terminal: Focus After Launch"
    4. Click on, When launching a python terminal, whether to focus the cursor on the terminal.
    5. A check mark should appear in the tick box.

    Done! Now every time you Run Python File the terminal will be focused.