提交 57c890cd 编写于 作者: D Daniel Imms 提交者: GitHub

Merge pull request #11419 from Microsoft/11325_fix_terminal_show_focus

Fix Terminal.show preserveFocus parameter
......@@ -26,6 +26,10 @@ export class MainThreadTerminalService extends MainThreadTerminalServiceShape {
public $show(terminalId: number, preserveFocus: boolean): void {
this._terminalService.show(!preserveFocus).then((terminalPanel) => {
this._terminalService.setActiveTerminalById(terminalId);
if (!preserveFocus) {
// If the panel was already showing an explicit focus call is necessary here.
terminalPanel.focus();
}
});
}
......
......@@ -87,5 +87,6 @@ export interface ITerminalService {
export interface ITerminalPanel {
closeTerminalById(terminalId: number): TPromise<void>;
focus(): void;
sendTextToActiveTerminal(text: string, addNewLine: boolean): void;
}
......@@ -69,7 +69,6 @@ export class TerminalService implements ITerminalService {
return this.show(false).then((terminalPanel) => {
this.activeTerminalIndex = index;
terminalPanel.setActiveTerminal(this.activeTerminalIndex);
terminalPanel.focus();
this._onActiveInstanceChanged.fire();
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册