-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Missing option for disabling terminal restoration #39137
Comments
The reason the terminal is automatically created is because the panel gets restored, which triggers the terminal being created. @isidorn ever considered the ability to never restore a panel? This request has come before from the Powershell team. |
@Tyriar no. 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.
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? |
@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. |
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! |
@Tyriar could you reopen this please? What kind of "more info" is needed? |
I've tried to fix this in an extension, it didn't work. This is what I've tried:
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? |
If anybody else finds those restored terminals annoying, this is what I'm currently doing for killing them:
"vscode_custom_css.imports": [
"file:///path/to/my/vsc_custom.js"
]
/* CLOSE RESTORED PANEL */
(function () {
function hasEvent ( event ) {
return _performanceEntries.includes ( event );
}
function close () {
const kill = document.querySelector ( '.terminal-action.kill' );
if ( kill ) kill.click ();
const hide = document.querySelector ( '.panel .hide-panel-action' );
if ( hide ) hide.click ();
return !!kill || !!hide;
}
function loop () {
if ( hasEvent ( 'extensionHostReady' ) || close () ) return;
requestAnimationFrame ( loop );
}
loop ();
})(); |
This is bad, the whole point of the unsupported message is to make it obvious that the source has been modified so the team doesn't have to chase down issues that are caused by people manipulating VS Code's source code - several team members wasted a bunch of time in the past on such problems.
In 1.26 you have a |
I understand that, but it's also very annoying to me to read that
I can't fix it with an extension because:
That piece of code I posted kills the terminal almost instantaneously and only if it's a restored terminal. Of course I would rather just set an option in my settings for disabling panel/terminal restoration, but said option doesn't seem like is going to get implemented. |
@fabiospampinato created #56929 to address the annoying part of it |
Let's do a setting to prevent this which your users could enable (your extension could have a notification that helps users). The setting |
Thanks for wanting to fix this. I have a couple of questions:
Regarding the name I see there are already settings like:
|
@isidorn doesn't want that to be a thing for the panel. Plus it makes more sense for this to be a terminal setting as we only want the terminal not to restore, output, problems, etc. should still be restored at normal.
The workbench has always restored the state it was previously in, if you had a terminal open it will be open with a new shell to jump into, it's easy to hide/kill.
I think being explicit is better here, |
The "Debug Console" open at startup is totally useless too, even more so than the terminal.
|
@fabiospampinato the behavior I'm thinking is that a set visible on startup would not create a process and instead hide the panel immediately, allowing extensions to show it again when they activate. |
@codestothestars how do i use this "tasks" config, put it in |
got it, thx |
It's been a while since our last work and the issue's been bumped already.. |
@zm-cttae what do you mean by this? I wouldn't have expected this to cause performance problems. |
It's something to do with PowerShell being open that messes with other games and anything running off GPU 0 (3D) |
AFAIK the terminal does use GPU rendering also |
@zm-cttae that's surprising, are you using a low spec GPU? You can disable GPU rendering by setting |
Is there any workaround for this yet? It's irritating to have the terminal always pop open on restart if I happen to close my editor when I had a Julia REPL still running. I'd be OK with a solution that closes all terminals when I quit VSCode. |
I thought about it and went with hideOnStartup in #189204. The word "restore" might confuse the user with persistent sessions but the main reason for this was that the panel still gets "restored" by the view system, it just hides almost immediately after and doesn't create a terminal. Early feedback on the setting would be awesome. Here's the definition: [TerminalSettingId.HideOnStartup]: {
description: localize('terminal.integrated.hideOnStartup', "Whether to hide the terminal view on startup, avoiding creating a terminal when there are no persistent sessions."),
type: 'string',
enum: ['never', 'whenEmpty', 'always'],
markdownEnumDescriptions: [
localize('hideOnStartup.never', "Never hide the terminal view on startup."),
localize('hideOnStartup.whenEmpty', "Only hide the terminal when there are no persistent sessions restored."),
localize('hideOnStartup.always', "Always hide the terminal, even when there are persistent sessions restored.")
],
default: 'never'
}, |
* Add 1.82 release notes placeholder * Documentation for JSON Schema support needs updating * adding documentation for the work done this iteration * Update 1.82 vscode.d.ts commit ID * Update 1.82 Windows keybindings * news - api, batch range formatting * Update 1.82 vscode.d.ts commit ID for latest comments * Add release notes sections * Update terminal image support enablement * Update 1.82 settings * Update 1.82 macOS keybindings * Update 1.82 Linux keybindings * add port forwarding doc (#6627) * add port forwarding doc * apply suggestions * Add release notes for python terminal experiment * Fix * add accessibility updates * add ty * Update v1_82.md * add copy output mp4 * Release notes * Update default setting value * quick search notes * Dev Containers notes * PRs * Issue trackers * Mention Settings editor remote search * Merge in husky hooks * polish * Update v1_82.md * small edits and formatting * update notes * Compress image * Update v1_82.md * my stuff so far * related info * updating the documentation concerning the setting for json sorting * resetting back the documentation * my input * input * input * Edits to recent updates * More edits * Adding items * Release notes * Stub my sections * Update changelog * Improves diff editor changelog. * diff editor changelog improvements * Put Setings editor in own section * Stub terminal selection * Autoplay videos * added video for sticky scroll improvements * Add prebuild guide info * Update v1_82.md * Terminal notes progress * More terminal notes * add terminal focus section * Remove unfilled release notes sections * Add 1.82 highlights * small edits * move * Add Electron 25 update section * Terminal progress * Copilot explain terminal selection * Dim unfocused * New APIs * Terminal API proposals * Add remote highlights, small edits * Add 1.82 social image * Document hideOnStartup setting (#6647) Part of microsoft/vscode#39137 * Bracketed paste mode update * Document terminal.integrated.cursorStyleInactive * full edit pass * Shrink .gifs, tune highlights length and links * Update Date metadata, link to video Marketplace theme * Fix italics * move to https://github.com/microsoft/vscode-internalbacklog/blob/main/internal-release-notes/engineering-release-notes/v1_82.md * DateApproved --------- Co-authored-by: Martin Aeschlimann <[email protected]> Co-authored-by: Aiday Marlen Kyzy <[email protected]> Co-authored-by: Johannes <[email protected]> Co-authored-by: Daniel Imms <[email protected]> Co-authored-by: Connor Peet <[email protected]> Co-authored-by: Kartik Raj <[email protected]> Co-authored-by: meganrogge <[email protected]> Co-authored-by: Aaron Munger <[email protected]> Co-authored-by: Aaron Munger <[email protected]> Co-authored-by: Joyce Er <[email protected]> Co-authored-by: andreamah <[email protected]> Co-authored-by: Christof Marti <[email protected]> Co-authored-by: Raymond Zhao <[email protected]> Co-authored-by: Courtney Webster <[email protected]> Co-authored-by: Justin Chen <[email protected]> Co-authored-by: Tyler James Leonhardt <[email protected]> Co-authored-by: Benjamin Pasero <[email protected]> Co-authored-by: Matt Bierner <[email protected]> Co-authored-by: Henning Dieterichs <[email protected]> Co-authored-by: Aiday Marlen Kyzy <[email protected]> Co-authored-by: Brigit Murtaugh <[email protected]> Co-authored-by: Robo <[email protected]>
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:
What about a
terminal.restoreTerminal: boolean
option for disabling this?The text was updated successfully, but these errors were encountered: