Skip to content

Commit f7fd666

Browse files
committed
Add hideOnLastClosed setting
Fixes microsoft#236517
1 parent 2dc420d commit f7fd666

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

src/vs/platform/terminal/common/terminal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const enum TerminalSettingId {
103103
EnablePersistentSessions = 'terminal.integrated.enablePersistentSessions',
104104
PersistentSessionReviveProcess = 'terminal.integrated.persistentSessionReviveProcess',
105105
HideOnStartup = 'terminal.integrated.hideOnStartup',
106+
HideOnLastClosed = 'terminal.integrated.hideOnLastClosed',
106107
CustomGlyphs = 'terminal.integrated.customGlyphs',
107108
RescaleOverlappingGlyphs = 'terminal.integrated.rescaleOverlappingGlyphs',
108109
PersistentSessionScrollback = 'terminal.integrated.persistentSessionScrollback',

src/vs/workbench/contrib/terminal/browser/terminalService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export class TerminalService extends Disposable implements ITerminalService {
208208
// down. When shutting down the panel is locked in place so that it is restored upon next
209209
// launch.
210210
this._register(this._terminalGroupService.onDidChangeActiveInstance(instance => {
211-
if (!instance && !this._isShuttingDown) {
211+
if (!instance && !this._isShuttingDown && this._terminalConfigService.config.hideOnLastClosed) {
212212
this._terminalGroupService.hidePanel();
213213
}
214214
if (instance?.shellType) {

src/vs/workbench/contrib/terminal/common/terminal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ export interface ITerminalConfiguration {
211211
experimental?: {
212212
windowsUseConptyDll?: boolean;
213213
};
214+
hideOnLastClosed: boolean;
214215
}
215216

216217
export interface ITerminalFont {

src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,11 @@ const terminalConfiguration: IConfigurationNode = {
549549
],
550550
default: 'never'
551551
},
552+
[TerminalSettingId.HideOnLastClosed]: {
553+
description: localize('terminal.integrated.hideOnLastClosed', "Whether to hide the terminal view when the last terminal is closed. This will only happen when the terminal is the only visible view in the view container."),
554+
type: 'boolean',
555+
default: true
556+
},
552557
[TerminalSettingId.CustomGlyphs]: {
553558
markdownDescription: localize('terminal.integrated.customGlyphs', "Whether to draw custom glyphs for block element and box drawing characters instead of using the font, which typically yields better rendering with continuous lines. Note that this doesn't work when {0} is disabled.", `\`#${TerminalSettingId.GpuAcceleration}#\``),
554559
type: 'boolean',

0 commit comments

Comments
 (0)