@xterm/headless 6.1.0-beta.16 → 6.1.0-beta.161

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.16",
4
+ "version": "6.1.0-beta.161",
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": "2f549d74ae383588e0e9f6f65616bf275c9ea1e5"
28
+ "commit": "3a9bfa94bc41fb3f53b8926392d9cab854cab867"
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
  */
@@ -130,7 +139,8 @@ declare module '@xterm/headless' {
130
139
  /**
131
140
  * Whether to reflow the line containing the cursor when the terminal is
132
141
  * resized. Defaults to false, because shells usually handle this
133
- * themselves.
142
+ * themselves. Note that this will not move the cursor position, only the
143
+ * line contents.
134
144
  */
135
145
  reflowCursorLine?: boolean;
136
146
 
@@ -228,6 +238,11 @@ declare module '@xterm/headless' {
228
238
  * All features are disabled by default for security reasons.
229
239
  */
230
240
  windowOptions?: IWindowOptions;
241
+
242
+ /**
243
+ * Enable various VT extensions.
244
+ */
245
+ vtExtensions?: IVtExtensions;
231
246
  }
232
247
 
233
248
  /**
@@ -244,6 +259,13 @@ declare module '@xterm/headless' {
244
259
  * The number of rows in the terminal.
245
260
  */
246
261
  rows?: number;
262
+
263
+ /**
264
+ * Whether to show the cursor immediately when the terminal is created.
265
+ * When false (default), the cursor will not be visible until the terminal
266
+ * is focused for the first time.
267
+ */
268
+ showCursorImmediately?: boolean;
247
269
  }
248
270
 
249
271
  /**
@@ -310,6 +332,51 @@ declare module '@xterm/headless' {
310
332
  buildNumber?: number;
311
333
  }
312
334
 
335
+ /**
336
+ * Enable VT extensions that are not part of the core VT specification.
337
+ */
338
+ export interface IVtExtensions {
339
+ /**
340
+ * Whether the [kitty keyboard protocol][0] (`CSI =|?|>|< u`) is enabled.
341
+ * When enabled, the terminal will respond to keyboard protocol queries and
342
+ * allow programs to enable enhanced keyboard reporting. The default is
343
+ * false.
344
+ *
345
+ * [0]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
346
+ */
347
+ kittyKeyboard?: boolean;
348
+
349
+ /**
350
+ * Whether [SGR 221 (not bold) and SGR 222 (not faint) are enabled][0].
351
+ * These are kitty extensions that allow resetting bold and faint
352
+ * independently. The default is true.
353
+ *
354
+ * [0]: https://sw.kovidgoyal.net/kitty/misc-protocol/
355
+ */
356
+ kittySgrBoldFaintControl?: boolean;
357
+
358
+ /**
359
+ * Whether [win32-input-mode][0] (`DECSET 9001`) is enabled. When enabled,
360
+ * the terminal will allow programs to enable win32 INPUT_RECORD keyboard
361
+ * reporting via `CSI ? 9001 h`. The default is false.
362
+ *
363
+ * [0]: https://github.com/microsoft/terminal/blob/main/doc/specs/%234999%20-%20Improved%20keyboard%20handling%20in%20Conpty.md
364
+ */
365
+ win32InputMode?: boolean;
366
+
367
+ /**
368
+ * Whether [color scheme query and notification][0] (`CSI ? 996 n` and
369
+ * `DECSET 2031`) is enabled. When enabled, the terminal will respond to
370
+ * color scheme queries with `CSI ? 997 ; 1 n` (dark) or `CSI ? 997 ; 2 n`
371
+ * (light) based on the relative luminance of the background and foreground
372
+ * theme colors. Programs can enable unsolicited notifications via
373
+ * `CSI ? 2031 h`. The default is true.
374
+ *
375
+ * [0]: https://contour-terminal.org/vt-extensions/color-palette-update-notifications/
376
+ */
377
+ colorSchemeQuery?: boolean;
378
+ }
379
+
313
380
  /**
314
381
  * A replacement logger for `console`.
315
382
  */
