提交 8e3fb3d7 编写于 作者: D Daniel Imms

Implement terminal focus

上级 983cf3b9
......@@ -124,7 +124,7 @@ export interface ITerminalInstance {
dispose(): void;
copySelection(): void;
focus(): void;
focus(force?: boolean): void;
paste(): void;
sendText(text: string, addNewLine: boolean): void;
scrollDown(): void;
......
......@@ -167,8 +167,15 @@ export class TerminalInstance implements ITerminalInstance {
this.onExitCallback(this);
}
public focus(): void {
// TODO: Implement
// TODO: Document, the purpose of force is not clear
public focus(force?: boolean): void {
if (!this.xterm) {
return;
}
let text = window.getSelection().toString();
if (!text || force) {
this.xterm.focus();
}
}
public paste(): void {
......
......@@ -150,7 +150,7 @@ export class TerminalService implements ITerminalService {
});
} else {
if (focus) {
panel.focus();
this.getActiveInstance().focus(true);
}
complete(void 0);
//complete(<TerminalPanel>panel);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册