Skip to content

Commit

Permalink
Allow null with cursorStyle and bellStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Aug 20, 2017
1 parent a0d8e3c commit eda9443
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down
4 changes: 2 additions & 2 deletions typings/xterm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit eda9443

Please sign in to comment.