Merge pull request #272 from Tyriar/271_setOption

Add setOption API
This commit is contained in:
Daniel Imms
2016-09-16 02:17:28 -07:00
committed by GitHub
2 changed files with 28 additions and 1 deletions
+13
View File
@@ -357,6 +357,19 @@ Terminal.prototype.focus = function() {
return this.textarea.focus();
};
/**
* Sets an option on the terminal.
* @param {string} key The option key.
* @param {string} value The option value.
*/
Terminal.prototype.setOption = function(key, value) {
if (!(key in Terminal.defaults)) {
throw new Error('No option with key "' + key + '"');
}
this[key] = value;
this.options[key] = value;
};
/**
* Binds the desired focus behavior on a given terminal object.
*