smcs
smcs

Reputation: 2004

How can I force VS Code to run Python processes in a fresh terminal?

In VS Code (VSCodium to be specific), when I click on "Run Python file in terminal" - the little green arrow top right - the same terminal is used for multiple processes. I'd like to run multiple Python processes in parallel. Currently, the only way is to open a new terminal inside VS Code and run the desired file manually by entering its path. Is it possible to reconfigure the "Run" button so that a new terminal will be opened where the current file that's open in the editor gets started?

Upvotes: 2

Views: 1785

Answers (1)

Jill Cheng
Jill Cheng

Reputation: 10344

According to your description, if you want to automatically open multiple new terminals, it is recommended that you set the way of result output: set "console": "externalTerminal", in the "launch.json" file in the ".vscode" folder. After setting, the result of each debugging will be automatically output in a new cmd window.

enter image description here

Update:

For setting the python run button ("Run python file in terminal"), so that the code can be automatically synchronized to run in different terminals. Currently, VSCode does not support this function. The available method is to manually enter the path of the script as you said.

Upvotes: 2

Related Questions