microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.33k stars 1.19k forks source link

Re-use terminal after re-starting VS Code #23529

Open Alconion opened 5 months ago

Alconion commented 5 months ago
Screenshot 2024-05-26 at 11 15 50 AM

I ran a Python code in VS Code and everything worked fine, but after closing VS Code and reopening it, running the same program that I ran last time before closing the application creates a new terminal. Even if I close the new terminal and run the program again, it creates another new terminal. How can I stop this?

I have asked on reddit and stack flow and i got no answers. Please help.

karthiknadig commented 4 months ago

Python extension does not have the state of the terminal saved to ensure it is activated. This is an API that is missing in VS Code. We need a way to know the state of the terminal so we can send the commands to the same terminal, after VS Code is closed and reopened.

/cc @Tyriar This is one of those cases where having the ID on the terminal object might help with.