@xterm/xterm 6.1.0-beta.193 → 6.1.0-beta.195
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 +6 -6
- package/lib/xterm.mjs.map +3 -3
- package/package.json +2 -2
- package/src/browser/Viewport.ts +19 -1
- package/src/common/Version.ts +1 -1
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.195",
|
|
5
5
|
"main": "lib/xterm.js",
|
|
6
6
|
"module": "lib/xterm.mjs",
|
|
7
7
|
"style": "css/xterm.css",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"ws": "^8.2.3",
|
|
120
120
|
"xterm-benchmark": "^0.3.1"
|
|
121
121
|
},
|
|
122
|
-
"commit": "
|
|
122
|
+
"commit": "1432e2008284701b6b5035de5553c6baa876bdc1"
|
|
123
123
|
}
|
package/src/browser/Viewport.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { ICoreBrowserService, IRenderService, IThemeService } from 'browser/services/Services';
|
|
7
7
|
import { ViewportConstants } from 'browser/shared/Constants';
|
|
8
8
|
import { Disposable, toDisposable } from 'common/Lifecycle';
|
|
9
|
-
import { IBufferService, IMouseStateService, IOptionsService } from 'common/services/Services';
|
|
9
|
+
import { IBufferService, ICoreService, IMouseStateService, IOptionsService } from 'common/services/Services';
|
|
10
10
|
import { CoreMouseEventType } from 'common/Types';
|
|
11
11
|
import { scheduleAtNextAnimationFrame } from 'browser/Dom';
|
|
12
12
|
import { SmoothScrollableElement } from 'browser/scrollable/scrollableElement';
|
|
@@ -27,12 +27,14 @@ export class Viewport extends Disposable {
|
|
|
27
27
|
private _isSyncing: boolean = false;
|
|
28
28
|
private _isHandlingScroll: boolean = false;
|
|
29
29
|
private _suppressOnScrollHandler: boolean = false;
|
|
30
|
+
private _needsSyncOnRender: boolean = false;
|
|
30
31
|
|
|
31
32
|
constructor(
|
|
32
33
|
element: HTMLElement,
|
|
33
34
|
screenElement: HTMLElement,
|
|
34
35
|
@IBufferService private readonly _bufferService: IBufferService,
|
|
35
36
|
@ICoreBrowserService coreBrowserService: ICoreBrowserService,
|
|
37
|
+
@ICoreService private readonly _coreService: ICoreService,
|
|
36
38
|
@IMouseStateService mouseStateService: IMouseStateService,
|
|
37
39
|
@IThemeService themeService: IThemeService,
|
|
38
40
|
@IOptionsService private readonly _optionsService: IOptionsService,
|
|
@@ -104,6 +106,16 @@ export class Viewport extends Disposable {
|
|
|
104
106
|
}));
|
|
105
107
|
this._register(this._bufferService.onScroll(() => this._sync()));
|
|
106
108
|
|
|
109
|
+
// Flush deferred viewport sync after a render completes (e.g. after ESU ends
|
|
110
|
+
// synchronized output mode). This ensures DOM scroll position updates atomically
|
|
111
|
+
// with the canvas render.
|
|
112
|
+
this._register(this._renderService.onRender(() => {
|
|
113
|
+
if (this._needsSyncOnRender) {
|
|
114
|
+
this._needsSyncOnRender = false;
|
|
115
|
+
this._sync();
|
|
116
|
+
}
|
|
117
|
+
}));
|
|
118
|
+
|
|
107
119
|
this._register(this._scrollableElement.onScroll(e => this._handleScroll(e)));
|
|
108
120
|
|
|
109
121
|
}
|
|
@@ -161,6 +173,12 @@ export class Viewport extends Disposable {
|
|
|
161
173
|
if (!this._renderService || this._isSyncing) {
|
|
162
174
|
return;
|
|
163
175
|
}
|
|
176
|
+
// Defer DOM scroll updates during synchronized output to prevent visible
|
|
177
|
+
// scroll position flickering while the canvas content is frozen.
|
|
178
|
+
if (this._coreService.decPrivateModes.synchronizedOutput) {
|
|
179
|
+
this._needsSyncOnRender = true;
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
164
182
|
this._isSyncing = true;
|
|
165
183
|
|
|
166
184
|
// Ignore any onScroll event that happens as a result of dimensions changing as this should
|
package/src/common/Version.ts
CHANGED