Implement terminal focus
This commit is contained in:
parent
983cf3b921
commit
8e3fb3d78a
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue