From ac683ad110d8d23b019cf55b31936786e3886b46 Mon Sep 17 00:00:00 2001 From: Leonardo Rochael Almeida Date: Thu, 11 Jul 2019 15:32:08 +0200 Subject: [PATCH] Toggle for disabling autofocus on debugger stop Add boolean config to control whether the workbench window should be focused when the debugger stops. Fixes #23117 Co-authored-by: Joao Moreno --- src/vs/workbench/contrib/debug/browser/debug.contribution.ts | 5 +++++ src/vs/workbench/contrib/debug/browser/debugSession.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts index 84afaa1d2f1..de7a22bad75 100644 --- a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts +++ b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts @@ -259,6 +259,11 @@ configurationRegistry.registerConfiguration({ description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces."), default: { configurations: [], compounds: [] }, $ref: launchSchemaId + }, + 'debug.autoFocusEditor': { + type: 'boolean', + description: nls.localize('debug.autoFocusEditor', "Controls whether the workbench window should be focused when the debugger stops."), + default: true } } }); diff --git a/src/vs/workbench/contrib/debug/browser/debugSession.ts b/src/vs/workbench/contrib/debug/browser/debugSession.ts index ca53f26dbf5..2bea76a9b8e 100644 --- a/src/vs/workbench/contrib/debug/browser/debugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/debugSession.ts @@ -676,7 +676,10 @@ export class DebugSession implements IDebugSession { if (this.configurationService.getValue('debug').openDebug === 'openOnDebugBreak') { this.viewletService.openViewlet(VIEWLET_ID); } - this.windowService.focusWindow(); + + if (this.configurationService.getValue('debug.autoFocusEditor')) { + this.windowService.focusWindow(); + } } } }; -- GitLab