File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
src/client/common/terminal Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -141,9 +141,9 @@ export class TerminalService implements ITerminalService, Disposable {
141141 }
142142 }
143143 // TODO: Debt switch to Promise<Terminal> ---> breaks 20 tests
144- public async ensureTerminal ( preserveFocus : boolean = true ) : Promise < void > {
144+ public async ensureTerminal ( preserveFocus : boolean = true ) : Promise < Terminal > {
145145 if ( this . terminal ) {
146- return ;
146+ return this . terminal ;
147147 }
148148
149149 if ( useEnvExtension ( ) ) {
@@ -174,7 +174,7 @@ export class TerminalService implements ITerminalService, Disposable {
174174 }
175175
176176 this . sendTelemetry ( ) . ignoreErrors ( ) ;
177- return ;
177+ return this . terminal ;
178178 }
179179 private terminalCloseHandler ( terminal : Terminal ) {
180180 if ( terminal === this . terminal ) {
Original file line number Diff line number Diff line change @@ -56,6 +56,14 @@ export interface ITerminalService extends IDisposable {
5656 sendText ( text : string ) : Promise < void > ;
5757 executeCommand ( commandLine : string , isPythonShell : boolean ) : Promise < TerminalShellExecution | undefined > ;
5858 show ( preserveFocus ?: boolean ) : Promise < void > ;
59+ /**
60+ * Ensures that a terminal exists, creating one if necessary.
61+ *
62+ * @param {boolean } [preserveFocus] Whether the editor should keep focus after the terminal is shown. Defaults to `true`.
63+ * @returns {Promise<Terminal> } The terminal instance.
64+ * @memberof ITerminalService
65+ */
66+ ensureTerminal ( preserveFocus ?: boolean ) : Promise < Terminal > ;
5967}
6068
6169export const ITerminalServiceFactory = Symbol ( 'ITerminalServiceFactory' ) ;
You can’t perform that action at this time.
0 commit comments