From b1c6a9783956d8bde3d7214b6dc6c7c156fd0830 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 6 Aug 2017 19:22:15 -0700 Subject: [PATCH 1/2] No longer focus the terminal by default Fixes #646 --- src/Terminal.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Terminal.ts b/src/Terminal.ts index cd44e7fb..493e48bc 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -759,20 +759,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT // Initialize global actions that need to be taken on the document. this.initGlobal(); - /** - * Automatic focus functionality. - * TODO: Default to `false` starting with xterm.js 3.0. - */ - if (typeof focus === 'undefined') { - let message = 'You did not pass the `focus` argument in `Terminal.prototype.open()`.\n'; - - message += 'The `focus` argument now defaults to `true` but starting with xterm.js 3.0 '; - message += 'it will default to `false`.'; - - console.warn(message); - focus = true; - } - if (focus) { this.focus(); } From 9659f29e5015df417be211806a63c23e649bacb1 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 8 Aug 2017 00:59:14 -0700 Subject: [PATCH 2/2] Remove Terminal.open focus param --- src/Terminal.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Terminal.ts b/src/Terminal.ts index 493e48bc..58fde2f9 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -649,9 +649,8 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT * Opens the terminal within an element. * * @param {HTMLElement} parent The element to create the terminal within. - * @param {boolean} focus Focus the terminal, after it gets instantiated in the DOM */ - private open(parent: HTMLElement, focus?: boolean): void { + public open(parent: HTMLElement): void { let i = 0; let div; @@ -759,10 +758,6 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT // Initialize global actions that need to be taken on the document. this.initGlobal(); - if (focus) { - this.focus(); - } - // Listen for mouse events and translate // them into terminal mouse protocols. this.bindMouse();