提交 3a3d0fbc 编写于 作者: D Daniel Imms

Have terminalFocus also work on textarea focus

Part of #9704
上级 ff5d168a
......@@ -109,7 +109,12 @@ export class TerminalInstance {
});
xtermHelper.insertBefore(focusTrap, this.xterm.textarea);
this.toDispose.push(DOM.addDisposableListener(this.xterm.textarea, 'focus', (event: KeyboardEvent) => {
self.terminalFocusContextKey.set(true);
}));
this.toDispose.push(DOM.addDisposableListener(this.xterm.textarea, 'blur', (event: KeyboardEvent) => {
self.terminalFocusContextKey.reset();
}));
this.toDispose.push(DOM.addDisposableListener(this.xterm.element, 'focus', (event: KeyboardEvent) => {
self.terminalFocusContextKey.set(true);
}));
......
......@@ -156,7 +156,6 @@ export class TerminalPanel extends Panel {
}
});
}
event.stopImmediatePropagation();
}));
this.toDispose.push(DOM.addDisposableListener(this.parentDomElement, 'mouseup', (event) => {
if (this.terminalInstances.length === 0) {
......@@ -209,7 +208,17 @@ export class TerminalPanel extends Panel {
private createTerminal(terminalProcess: ITerminalProcess, terminalFocusContextKey: IKeybindingContextKey<boolean>): TPromise<TerminalInstance> {
return new TPromise<TerminalInstance>(resolve => {
var terminalInstance = new TerminalInstance(terminalProcess, this.terminalContainer, this.contextMenuService, this.contextService, this.instantiationService, this.keybindingService, this.terminalService, this.messageService, terminalFocusContextKey, this.onTerminalInstanceExit.bind(this));
var terminalInstance = new TerminalInstance(
terminalProcess,
this.terminalContainer,
this.contextMenuService,
this.contextService,
this.instantiationService,
this.keybindingService,
this.terminalService,
this.messageService,
terminalFocusContextKey,
this.onTerminalInstanceExit.bind(this));
this.terminalInstances.push(terminalInstance);
this.setActiveTerminal(this.terminalInstances.length - 1);
this.toDispose.push(this.themeService.onDidThemeChange(this.updateTheme.bind(this)));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册