@jrichman/ink 6.4.13 → 6.5.1-beta.0
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/build/dom.d.ts +3 -3
- package/build/output.d.ts +3 -3
- package/build/output.js +5 -2
- package/build/output.js.map +1 -1
- package/build/render-cached.js +1 -1
- package/build/render-cached.js.map +1 -1
- package/build/render-container.d.ts +2 -0
- package/build/render-container.js +13 -16
- package/build/render-container.js.map +1 -1
- package/build/render-node-to-output.js +2 -0
- package/build/render-node-to-output.js.map +1 -1
- package/build/render-sticky.d.ts +2 -2
- package/build/render-sticky.js.map +1 -1
- package/build/render-worker.d.ts +25 -0
- package/build/render-worker.js +370 -0
- package/build/render-worker.js.map +1 -0
- package/build/serialization.d.ts +1 -1
- package/build/serialization.js.map +1 -1
- package/build/terminal-buffer.d.ts +3 -1
- package/build/terminal-buffer.js +17 -5
- package/build/terminal-buffer.js.map +1 -1
- package/build/terminal-writer.d.ts +69 -0
- package/build/terminal-writer.js +546 -0
- package/build/terminal-writer.js.map +1 -0
- package/build/web/ansi-to-css.d.ts +16 -0
- package/build/web/ansi-to-css.js +147 -0
- package/build/web/ansi-to-css.js.map +1 -0
- package/build/web/client.d.ts +51 -0
- package/build/web/client.js +315 -0
- package/build/web/client.js.map +1 -0
- package/build/web/server.d.ts +1 -0
- package/build/web/server.js +179 -0
- package/build/web/server.js.map +1 -0
- package/build/worker/dump-replay.d.ts +1 -0
- package/build/worker/dump-replay.js +15 -0
- package/build/worker/dump-replay.js.map +1 -0
- package/build/worker/replay.d.ts +55 -0
- package/build/worker/replay.js +133 -0
- package/build/worker/replay.js.map +1 -0
- package/build/worker/scene-manager.js +6 -5
- package/build/worker/scene-manager.js.map +1 -1
- package/build/worker/terminal-writer.d.ts +1 -1
- package/build/worker/terminal-writer.js +4 -2
- package/build/worker/terminal-writer.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
import ansiEscapes from 'ansi-escapes';
|
|
2
|
+
import { styledCharsToString } from '@alcalzone/ansi-tokenize';
|
|
3
|
+
import { debugLog } from './debug-log.js';
|
|
4
|
+
import colorize from './colorize.js';
|
|
5
|
+
const enterSynchronizedOutput = '\u001B[?2026h';
|
|
6
|
+
const exitSynchronizedOutput = '\u001B[?2026l';
|
|
7
|
+
const synchronizeOutput = false;
|
|
8
|
+
export const rainbowColors = [
|
|
9
|
+
'red',
|
|
10
|
+
'green',
|
|
11
|
+
'yellow',
|
|
12
|
+
'blue',
|
|
13
|
+
'magenta',
|
|
14
|
+
'cyan',
|
|
15
|
+
'white',
|
|
16
|
+
'blackBright',
|
|
17
|
+
'redBright',
|
|
18
|
+
'greenBright',
|
|
19
|
+
'yellowBright',
|
|
20
|
+
'blueBright',
|
|
21
|
+
'magentaBright',
|
|
22
|
+
'cyanBright',
|
|
23
|
+
'whiteBright',
|
|
24
|
+
];
|
|
25
|
+
const moveCursorDown = (skippedLines) => {
|
|
26
|
+
if (skippedLines > 0) {
|
|
27
|
+
if (skippedLines === 1) {
|
|
28
|
+
return ansiEscapes.cursorNextLine;
|
|
29
|
+
}
|
|
30
|
+
return ansiEscapes.cursorDown(skippedLines);
|
|
31
|
+
}
|
|
32
|
+
return '';
|
|
33
|
+
};
|
|
34
|
+
const moveCursorUp = (skippedLines) => {
|
|
35
|
+
if (skippedLines > 0) {
|
|
36
|
+
if (skippedLines === 1) {
|
|
37
|
+
return ansiEscapes.cursorPrevLine;
|
|
38
|
+
}
|
|
39
|
+
return ansiEscapes.cursorUp(skippedLines);
|
|
40
|
+
}
|
|
41
|
+
return '';
|
|
42
|
+
};
|
|
43
|
+
const setScrollRegionCode = (top, bottom) => {
|
|
44
|
+
return `\u001B[${top};${bottom}r`;
|
|
45
|
+
};
|
|
46
|
+
const resetScrollRegion = '\u001B[r';
|
|
47
|
+
export function linesEqual(lineA, lineB) {
|
|
48
|
+
if (lineA === lineB) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
if (!lineA || !lineB) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
if (lineA.length !== lineB.length) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
for (const [i, charA] of lineA.entries()) {
|
|
58
|
+
const charB = lineB[i];
|
|
59
|
+
if (charA.value !== charB.value || charA.fullWidth !== charB.fullWidth) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
if (charA.styles.length !== charB.styles.length) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
for (const [j, styleA] of charA.styles.entries()) {
|
|
66
|
+
const styleB = charB.styles[j];
|
|
67
|
+
if (styleA.code !== styleB.code || styleA.endCode !== styleB.endCode) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
export class TerminalWriter {
|
|
75
|
+
columns;
|
|
76
|
+
rows;
|
|
77
|
+
stdout;
|
|
78
|
+
isTainted = false;
|
|
79
|
+
debugRainbowColor;
|
|
80
|
+
screen = [];
|
|
81
|
+
backbuffer = [];
|
|
82
|
+
cursorX = -1;
|
|
83
|
+
cursorY = -1;
|
|
84
|
+
scrollRegionTop = -1;
|
|
85
|
+
scrollRegionBottom = -1;
|
|
86
|
+
firstRender = true;
|
|
87
|
+
enableSynchronizedOutput = synchronizeOutput;
|
|
88
|
+
cancelSlowFlush;
|
|
89
|
+
outputBuffer = [];
|
|
90
|
+
currentChunkBuffer = [];
|
|
91
|
+
constructor(columns, rows, stdout) {
|
|
92
|
+
this.columns = columns;
|
|
93
|
+
this.rows = rows;
|
|
94
|
+
this.stdout = stdout;
|
|
95
|
+
}
|
|
96
|
+
unkownCursorLocation() {
|
|
97
|
+
this.cursorX = -1;
|
|
98
|
+
this.cursorY = -1;
|
|
99
|
+
}
|
|
100
|
+
getBackbufferLength() {
|
|
101
|
+
return this.backbuffer.length;
|
|
102
|
+
}
|
|
103
|
+
getBackbufferEntry(index) {
|
|
104
|
+
return this.backbuffer[index];
|
|
105
|
+
}
|
|
106
|
+
getScreenLine(y) {
|
|
107
|
+
return this.screen[y];
|
|
108
|
+
}
|
|
109
|
+
get isFirstRender() {
|
|
110
|
+
return this.firstRender;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Append lines to the backbuffer leaving the on screen content unchanged.
|
|
114
|
+
*/
|
|
115
|
+
appendLinesBackbuffer(lines) {
|
|
116
|
+
this.startSynchronizedOutput();
|
|
117
|
+
try {
|
|
118
|
+
// The terminal lacks an API to scroll lines to the back buffer without first adding them to the main buffer.
|
|
119
|
+
// Therefore, we simulate this by performing a scroll up of the top line(s) of the terminal,
|
|
120
|
+
// then re-adding the visible lines to the terminal.
|
|
121
|
+
// The minimum supported viewport height is 2 requiring us to scroll 2 lines.
|
|
122
|
+
this.performScroll({
|
|
123
|
+
start: 0,
|
|
124
|
+
end: 2,
|
|
125
|
+
linesToScroll: lines.length,
|
|
126
|
+
// We add the lines that are currently on screen at the very
|
|
127
|
+
// end to avoid corrupting the content currently on screen.
|
|
128
|
+
lines: [...lines, ...this.screen.slice(0, 2)],
|
|
129
|
+
direction: 'up',
|
|
130
|
+
scrollToBackbuffer: true
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
finally {
|
|
134
|
+
this.endSynchronizedOutput();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
updateBackbuffer(start, deleteCount, newLines) {
|
|
138
|
+
const backbufferLength = this.backbuffer.length;
|
|
139
|
+
const screenStart = Math.max(0, backbufferLength - this.rows);
|
|
140
|
+
// Case 1: Append at the very end
|
|
141
|
+
if (start === backbufferLength && deleteCount === 0) {
|
|
142
|
+
this.appendLinesBackbuffer(newLines);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
// Case 2: Within the screen
|
|
146
|
+
if (start >= screenStart) {
|
|
147
|
+
this.backbuffer.splice(start, deleteCount, ...newLines);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
// Case 3: Other cases (outside screen, not append)
|
|
151
|
+
this.isTainted = true;
|
|
152
|
+
}
|
|
153
|
+
writeLines(lines) {
|
|
154
|
+
if (this.backbuffer.length > 0 || this.screen.length > 0) {
|
|
155
|
+
throw new Error(`writeLines can only be called on an empty terminal. Sizes = ${this.backbuffer.length}, ${this.screen.length}`);
|
|
156
|
+
}
|
|
157
|
+
const backBufferLength = Math.max(0, lines.length - this.rows);
|
|
158
|
+
for (const [i, line] of lines.entries()) {
|
|
159
|
+
const clampedLine = this.clampLine(line.styledChars, this.columns);
|
|
160
|
+
let textToWrite = clampedLine.text;
|
|
161
|
+
if (this.debugRainbowColor) {
|
|
162
|
+
textToWrite = colorize(textToWrite, this.debugRainbowColor, 'background');
|
|
163
|
+
}
|
|
164
|
+
this.writeHelper(textToWrite);
|
|
165
|
+
if (i < this.rows && this.isFirstRender) {
|
|
166
|
+
// Need to clear any text we might be rendering on top of.
|
|
167
|
+
this.writeHelper(ansiEscapes.eraseEndLine);
|
|
168
|
+
if (i + 1 < lines.length) {
|
|
169
|
+
this.writeHelper('\n');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (i < backBufferLength) {
|
|
173
|
+
this.backbuffer.push(clampedLine);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
this.screen.push(clampedLine);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (this.isFirstRender) {
|
|
180
|
+
/// Clean up lines at the bottom of the screen if we
|
|
181
|
+
// rendered at less than the terminal height.
|
|
182
|
+
for (let row = lines.length; row < this.rows; row++) {
|
|
183
|
+
this.writeHelper('\n' + ansiEscapes.eraseEndLine);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
this.cursorX = -1;
|
|
187
|
+
this.cursorY = -1;
|
|
188
|
+
this.finishChunk();
|
|
189
|
+
}
|
|
190
|
+
moveCursor(x, y) {
|
|
191
|
+
const diff = x - this.cursorY;
|
|
192
|
+
if (this.cursorY < 0 ||
|
|
193
|
+
this.cursorX < 0 ||
|
|
194
|
+
x !== this.cursorY ||
|
|
195
|
+
y !== this.cursorX) {
|
|
196
|
+
this.writeHelper(ansiEscapes.cursorTo(y, x));
|
|
197
|
+
this.cursorY = x;
|
|
198
|
+
this.cursorX = y;
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (diff > 0) {
|
|
202
|
+
this.writeHelper(moveCursorDown(diff));
|
|
203
|
+
}
|
|
204
|
+
else if (diff < 0) {
|
|
205
|
+
this.writeHelper(moveCursorUp(-diff));
|
|
206
|
+
}
|
|
207
|
+
this.cursorY = x;
|
|
208
|
+
if (y !== this.cursorX) {
|
|
209
|
+
if (y === 0) {
|
|
210
|
+
this.writeHelper(ansiEscapes.cursorLeft);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
this.writeHelper(ansiEscapes.cursorTo(y));
|
|
214
|
+
}
|
|
215
|
+
this.cursorX = y;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
clampLine(line, width) {
|
|
219
|
+
if (width <= 0) {
|
|
220
|
+
return {
|
|
221
|
+
styledChars: [],
|
|
222
|
+
text: '',
|
|
223
|
+
length: 0,
|
|
224
|
+
tainted: false,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
let i = line.length - 1;
|
|
228
|
+
while (i >= 0 && line[i]?.value === ' ' && line[i].styles.length === 0) {
|
|
229
|
+
i--;
|
|
230
|
+
}
|
|
231
|
+
const trimmedLength = i + 1;
|
|
232
|
+
let visualWidth = 0;
|
|
233
|
+
for (let k = 0; k < trimmedLength; k++) {
|
|
234
|
+
if (line[k]?.value === '') {
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
visualWidth += line[k].fullWidth ? 2 : 1;
|
|
238
|
+
}
|
|
239
|
+
if (visualWidth <= width) {
|
|
240
|
+
const styledChars = line.slice(0, trimmedLength);
|
|
241
|
+
return {
|
|
242
|
+
styledChars,
|
|
243
|
+
text: styledCharsToString(styledChars),
|
|
244
|
+
length: visualWidth,
|
|
245
|
+
tainted: false,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
// Truncate logic
|
|
249
|
+
const lastNonSpaceChar = line[i];
|
|
250
|
+
const hasBoxChar = lastNonSpaceChar &&
|
|
251
|
+
(lastNonSpaceChar.value === '╮' ||
|
|
252
|
+
lastNonSpaceChar.value === '│' ||
|
|
253
|
+
lastNonSpaceChar.value === '╯');
|
|
254
|
+
let targetVisualWidth = width;
|
|
255
|
+
if (hasBoxChar && lastNonSpaceChar) {
|
|
256
|
+
targetVisualWidth -= lastNonSpaceChar.fullWidth ? 2 : 1;
|
|
257
|
+
}
|
|
258
|
+
let currentWidth = 0;
|
|
259
|
+
let sliceIndex = 0;
|
|
260
|
+
for (let k = 0; k < trimmedLength; k++) {
|
|
261
|
+
const charWidth = line[k].fullWidth ? 2 : 1;
|
|
262
|
+
if (currentWidth + charWidth > targetVisualWidth) {
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
currentWidth += charWidth;
|
|
266
|
+
sliceIndex++;
|
|
267
|
+
}
|
|
268
|
+
if (hasBoxChar && lastNonSpaceChar) {
|
|
269
|
+
const boxWidth = lastNonSpaceChar.fullWidth ? 2 : 1;
|
|
270
|
+
const styledChars = [...line.slice(0, sliceIndex), lastNonSpaceChar];
|
|
271
|
+
return {
|
|
272
|
+
styledChars,
|
|
273
|
+
text: styledCharsToString(styledChars),
|
|
274
|
+
length: currentWidth + boxWidth,
|
|
275
|
+
tainted: false,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
const styledChars = line.slice(0, sliceIndex);
|
|
279
|
+
return {
|
|
280
|
+
styledChars,
|
|
281
|
+
text: styledCharsToString(styledChars),
|
|
282
|
+
length: currentWidth,
|
|
283
|
+
tainted: false,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
syncLine(line, y) {
|
|
287
|
+
if (y < 0 || y >= this.rows) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
const clampedLine = this.clampLine(line.styledChars, this.columns);
|
|
291
|
+
const currentLine = this.screen[y];
|
|
292
|
+
if (currentLine &&
|
|
293
|
+
currentLine.text === clampedLine.text &&
|
|
294
|
+
!clampedLine.tainted &&
|
|
295
|
+
!currentLine.tainted) {
|
|
296
|
+
// Content matches, no update needed
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
this.moveCursor(y, 0);
|
|
300
|
+
let textToWrite = clampedLine.text;
|
|
301
|
+
if (this.debugRainbowColor) {
|
|
302
|
+
textToWrite = colorize(textToWrite, this.debugRainbowColor, 'background');
|
|
303
|
+
}
|
|
304
|
+
this.writeHelper(textToWrite);
|
|
305
|
+
if (clampedLine.length < this.columns) {
|
|
306
|
+
this.writeHelper(ansiEscapes.eraseEndLine);
|
|
307
|
+
}
|
|
308
|
+
if (y !== this.rows - 1 && y != this.scrollRegionBottom - 1) {
|
|
309
|
+
this.writeHelper('\n');
|
|
310
|
+
this.cursorY = y + 1;
|
|
311
|
+
this.cursorX = 0;
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
this.cursorY = y;
|
|
315
|
+
this.cursorX = clampedLine.length;
|
|
316
|
+
}
|
|
317
|
+
clampedLine.tainted = false;
|
|
318
|
+
this.screen[y] = clampedLine;
|
|
319
|
+
this.finishChunk();
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Trigger a scroll up of content into the backbuffer.
|
|
323
|
+
*/
|
|
324
|
+
applyScrollUpBackbuffer() {
|
|
325
|
+
const top = Math.max(0, this.scrollRegionTop);
|
|
326
|
+
const bottom = this.scrollRegionBottom >= 0 ? this.scrollRegionBottom : this.rows;
|
|
327
|
+
// Simulate the effect of adding a linebreak at the bottom of the scroll region.
|
|
328
|
+
this.moveCursor(bottom - 1, this.cursorX == -1 ? 0 : this.cursorX);
|
|
329
|
+
this.writeHelper('\n');
|
|
330
|
+
this.backbuffer.push(this.screen[0]);
|
|
331
|
+
for (let i = top; i < bottom - 1; i++) {
|
|
332
|
+
this.screen[i] = this.screen[i + 1];
|
|
333
|
+
}
|
|
334
|
+
this.screen[bottom - 1] = {
|
|
335
|
+
styledChars: [],
|
|
336
|
+
text: '',
|
|
337
|
+
length: 0,
|
|
338
|
+
tainted: false,
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
applyScrollUp() {
|
|
342
|
+
const top = Math.max(0, this.scrollRegionTop);
|
|
343
|
+
const bottom = this.scrollRegionBottom >= 0 ? this.scrollRegionBottom : this.rows;
|
|
344
|
+
this.writeHelper(ansiEscapes.scrollUp);
|
|
345
|
+
// Simulate the effect of the ansi escape for scroll up
|
|
346
|
+
for (let i = top; i < bottom - 1; i++) {
|
|
347
|
+
this.screen[i] = this.screen[i + 1];
|
|
348
|
+
}
|
|
349
|
+
this.screen[bottom - 1] = {
|
|
350
|
+
styledChars: [],
|
|
351
|
+
text: '',
|
|
352
|
+
length: 0,
|
|
353
|
+
tainted: false,
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
applyScrollDown() {
|
|
357
|
+
const top = Math.max(0, this.scrollRegionTop);
|
|
358
|
+
const bottom = this.scrollRegionBottom >= 0 ? this.scrollRegionBottom : this.rows;
|
|
359
|
+
this.writeHelper(ansiEscapes.scrollDown);
|
|
360
|
+
// Simulate the effect of the ansi escape for scroll up
|
|
361
|
+
for (let i = bottom - 1; i > top; i--) {
|
|
362
|
+
this.screen[i] = this.screen[i - 1];
|
|
363
|
+
}
|
|
364
|
+
this.screen[top] = { styledChars: [], text: '', length: 0, tainted: false };
|
|
365
|
+
}
|
|
366
|
+
performScroll(options) {
|
|
367
|
+
const { start, end, linesToScroll, lines, direction, scrollToBackbuffer } = options;
|
|
368
|
+
debugLog(`[terminal-writer] SCROLLING LINES ${start}-${end} by ${linesToScroll} ${direction}`);
|
|
369
|
+
this.setScrollRegion(start, end);
|
|
370
|
+
const scrollAreaHeight = end - start;
|
|
371
|
+
if (lines.length !== end - start + linesToScroll) {
|
|
372
|
+
throw new Error(`Mismatch in scrollLines: expected ${end - start + linesToScroll} lines, got ${lines.length}`);
|
|
373
|
+
}
|
|
374
|
+
if (scrollToBackbuffer && direction !== 'up') {
|
|
375
|
+
throw new Error(`scrollToBackbuffer is only supported for direction "up"`);
|
|
376
|
+
}
|
|
377
|
+
if (scrollToBackbuffer && start > 0) {
|
|
378
|
+
throw new Error(`scrollToBackbuffer is only supported for start=0, got ${start}`);
|
|
379
|
+
}
|
|
380
|
+
// Make sure the content on screen before scrolling really matches what is in lines.
|
|
381
|
+
for (let i = start; i < end; i++) {
|
|
382
|
+
this.syncLine(lines[i - start], i);
|
|
383
|
+
}
|
|
384
|
+
if (direction === 'up') {
|
|
385
|
+
for (let i = 0; i < linesToScroll; i++) {
|
|
386
|
+
if (scrollToBackbuffer) {
|
|
387
|
+
this.applyScrollUpBackbuffer();
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
this.applyScrollUp();
|
|
391
|
+
}
|
|
392
|
+
// Add the new line at the end after scrolling up the other lines
|
|
393
|
+
this.unkownCursorLocation();
|
|
394
|
+
this.syncLine(lines[i + scrollAreaHeight], end - 1);
|
|
395
|
+
}
|
|
396
|
+
this.finishChunk();
|
|
397
|
+
}
|
|
398
|
+
else if (direction === 'down') {
|
|
399
|
+
for (let i = 0; i < linesToScroll; i++) {
|
|
400
|
+
const line = lines[linesToScroll - i];
|
|
401
|
+
this.applyScrollDown();
|
|
402
|
+
// Add the new line at the end after scrolling up the other lines
|
|
403
|
+
this.unkownCursorLocation();
|
|
404
|
+
this.syncLine(line, start);
|
|
405
|
+
}
|
|
406
|
+
this.finishChunk();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
scrollLines(options) {
|
|
410
|
+
try {
|
|
411
|
+
this.performScroll(options);
|
|
412
|
+
}
|
|
413
|
+
finally {
|
|
414
|
+
this.resetScrollRegion();
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
resize(columns, rows) {
|
|
418
|
+
if (this.columns === columns && this.rows === rows) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
this.columns = columns;
|
|
422
|
+
this.rows = rows;
|
|
423
|
+
const startIndex = Math.max(0, this.backbuffer.length - this.rows);
|
|
424
|
+
for (let i = startIndex; i < this.backbuffer.length; i++) {
|
|
425
|
+
const line = this.backbuffer[i];
|
|
426
|
+
if (line && line.length >= this.columns) {
|
|
427
|
+
line.tainted = true;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
clear() {
|
|
432
|
+
this.writeHelper(ansiEscapes.clearTerminal);
|
|
433
|
+
this.screen = [];
|
|
434
|
+
this.backbuffer = [];
|
|
435
|
+
this.cursorX = 0;
|
|
436
|
+
this.cursorY = 0;
|
|
437
|
+
this.finishChunk();
|
|
438
|
+
}
|
|
439
|
+
startSynchronizedOutput() {
|
|
440
|
+
this.writeHelper(enterSynchronizedOutput);
|
|
441
|
+
this.finishChunk();
|
|
442
|
+
}
|
|
443
|
+
endSynchronizedOutput() {
|
|
444
|
+
this.writeHelper(exitSynchronizedOutput);
|
|
445
|
+
this.finishChunk();
|
|
446
|
+
}
|
|
447
|
+
flush() {
|
|
448
|
+
if (this.cancelSlowFlush) {
|
|
449
|
+
this.cancelSlowFlush();
|
|
450
|
+
}
|
|
451
|
+
if (this.outputBuffer.length > 0) {
|
|
452
|
+
this.synchronizedWrite(this.outputBuffer.join(''));
|
|
453
|
+
}
|
|
454
|
+
this.firstRender = false;
|
|
455
|
+
this.outputBuffer = [];
|
|
456
|
+
}
|
|
457
|
+
async slowFlush() {
|
|
458
|
+
if (this.cancelSlowFlush) {
|
|
459
|
+
this.cancelSlowFlush();
|
|
460
|
+
}
|
|
461
|
+
if (this.outputBuffer.length === 0) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
this.firstRender = false;
|
|
465
|
+
while (this.outputBuffer.length > 0) {
|
|
466
|
+
const chunk = this.outputBuffer.shift();
|
|
467
|
+
if (chunk) {
|
|
468
|
+
this.synchronizedWrite(chunk);
|
|
469
|
+
}
|
|
470
|
+
// eslint-disable-next-line no-await-in-loop
|
|
471
|
+
await new Promise(resolve => {
|
|
472
|
+
let finished = false;
|
|
473
|
+
const timer = setTimeout(() => {
|
|
474
|
+
finished = true;
|
|
475
|
+
this.cancelSlowFlush = undefined;
|
|
476
|
+
resolve();
|
|
477
|
+
}, 200);
|
|
478
|
+
this.cancelSlowFlush = () => {
|
|
479
|
+
if (!finished) {
|
|
480
|
+
clearTimeout(timer);
|
|
481
|
+
finished = true;
|
|
482
|
+
if (this.outputBuffer.length > 0) {
|
|
483
|
+
this.synchronizedWrite(this.outputBuffer.join(''));
|
|
484
|
+
this.outputBuffer = [];
|
|
485
|
+
}
|
|
486
|
+
this.cancelSlowFlush = undefined;
|
|
487
|
+
resolve();
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
validateLinesConsistent(lines) {
|
|
494
|
+
if (this.isTainted) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
for (let r = 0; r < this.rows; r++) {
|
|
498
|
+
const index = lines.length + r - this.rows;
|
|
499
|
+
if (index < 0) {
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
if (!linesEqual(this.screen[r]?.styledChars, lines[index]?.styledChars)) {
|
|
503
|
+
debugLog(`Line ${r} on screen inconsistent between terminalWriter and ground truth. Expected "${styledCharsToString(lines[index]?.styledChars ?? [])}", got "${styledCharsToString(this.screen[r]?.styledChars ?? [])}"`);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// Validated the backbuffer matches for lines 0 -> this.lines.length - this.rows
|
|
507
|
+
const backbufferLimit = lines.length - this.rows;
|
|
508
|
+
for (let i = 0; i < backbufferLimit; i++) {
|
|
509
|
+
if (!linesEqual(this.backbuffer[i]?.styledChars, lines[i]?.styledChars)) {
|
|
510
|
+
debugLog(`Line ${i} in backbuffer inconsistent. Expected "${styledCharsToString(lines[i]?.styledChars ?? [])}", got "${styledCharsToString(this.backbuffer[i]?.styledChars ?? [])}"`);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
synchronizedWrite(text) {
|
|
515
|
+
if (this.enableSynchronizedOutput) {
|
|
516
|
+
this.stdout.write(enterSynchronizedOutput + text + exitSynchronizedOutput);
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
this.stdout.write(text);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
resetScrollRegion() {
|
|
523
|
+
if (this.scrollRegionTop !== -1 || this.scrollRegionBottom !== -1) {
|
|
524
|
+
this.writeHelper(resetScrollRegion);
|
|
525
|
+
this.scrollRegionTop = -1;
|
|
526
|
+
this.scrollRegionBottom = -1;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
setScrollRegion(top, bottom) {
|
|
530
|
+
if (this.scrollRegionTop !== top || this.scrollRegionBottom !== bottom) {
|
|
531
|
+
this.writeHelper(setScrollRegionCode(top + 1, bottom));
|
|
532
|
+
this.scrollRegionTop = top;
|
|
533
|
+
this.scrollRegionBottom = bottom;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
writeHelper(text) {
|
|
537
|
+
this.currentChunkBuffer.push(text);
|
|
538
|
+
}
|
|
539
|
+
finishChunk() {
|
|
540
|
+
if (this.currentChunkBuffer.length > 0) {
|
|
541
|
+
this.outputBuffer.push(this.currentChunkBuffer.join(''));
|
|
542
|
+
this.currentChunkBuffer = [];
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
//# sourceMappingURL=terminal-writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-writer.js","sourceRoot":"","sources":["../src/terminal-writer.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAkB,mBAAmB,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AAC,IAAY;QAC/B,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAEO,WAAW;QAClB,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YACzD,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAC;QAC9B,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type AnsiCode = {
|
|
2
|
+
type: 'ansi';
|
|
3
|
+
code: string;
|
|
4
|
+
endCode: string;
|
|
5
|
+
};
|
|
6
|
+
export type CssStyles = {
|
|
7
|
+
color?: string;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
fontWeight?: string;
|
|
10
|
+
fontStyle?: string;
|
|
11
|
+
textDecoration?: string;
|
|
12
|
+
opacity?: string;
|
|
13
|
+
inverse?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function ansiToCss(ansiCodes: AnsiCode[]): CssStyles;
|
|
16
|
+
export declare function cssObjToString(css: CssStyles): string;
|