From 0e4ddedb183449624754360c53320c6db96cde1f Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 11 Aug 2021 19:45:58 +0200 Subject: [PATCH] fixes #122775 fixes #128132 --- src/vs/workbench/contrib/debug/browser/debugSession.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/debug/browser/debugSession.ts b/src/vs/workbench/contrib/debug/browser/debugSession.ts index 56e1714953b..8b130dcb54e 100644 --- a/src/vs/workbench/contrib/debug/browser/debugSession.ts +++ b/src/vs/workbench/contrib/debug/browser/debugSession.ts @@ -899,7 +899,12 @@ export class DebugSession implements IDebugSession { const promises = this.model.fetchCallStack(thread); const focus = async () => { if (!event.body.preserveFocusHint && thread.getCallStack().length) { - await this.debugService.focusStackFrame(undefined, thread); + const focusedStackFrame = this.debugService.getViewModel().focusedStackFrame; + if (!focusedStackFrame || focusedStackFrame.thread.session === this) { + // Only take focus if nothing is focused, or if the focus is already on the current session + await this.debugService.focusStackFrame(undefined, thread); + } + if (thread.stoppedDetails) { if (thread.stoppedDetails.reason === 'breakpoint' && this.configurationService.getValue('debug').openDebug === 'openOnDebugBreak' && !this.isSimpleUI) { await this.viewletService.openViewlet(VIEWLET_ID); -- GitLab