diff --git a/src/client/common/terminal/service.ts b/src/client/common/terminal/service.ts index 77961815b18b..05840a908c3c 100644 --- a/src/client/common/terminal/service.ts +++ b/src/client/common/terminal/service.ts @@ -36,17 +36,17 @@ export class TerminalService implements ITerminalService, Disposable { public async sendCommand(command: string, args: string[]): Promise { await this.ensureTerminal(); const text = this.terminalHelper.buildCommandForTerminal(this.terminalShellType, command, args); - this.terminal!.show(); + this.terminal!.show(true); this.terminal!.sendText(text, true); } public async sendText(text: string): Promise { await this.ensureTerminal(); - this.terminal!.show(); + this.terminal!.show(true); this.terminal!.sendText(text); } public async show(): Promise { await this.ensureTerminal(); - this.terminal!.show(); + this.terminal!.show(true); } private async ensureTerminal(): Promise { if (this.terminal) { @@ -70,7 +70,7 @@ export class TerminalService implements ITerminalService, Disposable { } } - this.terminal!.show(); + this.terminal!.show(true); } private terminalCloseHandler(terminal: Terminal) { if (terminal === this.terminal) { diff --git a/src/test/common/terminals/service.test.ts b/src/test/common/terminals/service.test.ts index fe769340faa8..707db8dd2f7d 100644 --- a/src/test/common/terminals/service.test.ts +++ b/src/test/common/terminals/service.test.ts @@ -66,7 +66,7 @@ suite('Terminal Service', () => { // Sending a command will cause the terminal to be created await service.sendCommand('', []); - terminal.verify(t => t.show(), TypeMoq.Times.exactly(2)); + terminal.verify(t => t.show(TypeMoq.It.isValue(true)), TypeMoq.Times.exactly(2)); service.dispose(); terminal.verify(t => t.dispose(), TypeMoq.Times.exactly(1)); }); @@ -84,7 +84,7 @@ suite('Terminal Service', () => { await service.sendCommand(commandToSend, args); - terminal.verify(t => t.show(), TypeMoq.Times.exactly(2)); + terminal.verify(t => t.show(TypeMoq.It.isValue(true)), TypeMoq.Times.exactly(2)); terminal.verify(t => t.sendText(TypeMoq.It.isValue(commandToExpect), TypeMoq.It.isValue(true)), TypeMoq.Times.exactly(1)); }); @@ -98,7 +98,7 @@ suite('Terminal Service', () => { await service.sendText(textToSend); - terminal.verify(t => t.show(), TypeMoq.Times.exactly(2)); + terminal.verify(t => t.show(TypeMoq.It.isValue(true)), TypeMoq.Times.exactly(2)); terminal.verify(t => t.sendText(TypeMoq.It.isValue(textToSend)), TypeMoq.Times.exactly(1)); }); @@ -111,7 +111,7 @@ suite('Terminal Service', () => { await service.show(); - terminal.verify(t => t.show(), TypeMoq.Times.exactly(2)); + terminal.verify(t => t.show(TypeMoq.It.isValue(true)), TypeMoq.Times.exactly(2)); }); test('Ensure terminal is activated once after creation', async () => { @@ -126,7 +126,7 @@ suite('Terminal Service', () => { await service.show(); await service.show(); - terminal.verify(t => t.show(), TypeMoq.Times.exactly(5)); + terminal.verify(t => t.show(TypeMoq.It.isValue(true)), TypeMoq.Times.exactly(5)); terminal.verify(t => t.sendText(TypeMoq.It.isValue('activation Command')), TypeMoq.Times.exactly(1)); }); @@ -143,7 +143,7 @@ suite('Terminal Service', () => { await service.sendText(textToSend); await service.sendText(textToSend); - terminal.verify(t => t.show(), TypeMoq.Times.exactly(5)); + terminal.verify(t => t.show(TypeMoq.It.isValue(true)), TypeMoq.Times.exactly(5)); terminal.verify(t => t.sendText(TypeMoq.It.isValue('activation Command')), TypeMoq.Times.exactly(1)); terminal.verify(t => t.sendText(TypeMoq.It.isValue(textToSend)), TypeMoq.Times.exactly(4)); });