Merge pull request #858 from Tyriar/646_deprecated_focus

No longer focus the terminal by default
This commit is contained in:
Daniel Imms
2017-08-08 01:05:42 -07:00
committed by GitHub
+1 -20
View File
@@ -654,9 +654,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;
@@ -764,24 +763,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();
}
// Listen for mouse events and translate
// them into terminal mouse protocols.
this.bindMouse();