Implement term.getOption
This commit is contained in:
@@ -357,6 +357,22 @@ Terminal.prototype.focus = function() {
|
||||
return this.textarea.focus();
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves an option's value from the terminal.
|
||||
* @param {string} key The option key.
|
||||
*/
|
||||
Terminal.prototype.getOption = function(key, value) {
|
||||
if (!(key in Terminal.defaults)) {
|
||||
throw new Error('No option with key "' + key + '"');
|
||||
}
|
||||
|
||||
if (typeof this.options[key] != 'undefined') {
|
||||
return this.options[key];
|
||||
}
|
||||
|
||||
return this[key];
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets an option on the terminal.
|
||||
* @param {string} key The option key.
|
||||
|
||||
Reference in New Issue
Block a user