@xterm/xterm 6.1.0-beta.193 → 6.1.0-beta.194

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/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.193",
4
+ "version": "6.1.0-beta.194",
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": "503abee8ae609933ff2dd846bc9ffecb782d09f4"
122
+ "commit": "f1b0a9609463c8510db7288994702e8bee07369b"
123
123
  }
@@ -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
@@ -6,4 +6,4 @@
6
6
  /**
7
7
  * The xterm.js version. This is updated by the publish script from package.json.
8
8
  */
9
- export const XTERM_VERSION = '6.1.0-beta.193';
9
+ export const XTERM_VERSION = '6.1.0-beta.194';