@xterm/headless 6.1.0-beta.27 → 6.1.0-beta.270

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/headless",
3
3
  "description": "A headless terminal component that runs in Node.js",
4
- "version": "6.1.0-beta.27",
4
+ "version": "6.1.0-beta.270",
5
5
  "main": "lib-headless/xterm-headless.js",
6
6
  "module": "lib/xterm.mjs",
7
7
  "types": "typings/xterm-headless.d.ts",
@@ -25,5 +25,5 @@
25
25
  "webgl",
26
26
  "xterm"
27
27
  ],
28
- "commit": "9453634f561565c895ef5ac874f403504f81ef57"
28
+ "commit": "21c99d05748513674de7bdea5eea465450822c11"
29
29
  }
@@ -49,10 +49,19 @@ declare module '@xterm/headless' {
49
49
  convertEol?: boolean;
50
50
 
51
51
  /**
52
- * Whether the cursor blinks.
52
+ * Whether the cursor blinks. The blinking will stop after 5 minutes of idle
53
+ * time (refreshed by clicking, focusing or the cursor moving). The default
54
+ * is false.
53
55
  */
54
56
  cursorBlink?: boolean;
55
57
 
58
+ /**
59
+ * The interval in milliseconds for the blink attribute. This is the amount
60
+ * of time text remains visible or hidden before toggling. Set to 0 to
61
+ * disable blinking. The default is 0.
62
+ */
63
+ blinkIntervalDuration?: number;
64
+
56
65
  /**
57
66
  * The style of the cursor.
58
67
  */
@@ -127,10 +136,22 @@ declare module '@xterm/headless' {
127
136
  */
128
137
  minimumContrastRatio?: number;
129
138
 
139
+ /**
140
+ * When enabled and the terminal is in mouse events mode, mouse click, drag,
141
+ * and move events are only sent to the underlying application when the alt
142
+ * key is held. The alt key is not included in the mouse reports sent to the
143
+ * application. Wheel events are not affected. This allows normal text
144
+ * selection by default while still supporting application mouse interaction
145
+ * and scrolling when holding alt. When enabled, this takes precedence over
146
+ * `macOptionClickForcesSelection`.
147
+ */
148
+ mouseEventsRequireAlt?: boolean;
149
+
130
150
  /**
131
151
  * Whether to reflow the line containing the cursor when the terminal is
132
152
  * resized. Defaults to false, because shells usually handle this
133
- * themselves.
153
+ * themselves. Note that this will not move the cursor position, only the
154
+ * line contents.
134
155
  */
135
156
  reflowCursorLine?: boolean;
136
157
 
@@ -228,6 +249,11 @@ declare module '@xterm/headless' {
228
249
  * All features are disabled by default for security reasons.
229
250
  */
230
251
  windowOptions?: IWindowOptions;
252
+
253
+ /**
254
+ * Enable various VT extensions.
255
+ */
256
+ vtExtensions?: IVtExtensions;
231
257
  }
232
258
 
233
259
  /**
@@ -244,6 +270,13 @@ declare module '@xterm/headless' {
244
270
  * The number of rows in the terminal.
245
271
  */
246
272
  rows?: number;
273
+
274
+ /**
275
+ * Whether to show the cursor immediately when the terminal is created.
276
+ * When false (default), the cursor will not be visible until the terminal
277
+ * is focused for the first time.
278
+ */
279
+ showCursorImmediately?: boolean;
247
280
  }
248
281
 
249
282
  /**
@@ -310,6 +343,51 @@ declare module '@xterm/headless' {
310
343
  buildNumber?: number;
311
344
  }
312
345
 
346
+ /**
347
+ * Enable VT extensions that are not part of the core VT specification.
348
+ */
349
+ export interface IVtExtensions {
350
+ /**
351
+ * Whether the [kitty keyboard protocol][0] (`CSI =|?|>|< u`) is enabled.
352
+ * When enabled, the terminal will respond to keyboard protocol queries and
353
+ * allow programs to enable enhanced keyboard reporting. The default is
354
+ * false.
355
+ *
356
+ * [0]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
357
+ */
358
+ kittyKeyboard?: boolean;
359
+
360
+ /**
361
+ * Whether [SGR 221 (not bold) and SGR 222 (not faint) are enabled][0].
362
+ * These are kitty extensions that allow resetting bold and faint
363
+ * independently. The default is true.
364
+ *
365
+ * [0]: https://sw.kovidgoyal.net/kitty/misc-protocol/
366
+ */
367
+ kittySgrBoldFaintControl?: boolean;
368
+
369
+ /**
370
+ * Whether [win32-input-mode][0] (`DECSET 9001`) is enabled. When enabled,
371
+ * the terminal will allow programs to enable win32 INPUT_RECORD keyboard
372
+ * reporting via `CSI ? 9001 h`. The default is false.
373
+ *
374
+ * [0]: https://github.com/microsoft/terminal/blob/main/doc/specs/%234999%20-%20Improved%20keyboard%20handling%20in%20Conpty.md
375
+ */
376
+ win32InputMode?: boolean;
377
+
378
+ /**
379
+ * Whether [color scheme query and notification][0] (`CSI ? 996 n` and
380
+ * `DECSET 2031`) is enabled. When enabled, the terminal will respond to
381
+ * color scheme queries with `CSI ? 997 ; 1 n` (dark) or `CSI ? 997 ; 2 n`
382
+ * (light) based on the relative luminance of the background and foreground
383
+ * theme colors. Programs can enable unsolicited notifications via
384
+ * `CSI ? 2031 h`. The default is true.
385
+ *
386
+ * [0]: https://contour-terminal.org/vt-extensions/color-palette-update-notifications/
387
+ */
388
+ colorSchemeQuery?: boolean;
389
+ }
390
+
313
391
  /**
314
392
  * A replacement logger for `console`.
315
393
  */
@@ -581,21 +659,18 @@ declare module '@xterm/headless' {
581
659
  readonly cols: number;
582
660
 
583
661
  /**
584
- * (EXPERIMENTAL) The terminal's current buffer, this might be either the
585
- * normal buffer or the alt buffer depending on what's running in the
586
- * terminal.
662
+ * Access to the terminal's normal and alt buffer.
587
663
  */
588
664
  readonly buffer: IBufferNamespace;
589
665
 
590
666
  /**
591
- * (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
592
- * buffer is active this will always return [].
667
+ * Get all markers registered against the buffer. If the alt buffer is
668
+ * active this will always return [].
593
669
  */
594
670
  readonly markers: ReadonlyArray<IMarker>;
595
671
 
596
672
  /**
597
- * (EXPERIMENTAL) Get the parser interface to register
598
- * custom escape sequence handlers.
673
+ * Get the parser interface to register custom escape sequence handlers.
599
674
  */
600
675
  readonly parser: IParser;
601
676
 
@@ -696,6 +771,17 @@ declare module '@xterm/headless' {
696
771
  */
697
772
  onLineFeed: IEvent<void>;
698
773
 
774
+ /**
775
+ * Adds an event listener for when rows are _requested_ to be rendered. The
776
+ * event value contains the start row and end rows of the rendered area
777
+ * (ranges from `0` to `Terminal.rows - 1`). This differs from the regular
778
+ * xterm.js in that it doesn't actually do any rendering but requests
779
+ * rendering from the outside. This is useful for implementing a custom
780
+ * renderer on top of xterm-headless.
781
+ * @returns an `IDisposable` to stop listening.
782
+ */
783
+ onRender: IEvent<{ start: number, end: number }>;
784
+
699
785
  /**
700
786
  * Adds an event listener for when data has been parsed by the terminal,
701
787
  * after {@link write} is called. This event is useful to listen for any
@@ -750,12 +836,11 @@ declare module '@xterm/headless' {
750
836
  resize(columns: number, rows: number): void;
751
837
 
752
838
  /**
753
- * Adds a marker to the normal buffer and returns it. If the alt buffer is
754
- * active, undefined is returned.
839
+ * Adds a marker to the normal buffer and returns it.
755
840
  * @param cursorYOffset The y position offset of the marker from the cursor.
756
841
  * @returns The new marker or undefined.
757
842
  */
758
- registerMarker(cursorYOffset?: number): IMarker | undefined;
843
+ registerMarker(cursorYOffset?: number): IMarker;
759
844
 
760
845
  /*
761
846
  * Disposes of the terminal, detaching it from the DOM and removing any
@@ -1143,6 +1228,26 @@ declare module '@xterm/headless' {
1143
1228
 
1144
1229
  /** Whether the cell has the default attribute (no color or style). */
1145
1230
  isAttributeDefault(): boolean;
1231
+
1232
+ /** Gets the underline style. */
1233
+ getUnderlineStyle(): number;
1234
+ /** Gets the underline color number. */
1235
+ getUnderlineColor(): number;
1236
+ /** Gets the underline color mode. */
1237
+ getUnderlineColorMode(): number;
1238
+ /** Whether the cell is using the RGB underline color mode. */
1239
+ isUnderlineColorRGB(): boolean;
1240
+ /** Whether the cell is using the palette underline color mode. */
1241
+ isUnderlineColorPalette(): boolean;
1242
+ /** Whether the cell is using the default underline color mode. */
1243
+ isUnderlineColorDefault(): boolean;
1244
+
1245
+ /**
1246
+ * Compares the cell's attributes (colors and styles) with another cell.
1247
+ * This does not compare the cell's content and excludes URL ids and
1248
+ * underline variant offsets.
1249
+ */
1250
+ attributesEquals(other: IBufferCell): boolean;
1146
1251
  }
1147
1252
 
1148
1253
  /**
@@ -1179,12 +1284,12 @@ declare module '@xterm/headless' {
1179
1284
  prefix?: string;
1180
1285
  /**
1181
1286
  * Optional intermediate bytes, must be in range \x20 .. \x2f.
1182
- * Usable in CSI, DCS and ESC.
1287
+ * Usable in CSI, DCS, ESC and APC.
1183
1288
  */
1184
1289
  intermediates?: string;
1185
1290
  /**
1186
1291
  * Final byte, must be in range \x40 .. \x7e for CSI and DCS,
1187
- * \x30 .. \x7e for ESC.
1292
+ * \x30 .. \x7e for ESC and APC.
1188
1293
  */
1189
1294
  final: string;
1190
1295
  }
@@ -1256,6 +1361,24 @@ declare module '@xterm/headless' {
1256
1361
  * @returns An IDisposable you can call to remove this handler.
1257
1362
  */
1258
1363
  registerOscHandler(ident: number, callback: (data: string) => boolean): IDisposable;
1364
+
1365
+ /**
1366
+ * Adds a handler for APC escape sequences.
1367
+ * @param id Specifies the function identifier under which the callback
1368
+ * gets registered, e.g. {final: 'G'} for Kitty graphics protocol.
1369
+ * @param callback The function to handle the sequence. Note that the
1370
+ * function will only be called once if the sequence finished successfully.
1371
+ * There is currently no way to intercept smaller data chunks, data chunks
1372
+ * will be stored up until the sequence is finished. Since APC sequences are
1373
+ * not limited by the amount of data this might impose a problem for big
1374
+ * payloads. Currently xterm.js limits APC payload to 10 MB which should
1375
+ * give enough room for most use cases. The callback is called with APC data
1376
+ * string (excluding the identifier character). Return true if the sequence
1377
+ * was handled; false if we should try a previous handler. The most recently
1378
+ * added handler is tried first.
1379
+ * @returns An IDisposable you can call to remove this handler.
1380
+ */
1381
+ registerApcHandler(id: IFunctionIdentifier, callback: (data: string) => boolean): IDisposable;
1259
1382
  }
1260
1383
 
1261
1384
  /**
@@ -1336,6 +1459,10 @@ declare module '@xterm/headless' {
1336
1459
  * Send FocusIn/FocusOut events: `CSI ? 1 0 0 4 h`
1337
1460
  */
1338
1461
  readonly sendFocusMode: boolean;
1462
+ /**
1463
+ * Show Cursor (DECTCEM): `CSI ? 2 5 h`
1464
+ */
1465
+ readonly showCursor: boolean;
1339
1466
  /**
1340
1467
  * Synchronized Output Mode: `CSI ? 2 0 2 6 h`
1341
1468
  *
@@ -1343,6 +1470,13 @@ declare module '@xterm/headless' {
1343
1470
  * disabled, allowing for atomic screen updates without tearing.
1344
1471
  */
1345
1472
  readonly synchronizedOutputMode: boolean;
1473
+ /**
1474
+ * Win32 Input Mode: `CSI ? 9 0 0 1 h`
1475
+ *
1476
+ * When enabled, keyboard input is sent as Win32 INPUT_RECORD format:
1477
+ * `CSI Vk ; Sc ; Uc ; Kd ; Cs ; Rc _`
1478
+ */
1479
+ readonly win32InputMode: boolean;
1346
1480
  /**
1347
1481
  * Auto-Wrap Mode (DECAWM): `CSI ? 7 h`
1348
1482
  */