Allow null with cursorStyle and bellStyle

This commit is contained in:
Daniel Imms
2017-08-20 10:29:48 -07:00
parent a0d8e3c666
commit eda9443b1a
2 changed files with 12 additions and 2 deletions
+10
View File
@@ -437,6 +437,16 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
throw new Error('No option with key "' + key + '"');
}
switch (key) {
case 'bellStyle':
if (!value) {
value = 'none';
}
break;
case 'cursorStyle':
if (!value) {
value = 'block';
}
break;
case 'tabStopWidth':
if (value < 1) {
console.warn(`tabStopWidth cannot be less than 1, value: ${value}`);
+2 -2
View File
@@ -328,13 +328,13 @@ declare module 'xterm' {
* @param key The option key.
* @param value The option value.
*/
setOption(key: 'bellStyle', value: 'none' | 'visual' | 'sound' | 'both'): void;
setOption(key: 'bellStyle', value: null | 'none' | 'visual' | 'sound' | 'both'): void;
/**
* Sets an option on the terminal.
* @param key The option key.
* @param value The option value.
*/
setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void;
setOption(key: 'cursorStyle', value: null | 'block' | 'underline' | 'bar'): void;
/**
* Sets an option on the terminal.
* @param key The option key.