@xterm/xterm 6.1.0-beta.18 → 6.1.0-beta.180

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 (156) 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 +25 -14
  8. package/src/browser/AccessibilityManager.ts +6 -3
  9. package/src/browser/Clipboard.ts +6 -3
  10. package/src/browser/CoreBrowserTerminal.ts +142 -62
  11. package/src/browser/Dom.ts +178 -0
  12. package/src/browser/Linkifier.ts +3 -3
  13. package/src/browser/OscLinkProvider.ts +3 -1
  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 +40 -17
  18. package/src/browser/decorations/BufferDecorationRenderer.ts +1 -1
  19. package/src/browser/decorations/OverviewRulerRenderer.ts +15 -16
  20. package/src/browser/input/CompositionHelper.ts +16 -1
  21. package/src/browser/public/Terminal.ts +24 -27
  22. package/src/browser/renderer/dom/DomRenderer.ts +128 -8
  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 +481 -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/MouseService.ts +2 -1
  47. package/src/browser/services/RenderService.ts +22 -15
  48. package/src/browser/services/SelectionService.ts +12 -4
  49. package/src/browser/services/Services.ts +24 -15
  50. package/src/browser/services/ThemeService.ts +2 -2
  51. package/src/common/Async.ts +105 -0
  52. package/src/common/CircularList.ts +2 -2
  53. package/src/common/Color.ts +8 -0
  54. package/src/common/CoreTerminal.ts +21 -11
  55. package/src/common/Event.ts +118 -0
  56. package/src/common/InputHandler.ts +244 -24
  57. package/src/common/Lifecycle.ts +113 -0
  58. package/src/common/Platform.ts +13 -3
  59. package/src/common/SortedList.ts +7 -3
  60. package/src/common/TaskQueue.ts +9 -3
  61. package/src/common/Types.ts +29 -9
  62. package/src/common/Version.ts +9 -0
  63. package/src/common/buffer/Buffer.ts +20 -14
  64. package/src/common/buffer/BufferLine.ts +4 -5
  65. package/src/common/buffer/BufferSet.ts +7 -6
  66. package/src/common/buffer/CellData.ts +57 -0
  67. package/src/common/buffer/Marker.ts +2 -2
  68. package/src/common/buffer/Types.ts +6 -2
  69. package/src/common/data/EscapeSequences.ts +71 -70
  70. package/src/common/input/Keyboard.ts +14 -7
  71. package/src/common/input/KittyKeyboard.ts +491 -0
  72. package/src/common/input/Win32InputMode.ts +297 -0
  73. package/src/common/input/WriteBuffer.ts +34 -2
  74. package/src/common/input/XParseColor.ts +2 -2
  75. package/src/common/parser/ApcParser.ts +245 -0
  76. package/src/common/parser/Constants.ts +22 -4
  77. package/src/common/parser/DcsParser.ts +5 -5
  78. package/src/common/parser/EscapeSequenceParser.ts +75 -22
  79. package/src/common/parser/OscParser.ts +5 -5
  80. package/src/common/parser/Types.ts +34 -1
  81. package/src/common/public/BufferLineApiView.ts +2 -2
  82. package/src/common/public/BufferNamespaceApi.ts +2 -2
  83. package/src/common/public/ParserApi.ts +3 -0
  84. package/src/common/services/BufferService.ts +8 -5
  85. package/src/common/services/CharsetService.ts +4 -0
  86. package/src/common/services/CoreMouseService.ts +2 -2
  87. package/src/common/services/CoreService.ts +18 -4
  88. package/src/common/services/DecorationService.ts +24 -8
  89. package/src/common/services/LogService.ts +1 -31
  90. package/src/common/services/OptionsService.ts +13 -4
  91. package/src/common/services/Services.ts +39 -16
  92. package/src/common/services/UnicodeService.ts +1 -1
  93. package/typings/xterm.d.ts +319 -35
  94. package/src/common/TypedArrayUtils.ts +0 -17
  95. package/src/vs/base/browser/browser.ts +0 -141
  96. package/src/vs/base/browser/canIUse.ts +0 -49
  97. package/src/vs/base/browser/dom.ts +0 -2369
  98. package/src/vs/base/browser/fastDomNode.ts +0 -316
  99. package/src/vs/base/browser/globalPointerMoveMonitor.ts +0 -112
  100. package/src/vs/base/browser/iframe.ts +0 -135
  101. package/src/vs/base/browser/keyboardEvent.ts +0 -213
  102. package/src/vs/base/browser/mouseEvent.ts +0 -229
  103. package/src/vs/base/browser/touch.ts +0 -372
  104. package/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts +0 -303
  105. package/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts +0 -114
  106. package/src/vs/base/browser/ui/scrollbar/scrollableElement.ts +0 -720
  107. package/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts +0 -165
  108. package/src/vs/base/browser/ui/scrollbar/scrollbarArrow.ts +0 -114
  109. package/src/vs/base/browser/ui/scrollbar/scrollbarState.ts +0 -243
  110. package/src/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.ts +0 -118
  111. package/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts +0 -116
  112. package/src/vs/base/browser/ui/widget.ts +0 -57
  113. package/src/vs/base/browser/window.ts +0 -14
  114. package/src/vs/base/common/arrays.ts +0 -887
  115. package/src/vs/base/common/arraysFind.ts +0 -202
  116. package/src/vs/base/common/assert.ts +0 -71
  117. package/src/vs/base/common/async.ts +0 -1992
  118. package/src/vs/base/common/cancellation.ts +0 -148
  119. package/src/vs/base/common/charCode.ts +0 -450
  120. package/src/vs/base/common/collections.ts +0 -140
  121. package/src/vs/base/common/decorators.ts +0 -130
  122. package/src/vs/base/common/equals.ts +0 -146
  123. package/src/vs/base/common/errors.ts +0 -303
  124. package/src/vs/base/common/event.ts +0 -1778
  125. package/src/vs/base/common/functional.ts +0 -32
  126. package/src/vs/base/common/hash.ts +0 -316
  127. package/src/vs/base/common/iterator.ts +0 -159
  128. package/src/vs/base/common/keyCodes.ts +0 -526
  129. package/src/vs/base/common/keybindings.ts +0 -284
  130. package/src/vs/base/common/lazy.ts +0 -47
  131. package/src/vs/base/common/lifecycle.ts +0 -801
  132. package/src/vs/base/common/linkedList.ts +0 -142
  133. package/src/vs/base/common/map.ts +0 -202
  134. package/src/vs/base/common/numbers.ts +0 -98
  135. package/src/vs/base/common/observable.ts +0 -76
  136. package/src/vs/base/common/observableInternal/api.ts +0 -31
  137. package/src/vs/base/common/observableInternal/autorun.ts +0 -281
  138. package/src/vs/base/common/observableInternal/base.ts +0 -489
  139. package/src/vs/base/common/observableInternal/debugName.ts +0 -145
  140. package/src/vs/base/common/observableInternal/derived.ts +0 -428
  141. package/src/vs/base/common/observableInternal/lazyObservableValue.ts +0 -146
  142. package/src/vs/base/common/observableInternal/logging.ts +0 -328
  143. package/src/vs/base/common/observableInternal/promise.ts +0 -209
  144. package/src/vs/base/common/observableInternal/utils.ts +0 -610
  145. package/src/vs/base/common/platform.ts +0 -281
  146. package/src/vs/base/common/scrollable.ts +0 -522
  147. package/src/vs/base/common/sequence.ts +0 -34
  148. package/src/vs/base/common/stopwatch.ts +0 -43
  149. package/src/vs/base/common/strings.ts +0 -557
  150. package/src/vs/base/common/symbols.ts +0 -9
  151. package/src/vs/base/common/uint.ts +0 -59
  152. package/src/vs/patches/nls.ts +0 -90
  153. package/src/vs/typings/base-common.d.ts +0 -20
  154. package/src/vs/typings/require.d.ts +0 -42
  155. package/src/vs/typings/vscode-globals-nls.d.ts +0 -36
  156. package/src/vs/typings/vscode-globals-product.d.ts +0 -33
