@xterm/headless 6.1.0-beta.2 → 6.1.0-beta.200
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.
|
|
4
|
+
"version": "6.1.0-beta.200",
|
|
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": "
|
|
28
|
+
"commit": "32553b413592d236a386b905e8331444df1f0364"
|
|
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
|
*/
|
|
@@ -63,14 +72,6 @@ declare module '@xterm/headless' {
|
|
|
63
72
|
*/
|
|
64
73
|
cursorWidth?: number;
|
|
65
74
|
|
|
66
|
-
/**
|
|
67
|
-
* Whether to draw custom glyphs for block element and box drawing
|
|
68
|
-
* characters instead of using the font. This should typically result in
|
|
69
|
-
* better rendering with continuous lines, even when line height and letter
|
|
70
|
-
* spacing is used. Note that this doesn't work with the DOM renderer which
|
|
71
|
-
* renders all characters using the font. The default is true.
|
|
72
|
-
*/
|
|
73
|
-
customGlyphs?: boolean;
|
|
74
75
|
/**
|
|
75
76
|
* Whether input should be disabled.
|
|
76
77
|
*/
|
|
@@ -81,13 +82,6 @@ declare module '@xterm/headless' {
|
|
|
81
82
|
*/
|
|
82
83
|
drawBoldTextInBrightColors?: boolean;
|
|
83
84
|
|
|
84
|
-
/**
|
|
85
|
-
* The modifier key hold to multiply scroll speed.
|
|
86
|
-
* @deprecated This option is no longer available and will always use alt.
|
|
87
|
-
* Setting this will be ignored.
|
|
88
|
-
*/
|
|
89
|
-
fastScrollModifier?: 'none' | 'alt' | 'ctrl' | 'shift';
|
|
90
|
-
|
|
91
85
|
/**
|
|
92
86
|
* The spacing in whole pixels between characters.
|
|
93
87
|
*/
|
|
@@ -145,7 +139,8 @@ declare module '@xterm/headless' {
|
|
|
145
139
|
/**
|
|
146
140
|
* Whether to reflow the line containing the cursor when the terminal is
|
|
147
141
|
* resized. Defaults to false, because shells usually handle this
|
|
148
|
-
* themselves.
|
|
142
|
+
* themselves. Note that this will not move the cursor position, only the
|
|
143
|
+
* line contents.
|
|
149
144
|
*/
|
|
150
145
|
reflowCursorLine?: boolean;
|
|
151
146
|
|
|
@@ -214,25 +209,6 @@ declare module '@xterm/headless' {
|
|
|
214
209
|
*/
|
|
215
210
|
theme?: ITheme;
|
|
216
211
|
|
|
217
|
-
/**
|
|
218
|
-
* Whether "Windows mode" is enabled. Because Windows backends winpty and
|
|
219
|
-
* conpty operate by doing line wrapping on their side, xterm.js does not
|
|
220
|
-
* have access to wrapped lines. When Windows mode is enabled the following
|
|
221
|
-
* changes will be in effect:
|
|
222
|
-
*
|
|
223
|
-
* - Reflow is disabled.
|
|
224
|
-
* - Lines are assumed to be wrapped if the last character of the line is
|
|
225
|
-
* not whitespace.
|
|
226
|
-
*
|
|
227
|
-
* When using conpty on Windows 11 version >= 21376, it is recommended to
|
|
228
|
-
* disable this because native text wrapping sequences are output correctly
|
|
229
|
-
* thanks to https://github.com/microsoft/terminal/issues/405
|
|
230
|
-
*
|
|
231
|
-
* @deprecated Use {@link windowsPty}. This value will be ignored if
|
|
232
|
-
* windowsPty is set.
|
|
233
|
-
*/
|
|
234
|
-
windowsMode?: boolean;
|
|
235
|
-
|
|
236
212
|
/**
|
|
237
213
|
* Compatibility information when the pty is known to be hosted on Windows.
|
|
238
214
|
* Setting this will turn on certain heuristics/workarounds depending on the
|
|
@@ -262,6 +238,11 @@ declare module '@xterm/headless' {
|
|
|
262
238
|
* All features are disabled by default for security reasons.
|
|
263
239
|
*/
|
|
264
240
|
windowOptions?: IWindowOptions;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Enable various VT extensions.
|
|
244
|
+
*/
|
|
245
|
+
vtExtensions?: IVtExtensions;
|
|
265
246
|
}
|
|
266
247
|
|
|
267
248
|
/**
|
|
@@ -278,6 +259,13 @@ declare module '@xterm/headless' {
|
|
|
278
259
|
* The number of rows in the terminal.
|
|
279
260
|
*/
|
|
280
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;
|
|
281
269
|
}
|
|
282
270
|
|
|
283
271
|
/**
|
|
@@ -344,6 +332,51 @@ declare module '@xterm/headless' {
|
|
|
344
332
|
buildNumber?: number;
|
|
345
333
|
}
|
|
346
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
|
+
|
|
347
380
|
/**
|
|
348
381
|
* A replacement logger for `console`.
|
|
349
382
|
*/
|
|
@@ -615,21 +648,18 @@ declare module '@xterm/headless' {
|
|
|
615
648
|
readonly cols: number;
|
|
616
649
|
|
|
617
650
|
/**
|
|
618
|
-
*
|
|
619
|
-
* normal buffer or the alt buffer depending on what's running in the
|
|
620
|
-
* terminal.
|
|
651
|
+
* Access to the terminal's normal and alt buffer.
|
|
621
652
|
*/
|
|
622
653
|
readonly buffer: IBufferNamespace;
|
|
623
654
|
|
|
624
655
|
/**
|
|
625
|
-
*
|
|
626
|
-
*
|
|
656
|
+
* Get all markers registered against the buffer. If the alt buffer is
|
|
657
|
+
* active this will always return [].
|
|
627
658
|
*/
|
|
628
659
|
readonly markers: ReadonlyArray<IMarker>;
|
|
629
660
|
|
|
630
661
|
/**
|
|
631
|
-
*
|
|
632
|
-
* custom escape sequence handlers.
|
|
662
|
+
* Get the parser interface to register custom escape sequence handlers.
|
|
633
663
|
*/
|
|
634
664
|
readonly parser: IParser;
|
|
635
665
|
|
|
@@ -730,6 +760,17 @@ declare module '@xterm/headless' {
|
|
|
730
760
|
*/
|
|
731
761
|
onLineFeed: IEvent<void>;
|
|
732
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
|
+
|
|
733
774
|
/**
|
|
734
775
|
* Adds an event listener for when data has been parsed by the terminal,
|
|
735
776
|
* after {@link write} is called. This event is useful to listen for any
|
|
@@ -1177,6 +1218,26 @@ declare module '@xterm/headless' {
|
|
|
1177
1218
|
|
|
1178
1219
|
/** Whether the cell has the default attribute (no color or style). */
|
|
1179
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;
|
|
1180
1241
|
}
|
|
1181
1242
|
|
|
1182
1243
|
/**
|
|
@@ -1265,7 +1326,7 @@ declare module '@xterm/headless' {
|
|
|
1265
1326
|
* @param id Specifies the function identifier under which the callback
|
|
1266
1327
|
* gets registered, e.g. {intermediates: '%' final: 'G'} for
|
|
1267
1328
|
* default charset selection.
|
|
1268
|
-
* @param
|
|
1329
|
+
* @param handler The function to handle the sequence.
|
|
1269
1330
|
* Return true if the sequence was handled; false if we should try
|
|
1270
1331
|
* a previous handler (set by addEscHandler or setEscHandler).
|
|
1271
1332
|
* The most recently added handler is tried first.
|
|
@@ -1290,6 +1351,24 @@ declare module '@xterm/headless' {
|
|
|
1290
1351
|
* @returns An IDisposable you can call to remove this handler.
|
|
1291
1352
|
*/
|
|
1292
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;
|
|
1293
1372
|
}
|
|
1294
1373
|
|
|
1295
1374
|
/**
|
|
@@ -1370,6 +1449,10 @@ declare module '@xterm/headless' {
|
|
|
1370
1449
|
* Send FocusIn/FocusOut events: `CSI ? 1 0 0 4 h`
|
|
1371
1450
|
*/
|
|
1372
1451
|
readonly sendFocusMode: boolean;
|
|
1452
|
+
/**
|
|
1453
|
+
* Show Cursor (DECTCEM): `CSI ? 2 5 h`
|
|
1454
|
+
*/
|
|
1455
|
+
readonly showCursor: boolean;
|
|
1373
1456
|
/**
|
|
1374
1457
|
* Synchronized Output Mode: `CSI ? 2 0 2 6 h`
|
|
1375
1458
|
*
|
|
@@ -1377,6 +1460,13 @@ declare module '@xterm/headless' {
|
|
|
1377
1460
|
* disabled, allowing for atomic screen updates without tearing.
|
|
1378
1461
|
*/
|
|
1379
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;
|
|
1380
1470
|
/**
|
|
1381
1471
|
* Auto-Wrap Mode (DECAWM): `CSI ? 7 h`
|
|
1382
1472
|
*/
|