@xterm/xterm 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.
Files changed (158) hide show
  1. package/README.md +60 -38
  2. package/css/xterm.css +29 -22
  3. package/lib/xterm.js +1 -1
  4. package/lib/xterm.js.map +1 -1
  5. package/lib/xterm.mjs +8 -34
  6. package/lib/xterm.mjs.map +4 -4
  7. package/package.json +36 -24
  8. package/src/browser/AccessibilityManager.ts +6 -3
  9. package/src/browser/Clipboard.ts +6 -3
  10. package/src/browser/CoreBrowserTerminal.ts +147 -318
  11. package/src/browser/Dom.ts +178 -0
  12. package/src/browser/Linkifier.ts +11 -11
  13. package/src/browser/OscLinkProvider.ts +4 -2
  14. package/src/browser/RenderDebouncer.ts +2 -2
  15. package/src/browser/TimeBasedDebouncer.ts +2 -2
  16. package/src/browser/Types.ts +12 -11
  17. package/src/browser/Viewport.ts +55 -20
  18. package/src/browser/decorations/BufferDecorationRenderer.ts +1 -1
  19. package/src/browser/decorations/OverviewRulerRenderer.ts +33 -17
  20. package/src/browser/input/CompositionHelper.ts +44 -8
  21. package/src/browser/public/Terminal.ts +25 -28
  22. package/src/browser/renderer/dom/DomRenderer.ts +205 -41
  23. package/src/browser/renderer/dom/DomRendererRowFactory.ts +19 -13
  24. package/src/browser/renderer/dom/WidthCache.ts +54 -52
  25. package/src/browser/renderer/shared/Constants.ts +7 -0
  26. package/src/browser/renderer/shared/TextBlinkStateManager.ts +97 -0
  27. package/src/browser/renderer/shared/Types.ts +8 -2
  28. package/src/browser/scrollable/abstractScrollbar.ts +300 -0
  29. package/src/browser/scrollable/fastDomNode.ts +126 -0
  30. package/src/browser/scrollable/globalPointerMoveMonitor.ts +90 -0
  31. package/src/browser/scrollable/horizontalScrollbar.ts +85 -0
  32. package/src/browser/scrollable/mouseEvent.ts +292 -0
  33. package/src/browser/scrollable/scrollable.ts +486 -0
  34. package/src/browser/scrollable/scrollableElement.ts +579 -0
  35. package/src/browser/scrollable/scrollableElementOptions.ts +161 -0
  36. package/src/browser/scrollable/scrollbarArrow.ts +110 -0
  37. package/src/browser/scrollable/scrollbarState.ts +246 -0
  38. package/src/browser/scrollable/scrollbarVisibilityController.ts +113 -0
  39. package/src/browser/scrollable/touch.ts +485 -0
  40. package/src/browser/scrollable/verticalScrollbar.ts +143 -0
  41. package/src/browser/scrollable/widget.ts +23 -0
  42. package/src/browser/services/CharSizeService.ts +2 -2
  43. package/src/browser/services/CoreBrowserService.ts +7 -5
  44. package/src/browser/services/KeyboardService.ts +67 -0
  45. package/src/browser/services/LinkProviderService.ts +1 -1
  46. package/src/browser/services/MouseCoordsService.ts +47 -0
  47. package/src/browser/services/MouseService.ts +518 -25
  48. package/src/browser/services/RenderService.ts +22 -16
  49. package/src/browser/services/SelectionService.ts +16 -8
  50. package/src/browser/services/Services.ts +40 -17
  51. package/src/browser/services/ThemeService.ts +2 -2
  52. package/src/common/Async.ts +105 -0
  53. package/src/common/CircularList.ts +2 -2
  54. package/src/common/Color.ts +8 -0
  55. package/src/common/CoreTerminal.ts +29 -21
  56. package/src/common/Event.ts +118 -0
  57. package/src/common/InputHandler.ts +256 -36
  58. package/src/common/Lifecycle.ts +113 -0
  59. package/src/common/Platform.ts +13 -3
  60. package/src/common/SortedList.ts +7 -3
  61. package/src/common/TaskQueue.ts +14 -5
  62. package/src/common/Types.ts +36 -16
  63. package/src/common/Version.ts +9 -0
  64. package/src/common/buffer/Buffer.ts +22 -16
  65. package/src/common/buffer/BufferLine.ts +4 -5
  66. package/src/common/buffer/BufferSet.ts +7 -6
  67. package/src/common/buffer/CellData.ts +57 -0
  68. package/src/common/buffer/Marker.ts +2 -2
  69. package/src/common/buffer/Types.ts +6 -2
  70. package/src/common/data/Charsets.ts +1 -1
  71. package/src/common/data/EscapeSequences.ts +71 -70
  72. package/src/common/input/Keyboard.ts +14 -7
  73. package/src/common/input/KittyKeyboard.ts +519 -0
  74. package/src/common/input/Win32InputMode.ts +297 -0
  75. package/src/common/input/WriteBuffer.ts +34 -2
  76. package/src/common/input/XParseColor.ts +2 -2
  77. package/src/common/parser/ApcParser.ts +245 -0
  78. package/src/common/parser/Constants.ts +22 -4
  79. package/src/common/parser/DcsParser.ts +5 -5
  80. package/src/common/parser/EscapeSequenceParser.ts +155 -43
  81. package/src/common/parser/OscParser.ts +5 -5
  82. package/src/common/parser/Types.ts +34 -1
  83. package/src/common/public/BufferLineApiView.ts +2 -2
  84. package/src/common/public/BufferNamespaceApi.ts +2 -2
  85. package/src/common/public/ParserApi.ts +3 -0
  86. package/src/common/services/BufferService.ts +8 -5
  87. package/src/common/services/CharsetService.ts +4 -0
  88. package/src/common/services/CoreService.ts +18 -4
  89. package/src/common/services/DecorationService.ts +24 -8
  90. package/src/common/services/LogService.ts +1 -31
  91. package/src/common/services/{CoreMouseService.ts → MouseStateService.ts} +21 -132
  92. package/src/common/services/OptionsService.ts +13 -7
  93. package/src/common/services/Services.ts +47 -44
  94. package/src/common/services/UnicodeService.ts +1 -1
  95. package/typings/xterm.d.ts +320 -45
  96. package/src/common/TypedArrayUtils.ts +0 -17
  97. package/src/vs/base/browser/browser.ts +0 -141
  98. package/src/vs/base/browser/canIUse.ts +0 -49
  99. package/src/vs/base/browser/dom.ts +0 -2369
  100. package/src/vs/base/browser/fastDomNode.ts +0 -316
  101. package/src/vs/base/browser/globalPointerMoveMonitor.ts +0 -112
  102. package/src/vs/base/browser/iframe.ts +0 -135
  103. package/src/vs/base/browser/keyboardEvent.ts +0 -213
  104. package/src/vs/base/browser/mouseEvent.ts +0 -229
  105. package/src/vs/base/browser/touch.ts +0 -372
  106. package/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts +0 -303
  107. package/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts +0 -114
  108. package/src/vs/base/browser/ui/scrollbar/scrollableElement.ts +0 -720
  109. package/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts +0 -165
  110. package/src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts +0 -114
  111. package/src/vs/base/browser/ui/scrollbar/scrollbarState.ts +0 -243
  112. package/src/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.ts +0 -118
  113. package/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts +0 -116
  114. package/src/vs/base/browser/ui/widget.ts +0 -57
  115. package/src/vs/base/browser/window.ts +0 -14
  116. package/src/vs/base/common/arrays.ts +0 -887
  117. package/src/vs/base/common/arraysFind.ts +0 -202
  118. package/src/vs/base/common/assert.ts +0 -71
  119. package/src/vs/base/common/async.ts +0 -1992
  120. package/src/vs/base/common/cancellation.ts +0 -148
  121. package/src/vs/base/common/charCode.ts +0 -450
  122. package/src/vs/base/common/collections.ts +0 -140
  123. package/src/vs/base/common/decorators.ts +0 -130
  124. package/src/vs/base/common/equals.ts +0 -146
  125. package/src/vs/base/common/errors.ts +0 -303
  126. package/src/vs/base/common/event.ts +0 -1778
  127. package/src/vs/base/common/functional.ts +0 -32
  128. package/src/vs/base/common/hash.ts +0 -316
  129. package/src/vs/base/common/iterator.ts +0 -159
  130. package/src/vs/base/common/keyCodes.ts +0 -526
  131. package/src/vs/base/common/keybindings.ts +0 -284
  132. package/src/vs/base/common/lazy.ts +0 -47
  133. package/src/vs/base/common/lifecycle.ts +0 -801
  134. package/src/vs/base/common/linkedList.ts +0 -142
  135. package/src/vs/base/common/map.ts +0 -202
  136. package/src/vs/base/common/numbers.ts +0 -98
  137. package/src/vs/base/common/observable.ts +0 -76
  138. package/src/vs/base/common/observableInternal/api.ts +0 -31
  139. package/src/vs/base/common/observableInternal/autorun.ts +0 -281
  140. package/src/vs/base/common/observableInternal/base.ts +0 -489
  141. package/src/vs/base/common/observableInternal/debugName.ts +0 -145
  142. package/src/vs/base/common/observableInternal/derived.ts +0 -428
  143. package/src/vs/base/common/observableInternal/lazyObservableValue.ts +0 -146
  144. package/src/vs/base/common/observableInternal/logging.ts +0 -328
  145. package/src/vs/base/common/observableInternal/promise.ts +0 -209
  146. package/src/vs/base/common/observableInternal/utils.ts +0 -610
  147. package/src/vs/base/common/platform.ts +0 -281
  148. package/src/vs/base/common/scrollable.ts +0 -522
  149. package/src/vs/base/common/sequence.ts +0 -34
  150. package/src/vs/base/common/stopwatch.ts +0 -43
  151. package/src/vs/base/common/strings.ts +0 -557
  152. package/src/vs/base/common/symbols.ts +0 -9
  153. package/src/vs/base/common/uint.ts +0 -59
  154. package/src/vs/patches/nls.ts +0 -90
  155. package/src/vs/typings/base-common.d.ts +0 -20
  156. package/src/vs/typings/require.d.ts +0 -42
  157. package/src/vs/typings/vscode-globals-nls.d.ts +0 -36
  158. package/src/vs/typings/vscode-globals-product.d.ts +0 -33