@@ -1,284 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- *--------------------------------------------------------------------------------------------*/
5
-
6
- import { illegalArgument } from 'vs/base/common/errors';
7
- import { KeyCode, ScanCode } from 'vs/base/common/keyCodes';
8
- import { OperatingSystem } from 'vs/base/common/platform';
9
-
10
- /**
11
- * Binary encoding strategy:
12
- * ```
13
- * 1111 11
14
- * 5432 1098 7654 3210
15
- * ---- CSAW KKKK KKKK
16
- * C = bit 11 = ctrlCmd flag
17
- * S = bit 10 = shift flag
18
- * A = bit 9 = alt flag
19
- * W = bit 8 = winCtrl flag
20
- * K = bits 0-7 = key code
21
- * ```
22
- */
23
- const enum BinaryKeybindingsMask {
24
- CtrlCmd = (1 << 11) >>> 0,
25
- Shift = (1 << 10) >>> 0,
26
- Alt = (1 << 9) >>> 0,
27
- WinCtrl = (1 << 8) >>> 0,
28
- KeyCode = 0x000000FF
29
- }
30
-
31
- export function decodeKeybinding(keybinding: number | number[], OS: OperatingSystem): Keybinding | null {
32
- if (typeof keybinding === 'number') {
33
- if (keybinding === 0) {
34
- return null;
35
- }
36
- const firstChord = (keybinding & 0x0000FFFF) >>> 0;
37
- const secondChord = (keybinding & 0xFFFF0000) >>> 16;
38
- if (secondChord !== 0) {
39
- return new Keybinding([
40
- createSimpleKeybinding(firstChord, OS),
41
- createSimpleKeybinding(secondChord, OS)
42
- ]);
43
- }
44
- return new Keybinding([createSimpleKeybinding(firstChord, OS)]);
45
- } else {
46
- const chords = [];
47
- for (let i = 0; i < keybinding.length; i++) {
48
- chords.push(createSimpleKeybinding(keybinding[i], OS));
49
- }
50
- return new Keybinding(chords);
51
- }
52
- }
53
-
54
- export function createSimpleKeybinding(keybinding: number, OS: OperatingSystem): KeyCodeChord {
55
-
56
- const ctrlCmd = (keybinding & BinaryKeybindingsMask.CtrlCmd ? true : false);
57
- const winCtrl = (keybinding & BinaryKeybindingsMask.WinCtrl ? true : false);
58
-
59
- const ctrlKey = (OS === OperatingSystem.Macintosh ? winCtrl : ctrlCmd);
60
- const shiftKey = (keybinding & BinaryKeybindingsMask.Shift ? true : false);
61
- const altKey = (keybinding & BinaryKeybindingsMask.Alt ? true : false);
62
- const metaKey = (OS === OperatingSystem.Macintosh ? ctrlCmd : winCtrl);
63
- const keyCode = (keybinding & BinaryKeybindingsMask.KeyCode);
64
-
65
- return new KeyCodeChord(ctrlKey, shiftKey, altKey, metaKey, keyCode);
66
- }
67
-
68
- export interface Modifiers {
69
- readonly ctrlKey: boolean;
70
- readonly shiftKey: boolean;
71
- readonly altKey: boolean;
72
- readonly metaKey: boolean;
73
- }
74
-
75
- /**
76
- * Represents a chord which uses the `keyCode` field of keyboard events.
77
- * A chord is a combination of keys pressed simultaneously.
78
- */
79
- export class KeyCodeChord implements Modifiers {
80
-
81
- constructor(
82
- public readonly ctrlKey: boolean,
83
- public readonly shiftKey: boolean,
84
- public readonly altKey: boolean,
85
- public readonly metaKey: boolean,
86
- public readonly keyCode: KeyCode
87
- ) { }
88
-
89
- public equals(other: Chord): boolean {
90
- return (
91
- other instanceof KeyCodeChord
92
- && this.ctrlKey === other.ctrlKey
93
- && this.shiftKey === other.shiftKey
94
- && this.altKey === other.altKey
95
- && this.metaKey === other.metaKey
96
- && this.keyCode === other.keyCode
97
- );
98
- }
99
-
100
- public getHashCode(): string {
101
- const ctrl = this.ctrlKey ? '1' : '0';
102
- const shift = this.shiftKey ? '1' : '0';
103
- const alt = this.altKey ? '1' : '0';
104
- const meta = this.metaKey ? '1' : '0';
105
- return `K${ctrl}${shift}${alt}${meta}${this.keyCode}`;
106
- }
107
-
108
- public isModifierKey(): boolean {
109
- return (
110
- this.keyCode === KeyCode.Unknown
111
- || this.keyCode === KeyCode.Ctrl
112
- || this.keyCode === KeyCode.Meta
113
- || this.keyCode === KeyCode.Alt
114
- || this.keyCode === KeyCode.Shift
115
- );
116
- }
117
-
118
- public toKeybinding(): Keybinding {
119
- return new Keybinding([this]);
120
- }
121
-
122
- /**
123
- * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?
124
- */
125
- public isDuplicateModifierCase(): boolean {
126
- return (
127
- (this.ctrlKey && this.keyCode === KeyCode.Ctrl)
128
- || (this.shiftKey && this.keyCode === KeyCode.Shift)
129
- || (this.altKey && this.keyCode === KeyCode.Alt)
130
- || (this.metaKey && this.keyCode === KeyCode.Meta)
131
- );
132
- }
133
- }
134
-
135
- /**
136
- * Represents a chord which uses the `code` field of keyboard events.
137
- * A chord is a combination of keys pressed simultaneously.
138
- */
139
- export class ScanCodeChord implements Modifiers {
140
-
141
- constructor(
142
- public readonly ctrlKey: boolean,
143
- public readonly shiftKey: boolean,
144
- public readonly altKey: boolean,
145
- public readonly metaKey: boolean,
146
- public readonly scanCode: ScanCode
147
- ) { }
148
-
149
- public equals(other: Chord): boolean {
150
- return (
151
- other instanceof ScanCodeChord
152
- && this.ctrlKey === other.ctrlKey
153
- && this.shiftKey === other.shiftKey
154
- && this.altKey === other.altKey
155
- && this.metaKey === other.metaKey
156
- && this.scanCode === other.scanCode
157
- );
158
- }
159
-
160
- public getHashCode(): string {
161
- const ctrl = this.ctrlKey ? '1' : '0';
162
- const shift = this.shiftKey ? '1' : '0';
163
- const alt = this.altKey ? '1' : '0';
164
- const meta = this.metaKey ? '1' : '0';
165
- return `S${ctrl}${shift}${alt}${meta}${this.scanCode}`;
166
- }
167
-
168
- /**
169
- * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?
170
- */
171
- public isDuplicateModifierCase(): boolean {
172
- return (
173
- (this.ctrlKey && (this.scanCode === ScanCode.ControlLeft || this.scanCode === ScanCode.ControlRight))
174
- || (this.shiftKey && (this.scanCode === ScanCode.ShiftLeft || this.scanCode === ScanCode.ShiftRight))
175
- || (this.altKey && (this.scanCode === ScanCode.AltLeft || this.scanCode === ScanCode.AltRight))
176
- || (this.metaKey && (this.scanCode === ScanCode.MetaLeft || this.scanCode === ScanCode.MetaRight))
177
- );
178
- }
179
- }
180
-
181
- export type Chord = KeyCodeChord | ScanCodeChord;
182
-
183
- /**
184
- * A keybinding is a sequence of chords.
185
- */
186
- export class Keybinding {
187
-
188
- public readonly chords: Chord[];
189
-
190
- constructor(chords: Chord[]) {
191
- if (chords.length === 0) {
192
- throw illegalArgument(`chords`);
193
- }
194
- this.chords = chords;
195
- }
196
-
197
- public getHashCode(): string {
198
- let result = '';
199
- for (let i = 0, len = this.chords.length; i < len; i++) {
200
- if (i !== 0) {
201
- result += ';';
202
- }
203
- result += this.chords[i].getHashCode();
204
- }
205
- return result;
206
- }
207
-
208
- public equals(other: Keybinding | null): boolean {
209
- if (other === null) {
210
- return false;
211
- }
212
- if (this.chords.length !== other.chords.length) {
213
- return false;
214
- }
215
- for (let i = 0; i < this.chords.length; i++) {
216
- if (!this.chords[i].equals(other.chords[i])) {
217
- return false;
218
- }
219
- }
220
- return true;
221
- }
222
- }
223
-
224
- export class ResolvedChord {
225
- constructor(
226
- public readonly ctrlKey: boolean,
227
- public readonly shiftKey: boolean,
228
- public readonly altKey: boolean,
229
- public readonly metaKey: boolean,
230
- public readonly keyLabel: string | null,
231
- public readonly keyAriaLabel: string | null
232
- ) { }
233
- }
234
-
235
- export type SingleModifierChord = 'ctrl' | 'shift' | 'alt' | 'meta';
236
-
237
- /**
238
- * A resolved keybinding. Consists of one or multiple chords.
239
- */
240
- export abstract class ResolvedKeybinding {
241
- /**
242
- * This prints the binding in a format suitable for displaying in the UI.
243
- */
244
- public abstract getLabel(): string | null;
245
- /**
246
- * This prints the binding in a format suitable for ARIA.
247
- */
248
- public abstract getAriaLabel(): string | null;
249
- /**
250
- * This prints the binding in a format suitable for electron's accelerators.
251
- * See https://github.com/electron/electron/blob/master/docs/api/accelerator.md
252
- */
253
- public abstract getElectronAccelerator(): string | null;
254
- /**
255
- * This prints the binding in a format suitable for user settings.
256
- */
257
- public abstract getUserSettingsLabel(): string | null;
258
- /**
259
- * Is the user settings label reflecting the label?
260
- */
261
- public abstract isWYSIWYG(): boolean;
262
- /**
263
- * Does the keybinding consist of more than one chord?
264
- */
265
- public abstract hasMultipleChords(): boolean;
266
- /**
267
- * Returns the chords that comprise of the keybinding.
268
- */
269
- public abstract getChords(): ResolvedChord[];
270
- /**
271
- * Returns the chords as strings useful for dispatching.
272
- * Returns null for modifier only chords.
273
- * @example keybinding "Shift" -> null
274
- * @example keybinding ("D" with shift == true) -> "shift+D"
275
- */
276
- public abstract getDispatchChords(): (string | null)[];
277
- /**
278
- * Returns the modifier only chords as strings useful for dispatching.
279
- * Returns null for chords that contain more than one modifier or a regular key.
280
- * @example keybinding "Shift" -> "shift"
281
- * @example keybinding ("D" with shift == true") -> null
282
- */
283
- public abstract getSingleModifierDispatchChords(): (SingleModifierChord | null)[];
284
- }
@@ -1,47 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for license information.
4
- *--------------------------------------------------------------------------------------------*/
5
-
6
- export class Lazy<T> {
7
-
8
- private _didRun: boolean = false;
9
- private _value?: T;
10
- private _error: Error | undefined;
11
-
12
- constructor(
13
- private readonly executor: () => T,
14
- ) { }
15
-
16
- /**
17
- * True if the lazy value has been resolved.
18
- */
19
- get hasValue() { return this._didRun; }
20
-
21
- /**
22
- * Get the wrapped value.
23
- *
24
- * This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only
25
- * resolved once. `getValue` will re-throw exceptions that are hit while resolving the value
26
- */
27
- get value(): T {
28
- if (!this._didRun) {
29
- try {
30
- this._value = this.executor();
31
- } catch (err) {
32
- this._error = err;
33
- } finally {
34
- this._didRun = true;
35
- }
36
- }
37
- if (this._error) {
38
- throw this._error;
39
- }
40
- return this._value!;
41
- }
42
-
43
- /**
44
- * Get the wrapped value without forcing evaluation.
45
- */
46
- get rawValue(): T | undefined { return this._value; }
47
- }