Skip to content

Commit 50e91ea

Browse files
committed
Reuse integrated terminal when running debug target
fixes microsoft#10940
1 parent e5dca5a commit 50e91ea

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/vs/workbench/parts/debug/electron-browser/debugService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import {IStorageService, StorageScope} from 'vs/platform/storage/common/storage'
3434
import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService';
3535
import wbeditorcommon = require('vs/workbench/common/editor');
3636
import debug = require('vs/workbench/parts/debug/common/debug');
37-
import session = require('vs/workbench/parts/debug/electron-browser/rawDebugSession');
37+
import {RawDebugSession} from 'vs/workbench/parts/debug/electron-browser/rawDebugSession';
3838
import model = require('vs/workbench/parts/debug/common/debugModel');
3939
import {DebugStringEditorInput} from 'vs/workbench/parts/debug/browser/debugEditorInputs';
4040
import viewmodel = require('vs/workbench/parts/debug/common/debugViewModel');
@@ -67,7 +67,7 @@ export class DebugService implements debug.IDebugService {
6767

6868
private _state: debug.State;
6969
private _onDidChangeState: Emitter<debug.State>;
70-
private session: session.RawDebugSession;
70+
private session: RawDebugSession;
7171
private model: model.Model;
7272
private viewModel: viewmodel.ViewModel;
7373
private configurationManager: ConfigurationManager;
@@ -621,7 +621,7 @@ export class DebugService implements debug.IDebugService {
621621
this.customTelemetryService = new TelemetryService({ appender }, this.configurationService);
622622
}
623623

624-
this.session = this.instantiationService.createInstance(session.RawDebugSession, configuration.debugServer, this.configurationManager.adapter, this.customTelemetryService);
624+
this.session = this.instantiationService.createInstance(RawDebugSession, configuration.debugServer, this.configurationManager.adapter, this.customTelemetryService);
625625
this.registerSessionListeners();
626626

627627
return this.session.initialize({

src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
5353
private stopServerPending: boolean;
5454
private sentPromises: TPromise<DebugProtocol.Response>[];
5555
private capabilities: DebugProtocol.Capabilities;
56+
private static terminalId: number;
5657

5758
private _onDidInitialize: Emitter<DebugProtocol.InitializedEvent>;
5859
private _onDidStop: Emitter<DebugProtocol.StoppedEvent>;
@@ -364,7 +365,8 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
364365
}
365366

366367
protected runInTerminal(args: DebugProtocol.RunInTerminalRequestArguments): TPromise<void> {
367-
return this.terminalService.createNew(args.title || nls.localize('debuggee', "debuggee")).then(id => {
368+
return (!RawDebugSession.terminalId ? this.terminalService.createNew(args.title || nls.localize('debuggee', "debuggee")) : TPromise.as(RawDebugSession.terminalId)).then(id => {
369+
RawDebugSession.terminalId = id;
368370
return this.terminalService.show(false).then(terminalPanel => {
369371
this.terminalService.setActiveTerminalById(id);
370372
const command = this.prepareCommand(args);

0 commit comments

Comments
 (0)