From eda9443b1a48e25af1f7dab011b7d363f12abec9 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 20 Aug 2017 10:29:48 -0700 Subject: [PATCH] Allow null with cursorStyle and bellStyle --- src/Terminal.ts | 10 ++++++++++ typings/xterm.d.ts | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Terminal.ts b/src/Terminal.ts index 879bfbab1c..a17cf94a9f 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -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}`); diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 3172f3b34f..7ccd19435e 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -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.