diff --git a/addons/addon-webgl/src/CursorBlinkStateManager.ts b/addons/addon-webgl/src/CursorBlinkStateManager.ts index 1346cbc3..615fc200 100644 --- a/addons/addon-webgl/src/CursorBlinkStateManager.ts +++ b/addons/addon-webgl/src/CursorBlinkStateManager.ts @@ -3,6 +3,7 @@ * @license MIT */ +import { RendererConstants } from 'browser/renderer/shared/Constants'; import { ICoreBrowserService } from 'browser/services/Services'; const enum Constants { @@ -10,11 +11,6 @@ const enum Constants { * The time between cursor blinks. */ BLINK_INTERVAL = 600, - - /** - * The idle time after which cursor blinking stops. - */ - IDLE_TIMEOUT = 5 * 60 * 1000 } export class CursorBlinkStateManager { @@ -178,7 +174,7 @@ export class CursorBlinkStateManager { } this._idleTimeout = this._coreBrowserService.window.setTimeout(() => { this._stopBlinkingDueToIdle(); - }, Constants.IDLE_TIMEOUT); + }, RendererConstants.CURSOR_BLINK_IDLE_TIMEOUT); } /** diff --git a/src/browser/renderer/dom/DomRenderer.ts b/src/browser/renderer/dom/DomRenderer.ts index 58e2d873..b1c136f2 100644 --- a/src/browser/renderer/dom/DomRenderer.ts +++ b/src/browser/renderer/dom/DomRenderer.ts @@ -5,7 +5,7 @@ import { DomRendererRowFactory, RowCss } from 'browser/renderer/dom/DomRendererRowFactory'; import { WidthCache } from 'browser/renderer/dom/WidthCache'; -import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/shared/Constants'; +import { INVERTED_DEFAULT_COLOR, RendererConstants } from 'browser/renderer/shared/Constants'; import { createRenderDimensions } from 'browser/renderer/shared/RendererUtils'; import { createSelectionRenderModel } from 'browser/renderer/shared/SelectionRenderModel'; import { IRenderDimensions, IRenderer, IRequestRedrawEvent, ISelectionRenderModel } from 'browser/renderer/shared/Types'; @@ -26,13 +26,6 @@ const FOCUS_CLASS = 'xterm-focus'; const SELECTION_CLASS = 'xterm-selection'; const CURSOR_BLINK_IDLE_CLASS = 'xterm-cursor-blink-idle'; -const enum Constants { - /** - * The idle time after which cursor blinking stops. - */ - IDLE_TIMEOUT = 5 * 60 * 1000 -} - let nextTerminalId = 1; /** @@ -602,7 +595,7 @@ class CursorBlinkStateManager { this._clearIdleTimer(); this._idleTimeout = this._coreBrowserService.window.setTimeout(() => { this._stopBlinkingDueToIdle(); - }, Constants.IDLE_TIMEOUT); + }, RendererConstants.CURSOR_BLINK_IDLE_TIMEOUT); } private _clearIdleTimer(): void { diff --git a/src/browser/renderer/shared/Constants.ts b/src/browser/renderer/shared/Constants.ts index 4bc4f985..32d44bf1 100644 --- a/src/browser/renderer/shared/Constants.ts +++ b/src/browser/renderer/shared/Constants.ts @@ -4,3 +4,10 @@ */ export const INVERTED_DEFAULT_COLOR = 257; + +export const enum RendererConstants { + /** + * The idle time after which cursor blinking stops. + */ + CURSOR_BLINK_IDLE_TIMEOUT = 5 * 60 * 1000 +} \ No newline at end of file