2 Disable automatic terminal creation in VS Code
3 Goal
The goal is simple: your commands should always run in the terminal that is already open.
4 Disable Automatic Terminal Creation in VS Code
VS Code may create extra terminals the first time you click the a code cell in a working session. Disable these triggers so you can control which terminal your commands run in.
4.1 Open your settings JSON
Use Ctrl+Shift+P and run:
Preferences: Open User Settings (JSON)
Then add (or merge) the following keys:
{
"terminal.integrated.hideOnStartup": "always",
"terminal.integrated.enablePersistentSessions": false,
"terminal.integrated.persistentSessionReviveProcess": "never",
"python.terminal.activateEnvironment": false,
"debug.internalConsoleOptions": "neverOpen"
}With these settings, VS Code is less likely to open new terminals by itself. You can still open new terminals by clicking Terminal> New Terminal on the menu.