You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing option for disabling terminal restoration #39137
Whenever I open a project, chances are that a terminal will automatically open because the previous time I opened that project, its window had 1 or more terminals. This doesn't work for me:
This "feature" is unpredictable. I may open a project 1 week or month later, who remembers if that window had a terminal?
It's useless. If I want a terminal I'm a shortcut away from it. If I don't need it however, I have to focus to it and close it.
I use my Terminals extension for managing terminals, I absolutely never need an empty terminal automatically open at startup.
What about a terminal.restoreTerminal: boolean option for disabling this?
Reacted by Thomas Huss, mugx-fc, Simon, Frog Business, Adam Gausmann, Nato Boram, Patrick Kerschbaum, codestothestars, Neo, Archvile and 8 more
Daniel Imms (@Tyriar) no. We always restore all our ux as it was in a previous session.
I do not see why the panel is a sepcial case when compared to the sidebar, activity bar, editor state and so on.
We always restore all our ux as it was in a previous session.
I don't think so.
You don't restore: the activity bar (global, non session-specific), status bar (global, non session specific), active activity bar section (it's always "explorer"), the "replace" input field always starts hidden (#30250) and probably other things as well.
I do not see why the panel is a sepcial case when compared to the sidebar, activity bar, editor state and so on.
The editor state and sidebar are useful, so it may be the activity bar for some people, but what use does it have a "debug" panel automatically open at startup? Or an empty terminal that automatically opens because when 2 months ago I closed that window it had a terminal visible?
Isidor Nikolic (@isidorn) the special case is to avoid creating terminal sessions when the terminal panel is restored as some extensions want to prevent the initial terminal being created.
Allowing an empty terminal is another way to workaround the same issue, it's a pretty big change in thinking though.
Maybe there's another extension that opens a terminal at startup, we shouldn't just kill it.
There's a noticeable delay between the restored terminal opening and then closing. Maybe I could uninstall all my other extensions, or maybe I could rename my extension to "000", or something, ensuring that it's activate function will be called as soon as possible, but this is not really a solution.
Killing all terminals upon shutdown, so that none will be restored the next time that window gets opened
It would actually produce the desired effect only after the second opening of that window, unless that's a completely new window.
I couldn't find a way to hook into the "shutdown" event, there's the deactivate function, but I believe that gets triggered after the actual window is closed, so there's no terminal to kill anymore. Even if there was a way of doing this there's no way of knowing how many terminals are open, if any (Allow extensions to access all terminals via API #13267).
Injecting custom JS with this ensuring that the workbench.action.terminal.kill gets executed as soon as possible
I couldn't find a way to do it, is VSC actually exporting something to the global namespace that I can use to execute commands?
This is a bit annoying to me, and I couldn't find a way of fixing it without patching VSC itself.
Is there any update on this? Maybe an option for this could be added as part of #44302?
Activity
Tyriar commentedon Dec 11, 2017
The reason the terminal is automatically created is because the panel gets restored, which triggers the terminal being created.
Isidor Nikolic (@isidorn) ever considered the ability to never restore a panel? This request has come before from the Powershell team.
isidorn commentedon Dec 12, 2017
Daniel Imms (@Tyriar) no. We always restore all our ux as it was in a previous session.
I do not see why the panel is a sepcial case when compared to the sidebar, activity bar, editor state and so on.
fabiospampinato commentedon Dec 12, 2017
I don't think so.
You don't restore: the activity bar (global, non session-specific), status bar (global, non session specific), active activity bar section (it's always "explorer"), the "replace" input field always starts hidden (#30250) and probably other things as well.
The editor state and sidebar are useful, so it may be the activity bar for some people, but what use does it have a "debug" panel automatically open at startup? Or an empty terminal that automatically opens because when 2 months ago I closed that window it had a terminal visible?
Tyriar commentedon Dec 12, 2017
Isidor Nikolic (@isidorn) the special case is to avoid creating terminal sessions when the terminal panel is restored as some extensions want to prevent the initial terminal being created.
Allowing an empty terminal is another way to workaround the same issue, it's a pretty big change in thinking though.
vscodebot commentedon Dec 19, 2017
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!
fabiospampinato commentedon Dec 19, 2017
Daniel Imms (@Tyriar) could you reopen this please? What kind of "more info" is needed?
fabiospampinato commentedon Mar 14, 2018
I've tried to fix this in an extension, it didn't work. This is what I've tried:
vscode.commands.executeCommand ( 'workbench.action.terminal.kill' );inside theactivatefunction.activatefunction will be called as soon as possible, but this is not really a solution.deactivatefunction, but I believe that gets triggered after the actual window is closed, so there's no terminal to kill anymore. Even if there was a way of doing this there's no way of knowing how many terminals are open, if any (Allow extensions to access all terminals via API #13267).workbench.action.terminal.killgets executed as soon as possibleThis is a bit annoying to me, and I couldn't find a way of fixing it without patching VSC itself.
Is there any update on this? Maybe an option for this could be added as part of #44302?
fabiospampinato commentedon Aug 19, 2018
If anybody else finds those restored terminals annoying, this is what I'm currently doing for killing them:
[Unsupported]thing from the titlebar./path/to/my/vsc_custom.jsfile:41 remaining items
Document hideOnStartup setting
Document hideOnStartup setting (#6647)
Merge vnext to main for the 1.82 release (#6650)