@xterm/xterm 5.4.0-beta.1

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 (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +235 -0
  3. package/css/xterm.css +209 -0
  4. package/lib/xterm.js +2 -0
  5. package/lib/xterm.js.map +1 -0
  6. package/package.json +101 -0
  7. package/src/browser/AccessibilityManager.ts +278 -0
  8. package/src/browser/Clipboard.ts +93 -0
  9. package/src/browser/ColorContrastCache.ts +34 -0
  10. package/src/browser/Lifecycle.ts +33 -0
  11. package/src/browser/Linkifier2.ts +416 -0
  12. package/src/browser/LocalizableStrings.ts +12 -0
  13. package/src/browser/OscLinkProvider.ts +128 -0
  14. package/src/browser/RenderDebouncer.ts +83 -0
  15. package/src/browser/Terminal.ts +1317 -0
  16. package/src/browser/TimeBasedDebouncer.ts +86 -0
  17. package/src/browser/Types.d.ts +181 -0
  18. package/src/browser/Viewport.ts +401 -0
  19. package/src/browser/decorations/BufferDecorationRenderer.ts +134 -0
  20. package/src/browser/decorations/ColorZoneStore.ts +117 -0
  21. package/src/browser/decorations/OverviewRulerRenderer.ts +218 -0
  22. package/src/browser/input/CompositionHelper.ts +246 -0
  23. package/src/browser/input/Mouse.ts +54 -0
  24. package/src/browser/input/MoveToCell.ts +249 -0
  25. package/src/browser/public/Terminal.ts +260 -0
  26. package/src/browser/renderer/dom/DomRenderer.ts +509 -0
  27. package/src/browser/renderer/dom/DomRendererRowFactory.ts +526 -0
  28. package/src/browser/renderer/dom/WidthCache.ts +160 -0
  29. package/src/browser/renderer/shared/CellColorResolver.ts +137 -0
  30. package/src/browser/renderer/shared/CharAtlasCache.ts +96 -0
  31. package/src/browser/renderer/shared/CharAtlasUtils.ts +75 -0
  32. package/src/browser/renderer/shared/Constants.ts +14 -0
  33. package/src/browser/renderer/shared/CursorBlinkStateManager.ts +146 -0
  34. package/src/browser/renderer/shared/CustomGlyphs.ts +687 -0
  35. package/src/browser/renderer/shared/DevicePixelObserver.ts +41 -0
  36. package/src/browser/renderer/shared/README.md +1 -0
  37. package/src/browser/renderer/shared/RendererUtils.ts +58 -0
  38. package/src/browser/renderer/shared/SelectionRenderModel.ts +91 -0
  39. package/src/browser/renderer/shared/TextureAtlas.ts +1082 -0
  40. package/src/browser/renderer/shared/Types.d.ts +173 -0
  41. package/src/browser/selection/SelectionModel.ts +144 -0
  42. package/src/browser/selection/Types.d.ts +15 -0
  43. package/src/browser/services/CharSizeService.ts +102 -0
  44. package/src/browser/services/CharacterJoinerService.ts +339 -0
  45. package/src/browser/services/CoreBrowserService.ts +137 -0
  46. package/src/browser/services/MouseService.ts +46 -0
  47. package/src/browser/services/RenderService.ts +279 -0
  48. package/src/browser/services/SelectionService.ts +1031 -0
  49. package/src/browser/services/Services.ts +147 -0
  50. package/src/browser/services/ThemeService.ts +237 -0
  51. package/src/common/CircularList.ts +241 -0
  52. package/src/common/Clone.ts +23 -0
  53. package/src/common/Color.ts +357 -0
  54. package/src/common/CoreTerminal.ts +284 -0
  55. package/src/common/EventEmitter.ts +78 -0
  56. package/src/common/InputHandler.ts +3461 -0
  57. package/src/common/Lifecycle.ts +108 -0
  58. package/src/common/MultiKeyMap.ts +42 -0
  59. package/src/common/Platform.ts +44 -0
  60. package/src/common/SortedList.ts +118 -0
  61. package/src/common/TaskQueue.ts +166 -0
  62. package/src/common/TypedArrayUtils.ts +17 -0
  63. package/src/common/Types.d.ts +553 -0
  64. package/src/common/WindowsMode.ts +27 -0
  65. package/src/common/buffer/AttributeData.ts +196 -0
  66. package/src/common/buffer/Buffer.ts +654 -0
  67. package/src/common/buffer/BufferLine.ts +524 -0
  68. package/src/common/buffer/BufferRange.ts +13 -0
  69. package/src/common/buffer/BufferReflow.ts +223 -0
  70. package/src/common/buffer/BufferSet.ts +134 -0
  71. package/src/common/buffer/CellData.ts +94 -0
  72. package/src/common/buffer/Constants.ts +149 -0
  73. package/src/common/buffer/Marker.ts +43 -0
  74. package/src/common/buffer/Types.d.ts +52 -0
  75. package/src/common/data/Charsets.ts +256 -0
  76. package/src/common/data/EscapeSequences.ts +153 -0
  77. package/src/common/input/Keyboard.ts +398 -0
  78. package/src/common/input/TextDecoder.ts +346 -0
  79. package/src/common/input/UnicodeV6.ts +145 -0
  80. package/src/common/input/WriteBuffer.ts +246 -0
  81. package/src/common/input/XParseColor.ts +80 -0
  82. package/src/common/parser/Constants.ts +58 -0
  83. package/src/common/parser/DcsParser.ts +192 -0
  84. package/src/common/parser/EscapeSequenceParser.ts +792 -0
  85. package/src/common/parser/OscParser.ts +238 -0
  86. package/src/common/parser/Params.ts +229 -0
  87. package/src/common/parser/Types.d.ts +275 -0
  88. package/src/common/public/AddonManager.ts +53 -0
  89. package/src/common/public/BufferApiView.ts +35 -0
  90. package/src/common/public/BufferLineApiView.ts +29 -0
  91. package/src/common/public/BufferNamespaceApi.ts +36 -0
  92. package/src/common/public/ParserApi.ts +37 -0
  93. package/src/common/public/UnicodeApi.ts +27 -0
  94. package/src/common/services/BufferService.ts +151 -0
  95. package/src/common/services/CharsetService.ts +34 -0
  96. package/src/common/services/CoreMouseService.ts +318 -0
  97. package/src/common/services/CoreService.ts +87 -0
  98. package/src/common/services/DecorationService.ts +140 -0
  99. package/src/common/services/InstantiationService.ts +85 -0
  100. package/src/common/services/LogService.ts +124 -0
  101. package/src/common/services/OptionsService.ts +202 -0
  102. package/src/common/services/OscLinkService.ts +115 -0
  103. package/src/common/services/ServiceRegistry.ts +49 -0
  104. package/src/common/services/Services.ts +373 -0
  105. package/src/common/services/UnicodeService.ts +111 -0
  106. package/src/headless/Terminal.ts +136 -0
  107. package/src/headless/public/Terminal.ts +195 -0
  108. package/typings/xterm.d.ts +1857 -0
@@ -0,0 +1,256 @@
1
+ /**
2
+ * Copyright (c) 2016 The xterm.js authors. All rights reserved.
3
+ * @license MIT
4
+ */
5
+
6
+ import { ICharset } from 'common/Types';
7
+
8
+ /**
9
+ * The character sets supported by the terminal. These enable several languages
10
+ * to be represented within the terminal with only 8-bit encoding. See ISO 2022
11
+ * for a discussion on character sets. Only VT100 character sets are supported.
12
+ */
13
+ export const CHARSETS: { [key: string]: ICharset | undefined } = {};
14
+
15
+ /**
16
+ * The default character set, US.
17
+ */
18
+ export const DEFAULT_CHARSET: ICharset | undefined = CHARSETS['B'];
19
+
20
+ /**
21
+ * DEC Special Character and Line Drawing Set.
22
+ * Reference: http://vt100.net/docs/vt102-ug/table5-13.html
23
+ * A lot of curses apps use this if they see TERM=xterm.
24
+ * testing: echo -e '\e(0a\e(B'
25
+ * The xterm output sometimes seems to conflict with the
26
+ * reference above. xterm seems in line with the reference
27
+ * when running vttest however.
28
+ * The table below now uses xterm's output from vttest.
29
+ */
30
+ CHARSETS['0'] = {
31
+ '`': '\u25c6', // '◆'
32
+ 'a': '\u2592', // '▒'
33
+ 'b': '\u2409', // '␉' (HT)
34
+ 'c': '\u240c', // '␌' (FF)
35
+ 'd': '\u240d', // '␍' (CR)
36
+ 'e': '\u240a', // '␊' (LF)
37
+ 'f': '\u00b0', // '°'
38
+ 'g': '\u00b1', // '±'
39
+ 'h': '\u2424', // '␤' (NL)
40
+ 'i': '\u240b', // '␋' (VT)
41
+ 'j': '\u2518', // '┘'
42
+ 'k': '\u2510', // '┐'
43
+ 'l': '\u250c', // '┌'
44
+ 'm': '\u2514', // '└'
45
+ 'n': '\u253c', // '┼'
46
+ 'o': '\u23ba', // '⎺'
47
+ 'p': '\u23bb', // '⎻'
48
+ 'q': '\u2500', // '─'
49
+ 'r': '\u23bc', // '⎼'
50
+ 's': '\u23bd', // '⎽'
51
+ 't': '\u251c', // '├'
52
+ 'u': '\u2524', // '┤'
53
+ 'v': '\u2534', // '┴'
54
+ 'w': '\u252c', // '┬'
55
+ 'x': '\u2502', // '│'
56
+ 'y': '\u2264', // '≤'
57
+ 'z': '\u2265', // '≥'
58
+ '{': '\u03c0', // 'π'
59
+ '|': '\u2260', // '≠'
60
+ '}': '\u00a3', // '£'
61
+ '~': '\u00b7' // '·'
62
+ };
63
+
64
+ /**
65
+ * British character set
66
+ * ESC (A
67
+ * Reference: http://vt100.net/docs/vt220-rm/table2-5.html
68
+ */
69
+ CHARSETS['A'] = {
70
+ '#': '£'
71
+ };
72
+
73
+ /**
74
+ * United States character set
75
+ * ESC (B
76
+ */
77
+ CHARSETS['B'] = undefined;
78
+
79
+ /**
80
+ * Dutch character set
81
+ * ESC (4
82
+ * Reference: http://vt100.net/docs/vt220-rm/table2-6.html
83
+ */
84
+ CHARSETS['4'] = {
85
+ '#': '£',
86
+ '@': '¾',
87
+ '[': 'ij',
88
+ '\\': '½',
89
+ ']': '|',
90
+ '{': '¨',
91
+ '|': 'f',
92
+ '}': '¼',
93
+ '~': '´'
94
+ };
95
+
96
+ /**
97
+ * Finnish character set
98
+ * ESC (C or ESC (5
99
+ * Reference: http://vt100.net/docs/vt220-rm/table2-7.html
100
+ */
101
+ CHARSETS['C'] =
102
+ CHARSETS['5'] = {
103
+ '[': 'Ä',
104
+ '\\': 'Ö',
105
+ ']': 'Å',
106
+ '^': 'Ü',
107
+ '`': 'é',
108
+ '{': 'ä',
109
+ '|': 'ö',
110
+ '}': 'å',
111
+ '~': 'ü'
112
+ };
113
+
114
+ /**
115
+ * French character set
116
+ * ESC (R
117
+ * Reference: http://vt100.net/docs/vt220-rm/table2-8.html
118
+ */
119
+ CHARSETS['R'] = {
120
+ '#': '£',
121
+ '@': 'à',
122
+ '[': '°',
123
+ '\\': 'ç',
124
+ ']': '§',
125
+ '{': 'é',
126
+ '|': 'ù',
127
+ '}': 'è',
128
+ '~': '¨'
129
+ };
130
+
131
+ /**
132
+ * French Canadian character set
133
+ * ESC (Q
134
+ * Reference: http://vt100.net/docs/vt220-rm/table2-9.html
135
+ */
136
+ CHARSETS['Q'] = {
137
+ '@': 'à',
138
+ '[': 'â',
139
+ '\\': 'ç',
140
+ ']': 'ê',
141
+ '^': 'î',
142
+ '`': 'ô',
143
+ '{': 'é',
144
+ '|': 'ù',
145
+ '}': 'è',
146
+ '~': 'û'
147
+ };
148
+
149
+ /**
150
+ * German character set
151
+ * ESC (K
152
+ * Reference: http://vt100.net/docs/vt220-rm/table2-10.html
153
+ */
154
+ CHARSETS['K'] = {
155
+ '@': '§',
156
+ '[': 'Ä',
157
+ '\\': 'Ö',
158
+ ']': 'Ü',
159
+ '{': 'ä',
160
+ '|': 'ö',
161
+ '}': 'ü',
162
+ '~': 'ß'
163
+ };
164
+
165
+ /**
166
+ * Italian character set
167
+ * ESC (Y
168
+ * Reference: http://vt100.net/docs/vt220-rm/table2-11.html
169
+ */
170
+ CHARSETS['Y'] = {
171
+ '#': '£',
172
+ '@': '§',
173
+ '[': '°',
174
+ '\\': 'ç',
175
+ ']': 'é',
176
+ '`': 'ù',
177
+ '{': 'à',
178
+ '|': 'ò',
179
+ '}': 'è',
180
+ '~': 'ì'
181
+ };
182
+
183
+ /**
184
+ * Norwegian/Danish character set
185
+ * ESC (E or ESC (6
186
+ * Reference: http://vt100.net/docs/vt220-rm/table2-12.html
187
+ */
188
+ CHARSETS['E'] =
189
+ CHARSETS['6'] = {
190
+ '@': 'Ä',
191
+ '[': 'Æ',
192
+ '\\': 'Ø',
193
+ ']': 'Å',
194
+ '^': 'Ü',
195
+ '`': 'ä',
196
+ '{': 'æ',
197
+ '|': 'ø',
198
+ '}': 'å',
199
+ '~': 'ü'
200
+ };
201
+
202
+ /**
203
+ * Spanish character set
204
+ * ESC (Z
205
+ * Reference: http://vt100.net/docs/vt220-rm/table2-13.html
206
+ */
207
+ CHARSETS['Z'] = {
208
+ '#': '£',
209
+ '@': '§',
210
+ '[': '¡',
211
+ '\\': 'Ñ',
212
+ ']': '¿',
213
+ '{': '°',
214
+ '|': 'ñ',
215
+ '}': 'ç'
216
+ };
217
+
218
+ /**
219
+ * Swedish character set
220
+ * ESC (H or ESC (7
221
+ * Reference: http://vt100.net/docs/vt220-rm/table2-14.html
222
+ */
223
+ CHARSETS['H'] =
224
+ CHARSETS['7'] = {
225
+ '@': 'É',
226
+ '[': 'Ä',
227
+ '\\': 'Ö',
228
+ ']': 'Å',
229
+ '^': 'Ü',
230
+ '`': 'é',
231
+ '{': 'ä',
232
+ '|': 'ö',
233
+ '}': 'å',
234
+ '~': 'ü'
235
+ };
236
+
237
+ /**
238
+ * Swiss character set
239
+ * ESC (=
240
+ * Reference: http://vt100.net/docs/vt220-rm/table2-15.html
241
+ */
242
+ CHARSETS['='] = {
243
+ '#': 'ù',
244
+ '@': 'à',
245
+ '[': 'é',
246
+ '\\': 'ç',
247
+ ']': 'ê',
248
+ '^': 'î',
249
+ // eslint-disable-next-line @typescript-eslint/naming-convention
250
+ '_': 'è',
251
+ '`': 'ô',
252
+ '{': 'ä',
253
+ '|': 'ö',
254
+ '}': 'ü',
255
+ '~': 'û'
256
+ };
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Copyright (c) 2017 The xterm.js authors. All rights reserved.
3
+ * @license MIT
4
+ */
5
+
6
+ /**
7
+ * C0 control codes
8
+ * See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes
9
+ */
10
+ export namespace C0 {
11
+ /** Null (Caret = ^@, C = \0) */
12
+ export const NUL = '\x00';
13
+ /** Start of Heading (Caret = ^A) */
14
+ export const SOH = '\x01';
15
+ /** Start of Text (Caret = ^B) */
16
+ export const STX = '\x02';
17
+ /** End of Text (Caret = ^C) */
18
+ export const ETX = '\x03';
19
+ /** End of Transmission (Caret = ^D) */
20
+ export const EOT = '\x04';
21
+ /** Enquiry (Caret = ^E) */
22
+ export const ENQ = '\x05';
23
+ /** Acknowledge (Caret = ^F) */
24
+ export const ACK = '\x06';
25
+ /** Bell (Caret = ^G, C = \a) */
26
+ export const BEL = '\x07';
27
+ /** Backspace (Caret = ^H, C = \b) */
28
+ export const BS = '\x08';
29
+ /** Character Tabulation, Horizontal Tabulation (Caret = ^I, C = \t) */
30
+ export const HT = '\x09';
31
+ /** Line Feed (Caret = ^J, C = \n) */
32
+ export const LF = '\x0a';
33
+ /** Line Tabulation, Vertical Tabulation (Caret = ^K, C = \v) */
34
+ export const VT = '\x0b';
35
+ /** Form Feed (Caret = ^L, C = \f) */
36
+ export const FF = '\x0c';
37
+ /** Carriage Return (Caret = ^M, C = \r) */
38
+ export const CR = '\x0d';
39
+ /** Shift Out (Caret = ^N) */
40
+ export const SO = '\x0e';
41
+ /** Shift In (Caret = ^O) */
42
+ export const SI = '\x0f';
43
+ /** Data Link Escape (Caret = ^P) */
44
+ export const DLE = '\x10';
45
+ /** Device Control One (XON) (Caret = ^Q) */
46
+ export const DC1 = '\x11';
47
+ /** Device Control Two (Caret = ^R) */
48
+ export const DC2 = '\x12';
49
+ /** Device Control Three (XOFF) (Caret = ^S) */
50
+ export const DC3 = '\x13';
51
+ /** Device Control Four (Caret = ^T) */
52
+ export const DC4 = '\x14';
53
+ /** Negative Acknowledge (Caret = ^U) */
54
+ export const NAK = '\x15';
55
+ /** Synchronous Idle (Caret = ^V) */
56
+ export const SYN = '\x16';
57
+ /** End of Transmission Block (Caret = ^W) */
58
+ export const ETB = '\x17';
59
+ /** Cancel (Caret = ^X) */
60
+ export const CAN = '\x18';
61
+ /** End of Medium (Caret = ^Y) */
62
+ export const EM = '\x19';
63
+ /** Substitute (Caret = ^Z) */
64
+ export const SUB = '\x1a';
65
+ /** Escape (Caret = ^[, C = \e) */
66
+ export const ESC = '\x1b';
67
+ /** File Separator (Caret = ^\) */
68
+ export const FS = '\x1c';
69
+ /** Group Separator (Caret = ^]) */
70
+ export const GS = '\x1d';
71
+ /** Record Separator (Caret = ^^) */
72
+ export const RS = '\x1e';
73
+ /** Unit Separator (Caret = ^_) */
74
+ export const US = '\x1f';
75
+ /** Space */
76
+ export const SP = '\x20';
77
+ /** Delete (Caret = ^?) */
78
+ export const DEL = '\x7f';
79
+ }
80
+
81
+ /**
82
+ * C1 control codes
83
+ * See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes
84
+ */
85
+ export namespace C1 {
86
+ /** padding character */
87
+ export const PAD = '\x80';
88
+ /** High Octet Preset */
89
+ export const HOP = '\x81';
90
+ /** Break Permitted Here */
91
+ export const BPH = '\x82';
92
+ /** No Break Here */
93
+ export const NBH = '\x83';
94
+ /** Index */
95
+ export const IND = '\x84';
96
+ /** Next Line */
97
+ export const NEL = '\x85';
98
+ /** Start of Selected Area */
99
+ export const SSA = '\x86';
100
+ /** End of Selected Area */
101
+ export const ESA = '\x87';
102
+ /** Horizontal Tabulation Set */
103
+ export const HTS = '\x88';
104
+ /** Horizontal Tabulation With Justification */
105
+ export const HTJ = '\x89';
106
+ /** Vertical Tabulation Set */
107
+ export const VTS = '\x8a';
108
+ /** Partial Line Down */
109
+ export const PLD = '\x8b';
110
+ /** Partial Line Up */
111
+ export const PLU = '\x8c';
112
+ /** Reverse Index */
113
+ export const RI = '\x8d';
114
+ /** Single-Shift 2 */
115
+ export const SS2 = '\x8e';
116
+ /** Single-Shift 3 */
117
+ export const SS3 = '\x8f';
118
+ /** Device Control String */
119
+ export const DCS = '\x90';
120
+ /** Private Use 1 */
121
+ export const PU1 = '\x91';
122
+ /** Private Use 2 */
123
+ export const PU2 = '\x92';
124
+ /** Set Transmit State */
125
+ export const STS = '\x93';
126
+ /** Destructive backspace, intended to eliminate ambiguity about meaning of BS. */
127
+ export const CCH = '\x94';
128
+ /** Message Waiting */
129
+ export const MW = '\x95';
130
+ /** Start of Protected Area */
131
+ export const SPA = '\x96';
132
+ /** End of Protected Area */
133
+ export const EPA = '\x97';
134
+ /** Start of String */
135
+ export const SOS = '\x98';
136
+ /** Single Graphic Character Introducer */
137
+ export const SGCI = '\x99';
138
+ /** Single Character Introducer */
139
+ export const SCI = '\x9a';
140
+ /** Control Sequence Introducer */
141
+ export const CSI = '\x9b';
142
+ /** String Terminator */
143
+ export const ST = '\x9c';
144
+ /** Operating System Command */
145
+ export const OSC = '\x9d';
146
+ /** Privacy Message */
147
+ export const PM = '\x9e';
148
+ /** Application Program Command */
149
+ export const APC = '\x9f';
150
+ }
151
+ export namespace C1_ESCAPED {
152
+ export const ST = `${C0.ESC}\\`;
153
+ }