@xterm/xterm 6.1.0-beta.265 → 6.1.0-beta.267
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/xterm.js +1 -1
- package/lib/xterm.js.map +1 -1
- package/lib/xterm.mjs +4 -4
- package/lib/xterm.mjs.map +2 -2
- package/package.json +2 -2
- package/src/browser/CoreBrowserTerminal.ts +1 -1
- package/src/browser/RenderDebouncer.ts +3 -5
- package/src/browser/TimeBasedDebouncer.ts +9 -2
- package/src/browser/input/Mouse.ts +0 -4
- package/src/browser/input/MoveToCell.ts +1 -1
- package/src/browser/renderer/dom/DomRenderer.ts +1 -1
- package/src/common/Version.ts +1 -1
- package/src/common/parser/EscapeSequenceParser.ts +1 -1
- package/src/common/parser/Params.ts +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/xterm",
|
|
3
3
|
"description": "Full xterm terminal, in your browser",
|
|
4
|
-
"version": "6.1.0-beta.
|
|
4
|
+
"version": "6.1.0-beta.267",
|
|
5
5
|
"main": "lib/xterm.js",
|
|
6
6
|
"module": "lib/xterm.mjs",
|
|
7
7
|
"style": "css/xterm.css",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"ws": "^8.20.0",
|
|
117
117
|
"xterm-benchmark": "^0.3.2"
|
|
118
118
|
},
|
|
119
|
-
"commit": "
|
|
119
|
+
"commit": "a374c6c5af995d09f1387780064725ed7b202e43"
|
|
120
120
|
}
|
|
@@ -505,7 +505,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
|
|
|
505
505
|
this.textarea,
|
|
506
506
|
parent.ownerDocument.defaultView ?? window,
|
|
507
507
|
// Force unsafe null in node.js environment for tests
|
|
508
|
-
this._document ?? (typeof window !== 'undefined') ? window.document : null as any
|
|
508
|
+
this._document ?? ((typeof window !== 'undefined') ? window.document : null as any)
|
|
509
509
|
));
|
|
510
510
|
this._instantiationService.setService(ICoreBrowserService, this._coreBrowserService);
|
|
511
511
|
|
|
@@ -23,7 +23,7 @@ export class RenderDebouncer implements IRenderDebouncerWithCallback {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
public dispose(): void {
|
|
26
|
-
if (this._animationFrame) {
|
|
26
|
+
if (this._animationFrame !== undefined) {
|
|
27
27
|
this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame);
|
|
28
28
|
this._animationFrame = undefined;
|
|
29
29
|
}
|
|
@@ -31,9 +31,7 @@ export class RenderDebouncer implements IRenderDebouncerWithCallback {
|
|
|
31
31
|
|
|
32
32
|
public addRefreshCallback(callback: FrameRequestCallback): number {
|
|
33
33
|
this._refreshCallbacks.push(callback);
|
|
34
|
-
|
|
35
|
-
this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh());
|
|
36
|
-
}
|
|
34
|
+
this._animationFrame ??= this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh());
|
|
37
35
|
return this._animationFrame;
|
|
38
36
|
}
|
|
39
37
|
|
|
@@ -46,7 +44,7 @@ export class RenderDebouncer implements IRenderDebouncerWithCallback {
|
|
|
46
44
|
this._rowStart = this._rowStart !== undefined ? Math.min(this._rowStart, rowStart) : rowStart;
|
|
47
45
|
this._rowEnd = this._rowEnd !== undefined ? Math.max(this._rowEnd, rowEnd) : rowEnd;
|
|
48
46
|
|
|
49
|
-
if (this._animationFrame) {
|
|
47
|
+
if (this._animationFrame !== undefined) {
|
|
50
48
|
return;
|
|
51
49
|
}
|
|
52
50
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* @license MIT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const RENDER_DEBOUNCE_THRESHOLD_MS = 1000; // 1 Second
|
|
7
|
-
|
|
8
6
|
import { IRenderDebouncer } from './Types';
|
|
9
7
|
|
|
8
|
+
const RENDER_DEBOUNCE_THRESHOLD_MS = 1000; // 1 Second
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Debounces calls to update screen readers to update at most once configurable interval of time.
|
|
12
12
|
*/
|
|
@@ -31,7 +31,9 @@ export class TimeBasedDebouncer implements IRenderDebouncer {
|
|
|
31
31
|
public dispose(): void {
|
|
32
32
|
if (this._refreshTimeoutID) {
|
|
33
33
|
clearTimeout(this._refreshTimeoutID);
|
|
34
|
+
this._refreshTimeoutID = undefined;
|
|
34
35
|
}
|
|
36
|
+
this._additionalRefreshRequested = false;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {
|
|
@@ -48,6 +50,11 @@ export class TimeBasedDebouncer implements IRenderDebouncer {
|
|
|
48
50
|
const refreshRequestTime: number = performance.now();
|
|
49
51
|
if (refreshRequestTime - this._lastRefreshMs >= this._debounceThresholdMS) {
|
|
50
52
|
// Enough time has elapsed since the last refresh; refresh immediately
|
|
53
|
+
if (this._refreshTimeoutID !== undefined) {
|
|
54
|
+
clearTimeout(this._refreshTimeoutID);
|
|
55
|
+
this._refreshTimeoutID = undefined;
|
|
56
|
+
this._additionalRefreshRequested = false;
|
|
57
|
+
}
|
|
51
58
|
this._lastRefreshMs = refreshRequestTime;
|
|
52
59
|
this._innerRefresh();
|
|
53
60
|
} else if (!this._additionalRefreshRequested) {
|
|
@@ -37,10 +37,6 @@ export function getCoords(window: Pick<Window, 'getComputedStyle'>, event: Pick<
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const coords = getCoordsRelativeToElement(window, event, element);
|
|
40
|
-
if (!coords) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
40
|
coords[0] = Math.ceil((coords[0] + (isSelection ? cssCellWidth / 2 : 0)) / cssCellWidth);
|
|
45
41
|
coords[1] = Math.ceil(coords[1] / cssCellHeight);
|
|
46
42
|
|
|
@@ -156,7 +156,7 @@ function wrappedRowsForRow(currentRow: number, bufferService: IBufferService): n
|
|
|
156
156
|
*/
|
|
157
157
|
function horizontalDirection(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): Direction {
|
|
158
158
|
let startRow;
|
|
159
|
-
if (moveToRequestedRow(
|
|
159
|
+
if (moveToRequestedRow(startY, targetY, bufferService, applicationCursor).length > 0) {
|
|
160
160
|
startRow = targetY - wrappedRowsForRow(targetY, bufferService);
|
|
161
161
|
} else {
|
|
162
162
|
startRow = startY;
|
|
@@ -694,7 +694,7 @@ class CursorBlinkStateManager {
|
|
|
694
694
|
}
|
|
695
695
|
|
|
696
696
|
private _clearIdleTimer(): void {
|
|
697
|
-
if (this._idleTimeout) {
|
|
697
|
+
if (this._idleTimeout !== undefined) {
|
|
698
698
|
this._coreBrowserService.window.clearTimeout(this._idleTimeout);
|
|
699
699
|
this._idleTimeout = undefined;
|
|
700
700
|
}
|
package/src/common/Version.ts
CHANGED
|
@@ -342,7 +342,7 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
|
|
|
342
342
|
throw new Error('only one byte as prefix supported');
|
|
343
343
|
}
|
|
344
344
|
res = id.prefix.charCodeAt(0);
|
|
345
|
-
if (res
|
|
345
|
+
if (res < 0x3c || res > 0x3f) {
|
|
346
346
|
throw new Error('prefix must be in range 0x3c .. 0x3f');
|
|
347
347
|
}
|
|
348
348
|
}
|
|
@@ -162,7 +162,7 @@ export class Params implements IParams {
|
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
if (value < -1) {
|
|
165
|
-
throw new Error('values
|
|
165
|
+
throw new Error('values less than -1 are not allowed');
|
|
166
166
|
}
|
|
167
167
|
this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength;
|
|
168
168
|
this.params[this.length++] = value > Constants.MAX_VALUE ? Constants.MAX_VALUE : value;
|
|
@@ -185,7 +185,7 @@ export class Params implements IParams {
|
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
if (value < -1) {
|
|
188
|
-
throw new Error('values
|
|
188
|
+
throw new Error('values less than -1 are not allowed');
|
|
189
189
|
}
|
|
190
190
|
this._subParams[this._subParamsLength++] = value > Constants.MAX_VALUE ? Constants.MAX_VALUE : value;
|
|
191
191
|
this._subParamsIdx[this.length - 1]++;
|