-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Allow Python "Run ..." commands to run in different terminals. #15324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@chrissyast, thanks for letting us know about this (and about #488). As you found, currently the Python extension re-uses the terminal it created the first time "Run Python File in Terminal" executed, regardless of the originating file or code, as long as it's using the same Python executable (and under the same workspace folder if using multiple workspace roots). So the behavior is what we intended. That said, I can see how in some cases it can be helpful to open a new terminal window (or to re-use an already open terminal). Part of the problem for the Python extension is that VS Code does not provide any way to interact with the terminal, other than to send text to it. That means the extension cannot tell if the terminal is waiting at a shell prompt or not. One solution would be to open a new terminal every time rather than ever re-using it. We'll look into whether or not that (or some other solution) would be a feasible enhancement for the Python extension. (FYI, the same terminal is re-used for "Run Selection in Python Terminal", which is a problem for "Run Python File in Terminal".) |
We plan to improve the run in terminal experience in the future, I created #15770 to track improvements in this area. So I'm closing it in favour of that. Thanks! |
Environment data
python.languageServer
setting: "Jedi"Example - https://github.com/chrissyast/python_test
foo.py
, click the "Run Python File in Terminal" button.Terminal window opens, runs foo.py
bar.py
Current behaviour
UI reverts back to the terminal from step 1, fails to start
bar.py
Expected behaviour
bar/main.py
is either opened in the active terminal window or a new terminal.Note - not duplicate of #85 because the solution re-uses existing terminal. Also believe #488 was incorrectly marked as a duplicate of 85
The text was updated successfully, but these errors were encountered: