mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Use shared constant for idle timeout
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user