Vscode will not autofocus on integrated terminal while running code
Question:
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?
Answers:
I think there is no relevant implementation method for code runner at present. You could use shortcut "Ctrl+~"
to foucus on the terminal, and I will submit the function to GitHub.
Two Fixes/Workarounds I utilized.
Autohotkey Script:
F9::
Send {F5}
Sleep 200
SendInput ^{~}
Or Rebind:
View: Toggle Terminal Originally (Ctrl + ~) to F5 so jumps to the terminal everytime you run
The following solution to this issue has been tested on Visual Studio Code 1.74.3.
- Install the Python extension for Visual Studio Code.
- Go to
File
>> Preferences
>> Settings
.
- In the
Search settings
field enter, "Python › Terminal: Focus After Launch"
- Click on,
When launching a python terminal, whether to focus the cursor on the terminal.
- A check mark should appear in the tick box.
Done! Now every time you Run Python File
the terminal will be focused.
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?
I think there is no relevant implementation method for code runner at present. You could use shortcut "Ctrl+~"
to foucus on the terminal, and I will submit the function to GitHub.
Two Fixes/Workarounds I utilized.
Autohotkey Script:
F9::
Send {F5}
Sleep 200
SendInput ^{~}
Or Rebind:
View: Toggle Terminal Originally (Ctrl + ~) to F5 so jumps to the terminal everytime you run
The following solution to this issue has been tested on Visual Studio Code 1.74.3.
- Install the Python extension for Visual Studio Code.
- Go to
File
>>Preferences
>>Settings
. - In the
Search settings
field enter, "Python › Terminal: Focus After Launch" - Click on,
When launching a python terminal, whether to focus the cursor on the terminal.
- A check mark should appear in the tick box.
Done! Now every time you Run Python File
the terminal will be focused.