-
Notifications
You must be signed in to change notification settings - Fork 287
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
[Bug] Code Runner-created terminal is not reused after a terminal in VSCode is closed #1126
Comments
I think the fix should be around here: vscode-code-runner/src/extension.ts Lines 9 to 11 in 97af108
VSCode's API function So perhaps we can just check if the terminal that's closing matches the one recorded in vscode-code-runner/src/codeManager.ts Lines 35 to 37 in 97af108
|
I just installed it and saw a similar effect. If you mess around with the terminals, it will add another one. If you have nothing, then run it via code runner, it keeps using it. I think it is like it remembers the index of the terminal and if it couldn't find it, it will create a new one even though the previously made terminal is somewhere there. It would be nice if it could remember its one and only generated terminal, or use the existing one that is most likely the relevant one to its own. |
Describe the bug
Normally, when I trigger a code run (using the "Run Code" button or the Ctrl+Alt+N shortcut), if the
code-runner.runInTerminal
setting is set totrue
, then Code Runner will create a new terminal window inside the Terminal panel only if there isn't one created by Code Runner yet, and it will reuse the same terminal for future code runs. Reusing existing terminal is a great feature because, without it, I would end up with tons of terminals I don't want.However, if there is already a Code Runner-created terminal and I close an existing one that's not Code Runner-created, then the next time I run code, Code Runner will fail to reuse the existing one and create a new one.
To Reproduce
Steps to reproduce the behavior:
Actual behavior
After any terminal is closed, Code Runner creates a new terminal the next time I run code
Expected behavior
Code Runner should always reuse the terminal it created, if there is one, regardless what other windows I created or closed
Video demo
Observe that the last time I run code, Code Runner creates a new terminal when the one it created before still exists.
demo.mp4
The text was updated successfully, but these errors were encountered: