Add setOption API

Fixes #271
This commit is contained in:
Daniel Imms
2016-09-16 01:46:02 -07:00
parent ecfa44b0e8
commit ab5cc0ad05
2 changed files with 26 additions and 1 deletions
+11
View File
@@ -357,6 +357,17 @@ Terminal.prototype.focus = function() {
return this.textarea.focus();
};
/**
* Sets an option on the terminal.
*/
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.
*