@@ -58,10 +58,19 @@ declare module '@xterm/xterm' {
58
58
  convertEol?: boolean;
59
59
 
60
60
  /**
61
- * Whether the cursor blinks.
61
+ * Whether the cursor blinks. The blinking will stop after 5 minutes of idle
62
+ * time (refreshed by clicking, focusing or the cursor moving). The default
63
+ * is false.
62
64
  */
63
65
  cursorBlink?: boolean;
64
66
 
67
+ /**
68
+ * The interval in milliseconds for the blink attribute. This is the amount
69
+ * of time text remains visible or hidden before toggling. Set to 0 to
70
+ * disable blinking. The default is 0.
71
+ */
72
+ blinkIntervalDuration?: number;
73
+
65
74
  /**
66
75
  * The style of the cursor when the terminal is focused.
67
76
  */
@@ -77,15 +86,6 @@ declare module '@xterm/xterm' {
77
86
  */
78
87
  cursorInactiveStyle?: 'outline' | 'block' | 'bar' | 'underline' | 'none';
79
88
 
80
- /**
81
- * Whether to draw custom glyphs for block element and box drawing
82
- * characters instead of using the font. This should typically result in
83
- * better rendering with continuous lines, even when line height and letter
84
- * spacing is used. Note that this doesn't work with the DOM renderer which
85
- * renders all characters using the font. The default is true.
86
- */
87
- customGlyphs?: boolean;
88
-
89
89
  /**
90
90
  * Whether input should be disabled.
91
91
  */
@@ -206,10 +206,17 @@ declare module '@xterm/xterm' {
206
206
  */
207
207
  minimumContrastRatio?: number;
208
208
 
209
+ /**
210
+ * Control various quirks features that are either non-standard or standard
211
+ * in but generally rejected in modern terminals.
212
+ */
213
+ quirks?: ITerminalQuirks;
214
+
209
215
  /**
210
216
  * Whether to reflow the line containing the cursor when the terminal is
211
217
  * resized. Defaults to false, because shells usually handle this
212
- * themselves.
218
+ * themselves. Note that this will not move the cursor position, only the
219
+ * line contents.
213
220
  */
214
221
  reflowCursorLine?: boolean;
215
222
 
@@ -268,6 +275,11 @@ declare module '@xterm/xterm' {
268
275
  */
269
276
  scrollSensitivity?: number;
270
277
 
278
+ /**
279
+ * Options for configuring the scrollbar.
280
+ */
281
+ scrollbar?: IScrollbarOptions;
282
+
271
283
  /**
272
284
  * The duration to smoothly scroll between the origin and the target in
273
285
  * milliseconds. Set to 0 to disable smooth scrolling and scroll instantly.
@@ -284,6 +296,11 @@ declare module '@xterm/xterm' {
284
296
  */
285
297
  theme?: ITheme;
286
298
 
299
+ /**
300
+ * Enable various VT extensions.
301
+ */
302
+ vtExtensions?: IVtExtensions;
303
+
287
304
  /**
288
305
  * Compatibility information when the pty is known to be hosted on Windows.
289
306
  * Setting this will turn on certain heuristics/workarounds depending on the
@@ -313,12 +330,6 @@ declare module '@xterm/xterm' {
313
330
  * All features are disabled by default for security reasons.
314
331
  */
315
332
  windowOptions?: IWindowOptions;
316
-
317
- /**
318
- * Controls the visibility and style of the overview ruler which visualizes
319
- * decorations underneath the scroll bar.
320
- */
321
- overviewRuler?: IOverviewRulerOptions;
322
333
  }
323
334
 
324
335
  /**
@@ -335,6 +346,13 @@ declare module '@xterm/xterm' {
335
346
  * The number of rows in the terminal.
336
347
  */
337
348
  rows?: number;
349
+
350
+ /**
351
+ * Whether to show the cursor immediately when the terminal is created.
352
+ * When false (default), the cursor will not be visible until the terminal
353
+ * is focused for the first time.
354
+ */
355
+ showCursorImmediately?: boolean;
338
356
  }
339
357
 
340
358
  /**
@@ -360,23 +378,23 @@ declare module '@xterm/xterm' {
360
378
  selectionInactiveBackground?: string;
361
379
  /**
362
380
  * The scrollbar slider background color. Defaults to
363
- * {@link ITerminalOptions.foreground foreground} with 20% opacity.
381
+ * {@link ITheme.foreground} with 20% opacity.
364
382
  */
365
383
  scrollbarSliderBackground?: string;
366
384
  /**
367
385
  * The scrollbar slider background color when hovered. Defaults to
368
- * {@link ITerminalOptions.foreground foreground} with 40% opacity.
386
+ * {@link ITheme.foreground} with 40% opacity.
369
387
  */
370
388
  scrollbarSliderHoverBackground?: string;
371
389
  /**
372
390
  * The scrollbar slider background color when clicked. Defaults to
373
- * {@link ITerminalOptions.foreground foreground} with 50% opacity.
391
+ * {@link ITheme.foreground} with 50% opacity.
374
392
  */
375
393
  scrollbarSliderActiveBackground?: string;
376
394
  /**
377
395
  * The border color of the overview ruler. This visually separates the
378
- * terminal from the scroll bar when {@link IOverviewRulerOptions.width} is
379
- * set. When this is not set it defaults to black (`#000000`).
396
+ * terminal from the scroll bar when {@link IScrollbarOptions.width} is set.
397
+ * When this is not set it defaults to black (`#000000`).
380
398
  */
381
399
  overviewRulerBorder?: string;
382
400
  /** ANSI black (eg. `\x1b[30m`) */
@@ -415,6 +433,66 @@ declare module '@xterm/xterm' {
415
433
  extendedAnsi?: string[];
416
434
  }
417
435
 
436
+ /**
437
+ * Control various quirks features that are either non-standard or standard
438
+ * in but generally rejected in modern terminals.
439
+ */
440
+ export interface ITerminalQuirks {
441
+ /**
442
+ * Enables support for DECSET 12 and DECRST 12 which controls cursor blink.
443
+ * Programs such as `vim` may use this to set the cursor blink state but may
444
+ * not change it back when exiting. Generally the terminal emulator should
445
+ * be in control of whether the cursor blinks or not and the application in
446
+ * modern terminals. Note that DECRQM works regardless of this option.
447
+ */
448
+ allowSetCursorBlink?: boolean;
449
+ }
450
+
451
+ /**
452
+ * Enable certain optional VT extensions.
453
+ */
454
+ export interface IVtExtensions {
455
+ /**
456
+ * Whether the [kitty keyboard protocol][0] (`CSI =|?|>|< u`) is enabled.
457
+ * When enabled, the terminal will respond to keyboard protocol queries and
458
+ * allow programs to enable enhanced keyboard reporting. The default is
459
+ * false.
460
+ *
461
+ * [0]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
462
+ */
463
+ kittyKeyboard?: boolean;
464
+
465
+ /**
466
+ * Whether [SGR 221 (not bold) and SGR 222 (not faint) are enabled][0].
467
+ * These are kitty extensions that allow resetting bold and faint
468
+ * independently. The default is true.
469
+ *
470
+ * [0]: https://sw.kovidgoyal.net/kitty/misc-protocol/
471
+ */
472
+ kittySgrBoldFaintControl?: boolean;
473
+
474
+ /**
475
+ * Whether [win32-input-mode][0] (`DECSET 9001`) is enabled. When enabled,
476
+ * the terminal will allow programs to enable win32 INPUT_RECORD keyboard
477
+ * reporting via `CSI ? 9001 h`. The default is false.
478
+ *
479
+ * [0]: https://github.com/microsoft/terminal/blob/main/doc/specs/%234999%20-%20Improved%20keyboard%20handling%20in%20Conpty.md
480
+ */
481
+ win32InputMode?: boolean;
482
+
483
+ /**
484
+ * Whether [color scheme query and notification][0] (`CSI ? 996 n` and
485
+ * `DECSET 2031`) is enabled. When enabled, the terminal will respond to
486
+ * color scheme queries with `CSI ? 997 ; 1 n` (dark) or `CSI ? 997 ; 2 n`
487
+ * (light) based on the relative luminance of the background and foreground
488
+ * theme colors. Programs can enable unsolicited notifications via
489
+ * `CSI ? 2031 h`. The default is true.
490
+ *
491
+ * [0]: https://contour-terminal.org/vt-extensions/color-palette-update-notifications/
492
+ */
493
+ colorSchemeQuery?: boolean;
494
+ }
495
+
418
496
  /**
419
497
  * Pty information for Windows.
420
498
  */
@@ -604,8 +682,8 @@ declare module '@xterm/xterm' {
604
682
 
605
683
  /**
606
684
  * When defined, renders the decoration in the overview ruler to the right
607
- * of the terminal. {@link IOverviewRulerOptions.width} must be set in order
608
- * to see the overview ruler.
685
+ * of the terminal. {@link IScrollbarOptions.width} must be set in order to
686
+ * see the overview ruler.
609
687
  * @param color The color of the decoration.
610
688
  * @param position The position of the decoration.
611
689
  */
@@ -628,15 +706,10 @@ declare module '@xterm/xterm' {
628
706
  tooMuchOutput: string;
629
707
  }
630
708
 
709
+ /**
710
+ * Options for configuring the overview ruler rendered beside the scrollbar.
711
+ */
631
712
  export interface IOverviewRulerOptions {
632
- /**
633
- * When defined, renders decorations in the overview ruler to the right of
634
- * the terminal. This must be set in order to see the overview ruler.
635
- * @param color The color of the decoration.
636
- * @param position The position of the decoration.
637
- */
638
- width?: number;
639
-
640
713
  /**
641
714
  * Whether to show the top border of the overview ruler, which uses the
642
715
  * {@link ITheme.overviewRulerBorder} color.
@@ -650,6 +723,34 @@ declare module '@xterm/xterm' {
650
723
  showBottomBorder?: boolean;
651
724
  }
652
725
 
726
+ /**
727
+ * Options for configuring the scrollbar.
728
+ */
729
+ export interface IScrollbarOptions {
730
+ /**
731
+ * Whether to show the scrollbar. When false, this supersedes
732
+ * {@link IScrollbarOptions.width}. Defaults to true.
733
+ */
734
+ showScrollbar?: boolean;
735
+ /**
736
+ * Whether to show arrows at the top and bottom of the scrollbar. Defaults
737
+ * to false.
738
+ */
739
+ showArrows?: boolean;
740
+
741
+ /**
742
+ * The width of the scrollbar and overview ruler in CSS pixels. When set,
743
+ * this enables the overview ruler.
744
+ */
745
+ width?: number;
746
+
747
+ /**
748
+ * Controls the visibility and style of the overview ruler which visualizes
749
+ * decorations underneath the scroll bar.
750
+ */
751
+ overviewRuler?: IOverviewRulerOptions;
752
+ }
753
+
653
754
  /**
654
755
  * Enable various window manipulation and report features
655
756
  * (`CSI Ps ; Ps ; Ps t`).
@@ -816,6 +917,12 @@ declare module '@xterm/xterm' {
816
917
  */
817
918
  readonly element: HTMLElement | undefined;
818
919
 
920
+ /**
921
+ * The screen element containing the terminal's canvas rendering layers and
922
+ * decorations, excluding the viewport and the scrollbar.
923
+ */
924
+ readonly screenElement: HTMLElement | undefined;
925
+
819
926
  /**
820
927
  * The textarea that accepts input for the terminal.
821
928
  */
@@ -841,8 +948,8 @@ declare module '@xterm/xterm' {
841
948
  readonly buffer: IBufferNamespace;
842
949
 
843
950
  /**
844
- * (EXPERIMENTAL) Get all markers registered against the buffer. If the alt
845
- * buffer is active this will always return [].
951
+ * Get all markers registered against the buffer. If the alt buffer is
952
+ * active this will always return [].
846
953
  */
847
954
  readonly markers: ReadonlyArray<IMarker>;
848
955
 
@@ -852,8 +959,8 @@ declare module '@xterm/xterm' {
852
959
  readonly parser: IParser;
853
960
 
854
961
  /**
855
- * (EXPERIMENTAL) Get the Unicode handling interface
856
- * to register and switch Unicode version.
962
+ * (EXPERIMENTAL) Get the Unicode handling interface to register and switch
963
+ * Unicode version.
857
964
  */
858
965
  readonly unicode: IUnicodeHandling;
859
966
 
@@ -862,6 +969,12 @@ declare module '@xterm/xterm' {
862
969
  */
863
970
  readonly modes: IModes;
864
971
 
972
+ /**
973
+ * The dimensions of the terminal. This will be undefined before
974
+ * {@link open} is called.
975
+ */
976
+ readonly dimensions: IRenderDimensions | undefined;
977
+
865
978
  /**
866
979
  * Gets or sets the terminal options. This supports setting multiple
867
980
  * options.
@@ -1002,6 +1115,12 @@ declare module '@xterm/xterm' {
1002
1115
  */
1003
1116
  onTitleChange: IEvent<string>;
1004
1117
 
1118
+ /**
1119
+ * Adds an event listener for when the terminal's dimensions change.
1120
+ * @returns an `IDisposable` to stop listening.
1121
+ */
1122
+ onDimensionsChange: IEvent<IRenderDimensions>;
1123
+
1005
1124
  /**
1006
1125
  * Unfocus the terminal.
1007
1126
  */
@@ -1102,9 +1221,9 @@ declare module '@xterm/xterm' {
1102
1221
  registerLinkProvider(linkProvider: ILinkProvider): IDisposable;
1103
1222
 
1104
1223
  /**
1105
- * (EXPERIMENTAL) Registers a character joiner, allowing custom sequences of
1106
- * characters to be rendered as a single unit. This is useful in particular
1107
- * for rendering ligatures and graphemes, among other things.
1224
+ * Registers a character joiner, allowing custom sequences of characters to
1225
+ * be rendered as a single unit. This is useful in particular for rendering
1226
+ * ligatures and graphemes, among other things.
1108
1227
  *
1109
1228
  * Each registered character joiner is called with a string of text
1110
1229
  * representing a portion of a line in the terminal that can be rendered as
@@ -1122,8 +1241,6 @@ declare module '@xterm/xterm' {
1122
1241
  * render together, since they aren't drawn as optimally as individual
1123
1242
  * characters.
1124
1243
  *
1125
- * NOTE: character joiners are only used by the webgl renderer.
1126
- *
1127
1244
  * @param handler The function that determines character joins. It is called
1128
1245
  * with a string of text that is eligible for joining and returns an array
1129
1246
  * where each entry is an array containing the start (inclusive) and end
@@ -1133,8 +1250,8 @@ declare module '@xterm/xterm' {
1133
1250
  registerCharacterJoiner(handler: (text: string) => [number, number][]): number;
1134
1251
 
1135
1252
  /**
1136
- * (EXPERIMENTAL) Deregisters the character joiner if one was registered.
1137
- * NOTE: character joiners are only used by the webgl renderer.
1253
+ * Deregisters the character joiner if one was registered. Note that
1254
+ * character joiners are only used by the webgl renderer.
1138
1255
  * @param joinerId The character joiner's ID (returned after register)
1139
1256
  */
1140
1257
  deregisterCharacterJoiner(joinerId: number): void;
@@ -1147,7 +1264,7 @@ declare module '@xterm/xterm' {
1147
1264
  registerMarker(cursorYOffset?: number): IMarker;
1148
1265
 
1149
1266
  /**
1150
- * (EXPERIMENTAL) Adds a decoration to the terminal using
1267
+ * Registers a decoration to the terminal.
1151
1268
  * @param decorationOptions, which takes a marker and an optional anchor,
1152
1269
  * width, height, and x offset from the anchor. Returns the decoration or
1153
1270
  * undefined if the alt buffer is active or the marker has already been
@@ -1736,6 +1853,26 @@ declare module '@xterm/xterm' {
1736
1853
 
1737
1854
  /** Whether the cell has the default attribute (no color or style). */
1738
1855
  isAttributeDefault(): boolean;
1856
+
1857
+ /** Gets the underline style. */
1858
+ getUnderlineStyle(): number;
1859
+ /** Gets the underline color number. */
1860
+ getUnderlineColor(): number;
1861
+ /** Gets the underline color mode. */
1862
+ getUnderlineColorMode(): number;
1863
+ /** Whether the cell is using the RGB underline color mode. */
1864
+ isUnderlineColorRGB(): boolean;
1865
+ /** Whether the cell is using the palette underline color mode. */
1866
+ isUnderlineColorPalette(): boolean;
1867
+ /** Whether the cell is using the default underline color mode. */
1868
+ isUnderlineColorDefault(): boolean;
1869
+
1870
+ /**
1871
+ * Compares the cell's attributes (colors and styles) with another cell.
1872
+ * This does not compare the cell's content and excludes URL ids and
1873
+ * underline variant offsets.
1874
+ */
1875
+ attributesEquals(other: IBufferCell): boolean;
1739
1876
  }
1740
1877
 
1741
1878
  /**
@@ -1839,7 +1976,7 @@ declare module '@xterm/xterm' {
1839
1976
  * @param id Specifies the function identifier under which the callback gets
1840
1977
  * registered, e.g. {intermediates: '%' final: 'G'} for default charset
1841
1978
  * selection.
1842
- * @param callback The function to handle the sequence.
1979
+ * @param handler The function to handle the sequence.
1843
1980
  * Return `true` if the sequence was handled, `false` if the parser should
1844
1981
  * try a previous handler. The most recently added handler is tried first.
1845
1982
  * @returns An IDisposable you can call to remove this handler.
@@ -1862,6 +1999,24 @@ declare module '@xterm/xterm' {
1862
1999
  * @returns An IDisposable you can call to remove this handler.
1863
2000
  */
1864
2001
  registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable;
2002
+
2003
+ /**
2004
+ * Adds a handler for APC escape sequences.
2005
+ * @param ident The identifier (first character) of the sequence as a
2006
+ * character code, e.g. 71 for 'G' (Kitty graphics protocol).
2007
+ * @param callback The function to handle the sequence. Note that the
2008
+ * function will only be called once if the sequence finished successfully.
2009
+ * There is currently no way to intercept smaller data chunks, data chunks
2010
+ * will be stored up until the sequence is finished. Since APC sequences are
2011
+ * not limited by the amount of data this might impose a problem for big
2012
+ * payloads. Currently xterm.js limits APC payload to 10 MB which should
2013
+ * give enough room for most use cases. The callback is called with APC data
2014
+ * string (excluding the identifier character). Return `true` if the
2015
+ * sequence was handled, `false` if the parser should try a previous
2016
+ * handler. The most recently added handler is tried first.
2017
+ * @returns An IDisposable you can call to remove this handler.
2018
+ */
2019
+ registerApcHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable;
1865
2020
  }
1866
2021
 
1867
2022
  /**
@@ -1942,6 +2097,10 @@ declare module '@xterm/xterm' {
1942
2097
  * Send FocusIn/FocusOut events: `CSI ? 1 0 0 4 h`
1943
2098
  */
1944
2099
  readonly sendFocusMode: boolean;
2100
+ /**
2101
+ * Show Cursor (DECTCEM): `CSI ? 2 5 h`
2102
+ */
2103
+ readonly showCursor: boolean;
1945
2104
  /**
1946
2105
  * Synchronized Output Mode: `CSI ? 2 0 2 6 h`
1947
2106
  *
@@ -1949,9 +2108,125 @@ declare module '@xterm/xterm' {
1949
2108
  * disabled, allowing for atomic screen updates without tearing.
1950
2109
  */
1951
2110
  readonly synchronizedOutputMode: boolean;
2111
+ /**
2112
+ * Win32 Input Mode: `CSI ? 9 0 0 1 h`
2113
+ *
2114
+ * When enabled, keyboard input is sent as Win32 INPUT_RECORD format:
2115
+ * `CSI Vk ; Sc ; Uc ; Kd ; Cs ; Rc _`
2116
+ */
2117
+ readonly win32InputMode: boolean;
1952
2118
  /**
1953
2119
  * Auto-Wrap Mode (DECAWM): `CSI ? 7 h`
1954
2120
  */
1955
2121
  readonly wraparoundMode: boolean;
1956
2122
  }
2123
+
2124
+ /**
2125
+ * An object containing a width and height in pixels.
2126
+ */
2127
+ export interface IDimensions {
2128
+ width: number;
2129
+ height: number;
2130
+ }
2131
+
2132
+ /**
2133
+ * An object containing a top and left offset.
2134
+ */
2135
+ export interface IOffset {
2136
+ top: number;
2137
+ left: number;
2138
+ }
2139
+
2140
+ /**
2141
+ * The dimensions of the terminal.
2142
+ */
2143
+ export interface IRenderDimensions {
2144
+ /**
2145
+ * Dimensions measured in CSS pixels (ie. device pixels / device pixel
2146
+ * ratio).
2147
+ */
2148
+ css: {
2149
+ /**
2150
+ * The dimensions of the canvas.
2151
+ */
2152
+ canvas: IDimensions;
2153
+ /**
2154
+ * The dimensions of a single cell.
2155
+ */
2156
+ cell: IDimensions;
2157
+ };
2158
+ /**
2159
+ * Dimensions measured in actual pixels as rendered to the device.
2160
+ */
2161
+ device: {
2162
+ /**
2163
+ * The dimensions of the canvas.
2164
+ */
2165
+ canvas: IDimensions;
2166
+ /**
2167
+ * The dimensions of a single cell.
2168
+ */
2169
+ cell: IDimensions;
2170
+ /**
2171
+ * The dimensions of a single character within a cell, including its
2172
+ * offset within the cell.
2173
+ */
2174
+ char: IDimensions & IOffset;
2175
+ };
2176
+ }
2177
+
2178
+ /**
2179
+ * An object containing a width and height in pixels.
2180
+ */
2181
+ export interface IDimensions {
2182
+ width: number;
2183
+ height: number;
2184
+ }
2185
+
2186
+ /**
2187
+ * An object containing a top and left offset.
2188
+ */
2189
+ export interface IOffset {
2190
+ top: number;
2191
+ left: number;
2192
+ }
2193
+
2194
+ /**
2195
+ * The dimensions of the terminal, this is constructed and available after
2196
+ * {@link Terminal.open} is called.
2197
+ */
2198
+ export interface IRenderDimensions {
2199
+ /**
2200
+ * Dimensions measured in CSS pixels (ie. device pixels / device pixel
2201
+ * ratio).
2202
+ */
2203
+ css: {
2204
+ /**
2205
+ * The dimensions of the canvas which is the full terminal size.
2206
+ */
2207
+ canvas: IDimensions;
2208
+ /**
2209
+ * The dimensions of a single cell.
2210
+ */
2211
+ cell: IDimensions;
2212
+ };
2213
+ /**
2214
+ * Dimensions measured in actual pixels as rendered to the device.
2215
+ */
2216
+ device: {
2217
+ /**
2218
+ * The dimensions of the canvas which is the full terminal size.
2219
+ */
2220
+ canvas: IDimensions;
2221
+ /**
2222
+ * The dimensions of a single cell.
2223
+ */
2224
+ cell: IDimensions;
2225
+ /**
2226
+ * The dimensions of a single character within a cell, including its
2227
+ * offset within the cell.
2228
+ */
2229
+ char: IDimensions & IOffset;
2230
+ };
2231
+ }
1957
2232
  }
@@ -1,17 +0,0 @@
1
- /**
2
- * Copyright (c) 2018 The xterm.js authors. All rights reserved.
3
- * @license MIT
4
- */
5
-
6
- export type TypedArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
7
-
8
- /**
9
- * Concat two typed arrays `a` and `b`.
10
- * Returns a new typed array.
11
- */
12
- export function concat<T extends TypedArray>(a: T, b: T): T {
13
- const result = new (a.constructor as any)(a.length + b.length);
14
- result.set(a);
15
- result.set(b, a.length);
16
- return result;
17
- }