@@ -581,21 +648,18 @@ declare module '@xterm/headless' {
581
648
  readonly cols: number;
582
649
 
583
650
  /**
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.
651
+ * Access to the terminal's normal and alt buffer.
587
652
  */
588
653
  readonly buffer: IBufferNamespace;
589
654
 
590
655
  /**
591
- * (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
592
- * buffer is active this will always return [].
656
+ * Get all markers registered against the buffer. If the alt buffer is
657
+ * active this will always return [].
593
658
  */
594
659
  readonly markers: ReadonlyArray<IMarker>;
595
660
 
596
661
  /**
597
- * (EXPERIMENTAL) Get the parser interface to register
598
- * custom escape sequence handlers.
662
+ * Get the parser interface to register custom escape sequence handlers.
599
663
  */
600
664
  readonly parser: IParser;
601
665
 
@@ -696,6 +760,17 @@ declare module '@xterm/headless' {
696
760
  */
697
761
  onLineFeed: IEvent<void>;
698
762
 
763
+ /**
764
+ * Adds an event listener for when rows are _requested_ to be rendered. The
765
+ * event value contains the start row and end rows of the rendered area
766
+ * (ranges from `0` to `Terminal.rows - 1`). This differs from the regular
767
+ * xterm.js in that it doesn't actually do any rendering but requests
768
+ * rendering from the outside. This is useful for implementing a custom
769
+ * renderer on top of xterm-headless.
770
+ * @returns an `IDisposable` to stop listening.
771
+ */
772
+ onRender: IEvent<{ start: number, end: number }>;
773
+
699
774
  /**
700
775
  * Adds an event listener for when data has been parsed by the terminal,
701
776
  * after {@link write} is called. This event is useful to listen for any
@@ -1143,6 +1218,26 @@ declare module '@xterm/headless' {
1143
1218
 
1144
1219
  /** Whether the cell has the default attribute (no color or style). */
1145
1220
  isAttributeDefault(): boolean;
1221
+
1222
+ /** Gets the underline style. */
1223
+ getUnderlineStyle(): number;
1224
+ /** Gets the underline color number. */
1225
+ getUnderlineColor(): number;
1226
+ /** Gets the underline color mode. */
1227
+ getUnderlineColorMode(): number;
1228
+ /** Whether the cell is using the RGB underline color mode. */
1229
+ isUnderlineColorRGB(): boolean;
1230
+ /** Whether the cell is using the palette underline color mode. */
1231
+ isUnderlineColorPalette(): boolean;
1232
+ /** Whether the cell is using the default underline color mode. */
1233
+ isUnderlineColorDefault(): boolean;
1234
+
1235
+ /**
1236
+ * Compares the cell's attributes (colors and styles) with another cell.
1237
+ * This does not compare the cell's content and excludes URL ids and
1238
+ * underline variant offsets.
1239
+ */
1240
+ attributesEquals(other: IBufferCell): boolean;
1146
1241
  }
1147
1242
 
1148
1243
  /**
@@ -1256,6 +1351,24 @@ declare module '@xterm/headless' {
1256
1351
  * @returns An IDisposable you can call to remove this handler.
1257
1352
  */
1258
1353
  registerOscHandler(ident: number, callback: (data: string) => boolean): IDisposable;
1354
+
1355
+ /**
1356
+ * Adds a handler for APC escape sequences.
1357
+ * @param ident The identifier (first character) of the sequence as a
1358
+ * character code, e.g. 71 for 'G' (Kitty graphics protocol).
1359
+ * @param callback The function to handle the sequence. Note that the
1360
+ * function will only be called once if the sequence finished successfully.
1361
+ * There is currently no way to intercept smaller data chunks, data chunks
1362
+ * will be stored up until the sequence is finished. Since APC sequences are
1363
+ * not limited by the amount of data this might impose a problem for big
1364
+ * payloads. Currently xterm.js limits APC payload to 10 MB which should
1365
+ * give enough room for most use cases. The callback is called with APC data
1366
+ * string (excluding the identifier character). Return true if the sequence
1367
+ * was handled; false if we should try a previous handler. The most recently
1368
+ * added handler is tried first.
1369
+ * @returns An IDisposable you can call to remove this handler.
1370
+ */
1371
+ registerApcHandler(ident: number, callback: (data: string) => boolean): IDisposable;
1259
1372
  }
1260
1373
 
1261
1374
  /**
@@ -1336,6 +1449,10 @@ declare module '@xterm/headless' {
1336
1449
  * Send FocusIn/FocusOut events: `CSI ? 1 0 0 4 h`
1337
1450
  */
1338
1451
  readonly sendFocusMode: boolean;
1452
+ /**
1453
+ * Show Cursor (DECTCEM): `CSI ? 2 5 h`
1454
+ */
1455
+ readonly showCursor: boolean;
1339
1456
  /**
1340
1457
  * Synchronized Output Mode: `CSI ? 2 0 2 6 h`
1341
1458
  *
@@ -1343,6 +1460,13 @@ declare module '@xterm/headless' {
1343
1460
  * disabled, allowing for atomic screen updates without tearing.
1344
1461
  */
1345
1462
  readonly synchronizedOutputMode: boolean;
1463
+ /**
1464
+ * Win32 Input Mode: `CSI ? 9 0 0 1 h`
1465
+ *
1466
+ * When enabled, keyboard input is sent as Win32 INPUT_RECORD format:
1467
+ * `CSI Vk ; Sc ; Uc ; Kd ; Cs ; Rc _`
1468
+ */
1469
+ readonly win32InputMode: boolean;
1346
1470
  /**
1347
1471
  * Auto-Wrap Mode (DECAWM): `CSI ? 7 h`
1348
1472
  */