diff --git a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts index b5019456f93..f54eed8474e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts @@ -35,8 +35,11 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb ) { this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDebugService); this._toDispose = []; - this._toDispose.push(debugService.onWillNewSession(session => { + this._toDispose.push(debugService.onDidNewSession(session => { this._proxy.$acceptDebugSessionStarted(session.getId(), session.configuration.type, session.getName(false)); + })); + this._toDispose.push(debugService.onWillNewSession(session => { + // Need to start listening early to new session events because a custom event can come while a session is initialising this._toDispose.push(session.onDidCustomEvent(event => { if (event && event.sessionId) { this._proxy.$acceptDebugSessionCustomEvent(event.sessionId, session.configuration.type, session.configuration.name, event);