Skip to content

Commit 29e34b7

Browse files
committed
support supportsRunInTerminalRequest #304
1 parent 630ed73 commit 29e34b7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/client/debugger/Main.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class PythonDebugger extends DebugSession {
4141
private configurationDone: Promise<any>;
4242
private configurationDonePromiseResolve: () => void;
4343
private lastException: IPythonException;
44+
private _supportsRunInTerminalRequest:boolean;
4445
public constructor(debuggerLinesStartAt1: boolean, isServer: boolean) {
4546
super(debuggerLinesStartAt1, isServer === true);
4647
this._variableHandles = new Handles<IDebugVariable>();
@@ -68,7 +69,9 @@ export class PythonDebugger extends DebugSession {
6869
filter: "uncaught"
6970
}
7071
];
71-
72+
if (typeof args.supportsRunInTerminalRequest === 'boolean') {
73+
this._supportsRunInTerminalRequest = args.supportsRunInTerminalRequest;
74+
}
7275
this.sendResponse(response);
7376
// now we are ready to accept breakpoints -> fire the initialized event to give UI a chance to set breakpoints
7477
this.sendEvent(new InitializedEvent());
@@ -142,6 +145,11 @@ export class PythonDebugger extends DebugSession {
142145
if (this.launchArgs && !this.launchArgs.console) {
143146
this.launchArgs.console = this.launchArgs.externalConsole === true ? 'externalTerminal' : 'none';
144147
}
148+
// If launching the integrated terminal is not supported, then defer to external terminal
149+
// that will be displayed by our own code
150+
if (!this._supportsRunInTerminalRequest && this.launchArgs && this.launchArgs.console === 'integratedTerminal'){
151+
this.launchArgs.console = 'externalTerminal';
152+
}
145153
if (this.launchArgs && this.launchArgs.stopOnEntry === true) {
146154
this.sendEvent(new StoppedEvent("entry", pyThread.Id));
147155
}

0 commit comments

Comments
 (0)