diff --git a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts index eed05336f4061eac192d1f9f0aa6b35dc5b27606..569c6e57d25502d675b713d75c479f9d6136e484 100644 --- a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts +++ b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts @@ -213,10 +213,9 @@ configurationRegistry.registerConfiguration({ }, 'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA, 'debug.console.closeOnEnd': { - enum: ['never', 'always', 'whenOpenedByDebug'], - description: nls.localize('debug.console.closeOnEnd', "Controls what to do with the debug console when the debug session ends."), - enumDescriptions: [nls.localize('neverClose', "Remain it as-is"), nls.localize('alwaysClose', "Close it (if opened)"), nls.localize('closeWhenOpenedByDebug', "Close if the debugging process opened it, see debug.internalConsoleOptions")], - default: 'never' + type: 'boolean', + description: nls.localize('debug.console.closeOnEnd', "Controls if the debug console should be automatically closed when the debug session ends."), + default: false }, 'debug.openDebug': { enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'], diff --git a/src/vs/workbench/contrib/debug/browser/debugService.ts b/src/vs/workbench/contrib/debug/browser/debugService.ts index a7222f4db6598f2206dafa119860aeb86de34c0f..4202fb46cc6fed4a3e53ed2e55ceaac1301c9b5f 100644 --- a/src/vs/workbench/contrib/debug/browser/debugService.ts +++ b/src/vs/workbench/contrib/debug/browser/debugService.ts @@ -74,9 +74,6 @@ export class DebugService implements IDebugService { private initCancellationToken: CancellationTokenSource | undefined; private activity: IDisposable | undefined; - // Enable undefined because that makes the test easier. - private replWasOpened : boolean | undefined = false; - constructor( @IStorageService private readonly storageService: IStorageService, @IEditorService private readonly editorService: IEditorService, @@ -455,8 +452,6 @@ export class DebugService implements IDebugService { await this.launchOrAttachToSession(session); const internalConsoleOptions = session.configuration.internalConsoleOptions || this.configurationService.getValue('debug').internalConsoleOptions; - const activePanel = this.panelService.getActivePanel(); - this.replWasOpened = activePanel && activePanel.getId() === REPL_ID; if (internalConsoleOptions === 'openOnSessionStart' || (this.viewModel.firstSessionStart && internalConsoleOptions === 'openOnFirstSessionStart')) { this.panelService.openPanel(REPL_ID, false); } @@ -568,14 +563,11 @@ export class DebugService implements IDebugService { // Data breakpoints that can not be persisted should be cleared when a session ends const dataBreakpoints = this.model.getDataBreakpoints().filter(dbp => !dbp.canPersist); dataBreakpoints.forEach(dbp => this.model.removeDataBreakpoints(dbp.getId())); - } - const closeConsoleOnEnd = this.configurationService.getValue('debug').console.closeOnEnd; - if (this.panelService.getLastActivePanelId() === REPL_ID && - (closeConsoleOnEnd === 'always' || (closeConsoleOnEnd === 'whenOpenedByDebug' && !this.replWasOpened))) { - this.panelService.hideActivePanel(); + if (this.panelService.getLastActivePanelId() === REPL_ID && this.configurationService.getValue('debug').console.closeOnEnd) { + this.panelService.hideActivePanel(); + } } - })); } diff --git a/src/vs/workbench/contrib/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts index 7f79d65778a2dd751df239bc3f5ecef96d1c38e0..6720b09c23a80d3add7ebddce588d74ba091fa31 100644 --- a/src/vs/workbench/contrib/debug/common/debug.ts +++ b/src/vs/workbench/contrib/debug/common/debug.ts @@ -463,7 +463,7 @@ export interface IDebugConfiguration { fontFamily: string; lineHeight: number; wordWrap: boolean; - closeOnEnd: 'never' | 'always' | 'whenOpenedByDebug'; + closeOnEnd: boolean; }; focusWindowOnBreak: boolean; onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt';