erosolar-cli 1.7.394 → 1.7.395
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/dist/core/preferences.d.ts +1 -0
- package/dist/core/preferences.d.ts.map +1 -1
- package/dist/core/preferences.js +7 -0
- package/dist/core/preferences.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +17 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +312 -88
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/terminalInput.d.ts +18 -1
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +120 -9
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +14 -0
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +14 -0
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/shell/updateManager.d.ts +8 -1
- package/dist/shell/updateManager.d.ts.map +1 -1
- package/dist/shell/updateManager.js +4 -2
- package/dist/shell/updateManager.js.map +1 -1
- package/dist/ui/ShellUIAdapter.d.ts +6 -1
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +26 -5
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/shortcutsHelp.d.ts.map +1 -1
- package/dist/ui/shortcutsHelp.js +1 -0
- package/dist/ui/shortcutsHelp.js.map +1 -1
- package/dist/ui/unified/index.d.ts +2 -2
- package/dist/ui/unified/index.d.ts.map +1 -1
- package/dist/ui/unified/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -31,6 +31,7 @@ export interface TerminalInputEvents {
|
|
|
31
31
|
toggleVerify?: () => void;
|
|
32
32
|
toggleAutoContinue?: () => void;
|
|
33
33
|
toggleThinking?: () => void;
|
|
34
|
+
toggleAlphaZero?: () => void;
|
|
34
35
|
toggleEditMode?: () => void;
|
|
35
36
|
clearContext?: () => void;
|
|
36
37
|
}
|
|
@@ -110,6 +111,9 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
110
111
|
private verificationHotkey;
|
|
111
112
|
private autoContinueHotkey;
|
|
112
113
|
private thinkingHotkey;
|
|
114
|
+
private alphaZeroModeEnabled;
|
|
115
|
+
private alphaZeroHotkey;
|
|
116
|
+
private alphaZeroLabel;
|
|
113
117
|
private modelLabel;
|
|
114
118
|
private providerLabel;
|
|
115
119
|
private lastStreamingRender;
|
|
@@ -124,6 +128,8 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
124
128
|
private lastChatBoxStartRow;
|
|
125
129
|
private lastChatBoxHeight;
|
|
126
130
|
private displayInterceptorDispose;
|
|
131
|
+
private recentActions;
|
|
132
|
+
private readonly maxRecentActions;
|
|
127
133
|
constructor(writeStream?: NodeJS.WriteStream, config?: TerminalInputConfig);
|
|
128
134
|
/**
|
|
129
135
|
* Enable bracketed paste mode in terminal
|
|
@@ -277,6 +283,9 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
277
283
|
autoContinueHotkey?: string;
|
|
278
284
|
thinkingModeLabel?: string | null;
|
|
279
285
|
thinkingHotkey?: string;
|
|
286
|
+
alphaZeroEnabled?: boolean;
|
|
287
|
+
alphaZeroHotkey?: string;
|
|
288
|
+
alphaZeroLabel?: string | null;
|
|
280
289
|
}): void;
|
|
281
290
|
/**
|
|
282
291
|
* Clear all status messages at once (convenience method).
|
|
@@ -352,6 +361,14 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
352
361
|
private formatElapsedLabel;
|
|
353
362
|
private formatTokenCount;
|
|
354
363
|
private visibleLength;
|
|
364
|
+
/**
|
|
365
|
+
* Record a compact recent action for display above the divider.
|
|
366
|
+
*/
|
|
367
|
+
recordRecentAction(action: string): void;
|
|
368
|
+
/**
|
|
369
|
+
* Build the single-line recent actions strip.
|
|
370
|
+
*/
|
|
371
|
+
private buildRecentActionLines;
|
|
355
372
|
/**
|
|
356
373
|
* Debug-only snapshot used by tests to assert rendered strings without
|
|
357
374
|
* needing a TTY. Not used by production code.
|
|
@@ -590,7 +607,7 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
590
607
|
* pending UI changes. Prevents meta/header lines from being echoed into the
|
|
591
608
|
* streamed log when nothing changed.
|
|
592
609
|
*/
|
|
593
|
-
|
|
610
|
+
renderStreamingFrame(force?: boolean): void;
|
|
594
611
|
private resetStreamingRenderThrottle;
|
|
595
612
|
private scheduleRender;
|
|
596
613
|
private canRender;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminalInput.d.ts","sourceRoot":"","sources":["../../src/shell/terminalInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAwD3C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;AACvD,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;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,IAAI;IAQtB,OAAO,CAAC,uBAAuB;IAc/B;;;;OAIG;IACH,oBAAoB,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;IAyBlD,OAAO,CAAC,4BAA4B;IAQpC,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,qBAAqB;IAS7B,OAAO,CAAC,wBAAwB;IAchC,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,WAAW;CAIpB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -121,11 +121,14 @@ export class TerminalInput extends EventEmitter {
|
|
|
121
121
|
verificationHotkey = 'ctrl+shift+v';
|
|
122
122
|
autoContinueHotkey = 'ctrl+shift+c';
|
|
123
123
|
thinkingHotkey = 'ctrl+shift+t';
|
|
124
|
+
alphaZeroModeEnabled = false;
|
|
125
|
+
alphaZeroHotkey = 'ctrl+shift+a';
|
|
126
|
+
alphaZeroLabel = null;
|
|
124
127
|
modelLabel = null;
|
|
125
128
|
providerLabel = null;
|
|
126
129
|
// Streaming render throttle
|
|
127
130
|
lastStreamingRender = 0;
|
|
128
|
-
streamingRenderInterval =
|
|
131
|
+
streamingRenderInterval = 150; // ms between renders during streaming
|
|
129
132
|
streamingRenderTimer = null;
|
|
130
133
|
// Command autocomplete state
|
|
131
134
|
commandSuggestions = [];
|
|
@@ -137,6 +140,8 @@ export class TerminalInput extends EventEmitter {
|
|
|
137
140
|
lastChatBoxStartRow = null;
|
|
138
141
|
lastChatBoxHeight = 0;
|
|
139
142
|
displayInterceptorDispose = null;
|
|
143
|
+
recentActions = [];
|
|
144
|
+
maxRecentActions = 5;
|
|
140
145
|
constructor(writeStream = process.stdout, config = {}) {
|
|
141
146
|
super();
|
|
142
147
|
this.out = writeStream;
|
|
@@ -293,6 +298,13 @@ export class TerminalInput extends EventEmitter {
|
|
|
293
298
|
const normalizedName = key?.name ?? this.getArrowKeyName(key?.sequence ?? str);
|
|
294
299
|
const effectiveKey = normalizedName ? { ...key, name: normalizedName } : key;
|
|
295
300
|
const safeStr = this.isArrowEscapeFragment(str) ? undefined : str;
|
|
301
|
+
// Some terminals emit raw DEL/backspace bytes without a parsed key name.
|
|
302
|
+
// Treat these as backspace to avoid inserting the control character.
|
|
303
|
+
const isRawBackspace = !effectiveKey?.name && safeStr && (safeStr === '\b' || safeStr === '\x7f');
|
|
304
|
+
if (isRawBackspace) {
|
|
305
|
+
this.deleteBackward();
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
296
308
|
let handled = false;
|
|
297
309
|
// Handle control keys
|
|
298
310
|
if (effectiveKey?.ctrl) {
|
|
@@ -685,13 +697,19 @@ export class TerminalInput extends EventEmitter {
|
|
|
685
697
|
const nextVerifyHotkey = options.verificationHotkey ?? this.verificationHotkey;
|
|
686
698
|
const nextAutoHotkey = options.autoContinueHotkey ?? this.autoContinueHotkey;
|
|
687
699
|
const nextThinkingHotkey = options.thinkingHotkey ?? this.thinkingHotkey;
|
|
700
|
+
const nextAlphaHotkey = options.alphaZeroHotkey ?? this.alphaZeroHotkey;
|
|
688
701
|
const nextThinkingLabel = options.thinkingModeLabel === undefined ? this.thinkingModeLabel : (options.thinkingModeLabel || null);
|
|
702
|
+
const nextAlphaZeroEnabled = options.alphaZeroEnabled === undefined ? this.alphaZeroModeEnabled : !!options.alphaZeroEnabled;
|
|
703
|
+
const nextAlphaZeroLabel = options.alphaZeroLabel === undefined ? this.alphaZeroLabel : (options.alphaZeroLabel || null);
|
|
689
704
|
if (this.verificationEnabled === nextVerification &&
|
|
690
705
|
this.autoContinueEnabled === nextAutoContinue &&
|
|
691
706
|
this.verificationHotkey === nextVerifyHotkey &&
|
|
692
707
|
this.autoContinueHotkey === nextAutoHotkey &&
|
|
693
708
|
this.thinkingHotkey === nextThinkingHotkey &&
|
|
694
|
-
this.thinkingModeLabel === nextThinkingLabel
|
|
709
|
+
this.thinkingModeLabel === nextThinkingLabel &&
|
|
710
|
+
this.alphaZeroModeEnabled === nextAlphaZeroEnabled &&
|
|
711
|
+
this.alphaZeroHotkey === nextAlphaHotkey &&
|
|
712
|
+
this.alphaZeroLabel === nextAlphaZeroLabel) {
|
|
695
713
|
return;
|
|
696
714
|
}
|
|
697
715
|
this.verificationEnabled = nextVerification;
|
|
@@ -700,6 +718,9 @@ export class TerminalInput extends EventEmitter {
|
|
|
700
718
|
this.autoContinueHotkey = nextAutoHotkey;
|
|
701
719
|
this.thinkingHotkey = nextThinkingHotkey;
|
|
702
720
|
this.thinkingModeLabel = nextThinkingLabel;
|
|
721
|
+
this.alphaZeroModeEnabled = nextAlphaZeroEnabled;
|
|
722
|
+
this.alphaZeroHotkey = nextAlphaHotkey;
|
|
723
|
+
this.alphaZeroLabel = nextAlphaZeroLabel;
|
|
703
724
|
this.scheduleRender();
|
|
704
725
|
}
|
|
705
726
|
/**
|
|
@@ -737,6 +758,10 @@ export class TerminalInput extends EventEmitter {
|
|
|
737
758
|
if (this.isRendering)
|
|
738
759
|
return;
|
|
739
760
|
const streamingActive = this.mode === 'streaming' || isStreamingMode();
|
|
761
|
+
if (this.scrollRegionActive && streamingActive) {
|
|
762
|
+
this.renderStreamingFrame();
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
740
765
|
const bufferChanged = this.buffer !== this.lastRenderContent || this.cursor !== this.lastRenderCursor;
|
|
741
766
|
// During streaming, throttle re-renders unless the buffer actually changed
|
|
742
767
|
// (e.g., typing slash commands while streaming should update immediately).
|
|
@@ -830,6 +855,13 @@ export class TerminalInput extends EventEmitter {
|
|
|
830
855
|
this.write(metaLine);
|
|
831
856
|
currentRow += 1;
|
|
832
857
|
}
|
|
858
|
+
// Recent actions strip (sits above the divider)
|
|
859
|
+
const recentLines = this.buildRecentActionLines(cols - 2);
|
|
860
|
+
for (const recentLine of recentLines) {
|
|
861
|
+
this.write(ESC.TO(currentRow, 1));
|
|
862
|
+
this.write(recentLine);
|
|
863
|
+
currentRow += 1;
|
|
864
|
+
}
|
|
833
865
|
// Separator line with scroll status
|
|
834
866
|
this.write(ESC.TO(currentRow, 1));
|
|
835
867
|
const dividerLabel = scrollIndicator || undefined;
|
|
@@ -1110,6 +1142,14 @@ export class TerminalInput extends EventEmitter {
|
|
|
1110
1142
|
text: `${autoHotkey} ${autoStatus}`,
|
|
1111
1143
|
tone: this.autoContinueEnabled ? 'info' : 'muted'
|
|
1112
1144
|
});
|
|
1145
|
+
// AlphaZero RL mode toggle
|
|
1146
|
+
const alphaHotkey = this.formatHotkey(this.alphaZeroHotkey);
|
|
1147
|
+
const alphaLabel = this.alphaZeroLabel || 'AlphaZero RL';
|
|
1148
|
+
const alphaStatus = this.alphaZeroModeEnabled ? `${alphaLabel} on` : `${alphaLabel} off`;
|
|
1149
|
+
toggleParts.push({
|
|
1150
|
+
text: `${alphaHotkey} ${alphaStatus}`,
|
|
1151
|
+
tone: this.alphaZeroModeEnabled ? 'success' : 'muted',
|
|
1152
|
+
});
|
|
1113
1153
|
// Thinking mode toggle
|
|
1114
1154
|
if (this.thinkingModeLabel) {
|
|
1115
1155
|
const shortThinking = this.thinkingModeLabel.length > 10
|
|
@@ -1236,6 +1276,41 @@ export class TerminalInput extends EventEmitter {
|
|
|
1236
1276
|
const ansiPattern = /\u001B\[[0-?]*[ -/]*[@-~]/g;
|
|
1237
1277
|
return value.replace(ansiPattern, '').length;
|
|
1238
1278
|
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Record a compact recent action for display above the divider.
|
|
1281
|
+
*/
|
|
1282
|
+
recordRecentAction(action) {
|
|
1283
|
+
const clean = this.sanitize(action).replace(/\s+/g, ' ').trim();
|
|
1284
|
+
if (!clean) {
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1287
|
+
const maxLen = 80;
|
|
1288
|
+
const text = clean.length > maxLen ? `${clean.slice(0, maxLen - 1)}…` : clean;
|
|
1289
|
+
const last = this.recentActions[this.recentActions.length - 1];
|
|
1290
|
+
if (last && last.text === text) {
|
|
1291
|
+
last.timestamp = Date.now();
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1294
|
+
if (!this.isTTY()) {
|
|
1295
|
+
this.write(`[action] ${text}\n`);
|
|
1296
|
+
}
|
|
1297
|
+
this.recentActions.push({ text, timestamp: Date.now() });
|
|
1298
|
+
while (this.recentActions.length > this.maxRecentActions) {
|
|
1299
|
+
this.recentActions.shift();
|
|
1300
|
+
}
|
|
1301
|
+
this.scheduleRender();
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Build the single-line recent actions strip.
|
|
1305
|
+
*/
|
|
1306
|
+
buildRecentActionLines(width) {
|
|
1307
|
+
if (this.recentActions.length === 0 || width <= 0) {
|
|
1308
|
+
return [];
|
|
1309
|
+
}
|
|
1310
|
+
const items = this.recentActions.map((entry) => ({ text: entry.text, tone: 'muted' }));
|
|
1311
|
+
const parts = [{ text: 'recent', tone: 'info' }, ...items];
|
|
1312
|
+
return [renderStatusLine(parts, width)];
|
|
1313
|
+
}
|
|
1239
1314
|
/**
|
|
1240
1315
|
* Debug-only snapshot used by tests to assert rendered strings without
|
|
1241
1316
|
* needing a TTY. Not used by production code.
|
|
@@ -1282,6 +1357,12 @@ export class TerminalInput extends EventEmitter {
|
|
|
1282
1357
|
* Sets up terminal scroll region to exclude chat box.
|
|
1283
1358
|
*/
|
|
1284
1359
|
enterStreamingScrollRegion() {
|
|
1360
|
+
if (!this.isTTY()) {
|
|
1361
|
+
this.scrollRegionActive = false;
|
|
1362
|
+
this.setStatusMessage('esc to interrupt');
|
|
1363
|
+
this.forceRender();
|
|
1364
|
+
return;
|
|
1365
|
+
}
|
|
1285
1366
|
const { rows } = this.getSize();
|
|
1286
1367
|
const chatBoxHeight = this.getChatBoxHeight();
|
|
1287
1368
|
const scrollEnd = Math.max(1, rows - chatBoxHeight);
|
|
@@ -1305,6 +1386,12 @@ export class TerminalInput extends EventEmitter {
|
|
|
1305
1386
|
* Clears the old pinned chat box area to prevent duplication.
|
|
1306
1387
|
*/
|
|
1307
1388
|
exitStreamingScrollRegion() {
|
|
1389
|
+
if (!this.isTTY()) {
|
|
1390
|
+
this.scrollRegionActive = false;
|
|
1391
|
+
this.setStatusMessage('Ready for prompts');
|
|
1392
|
+
this.forceRender();
|
|
1393
|
+
return;
|
|
1394
|
+
}
|
|
1308
1395
|
const { rows } = this.getSize();
|
|
1309
1396
|
const chatBoxHeight = this.getChatBoxHeight();
|
|
1310
1397
|
writeLock.lock('exitStreamingScrollRegion');
|
|
@@ -1367,7 +1454,7 @@ export class TerminalInput extends EventEmitter {
|
|
|
1367
1454
|
// Content moved; force a render so the chat box follows.
|
|
1368
1455
|
this.renderDirty = true;
|
|
1369
1456
|
}
|
|
1370
|
-
this.scheduleStreamingRender(
|
|
1457
|
+
this.scheduleStreamingRender(150);
|
|
1371
1458
|
}
|
|
1372
1459
|
}
|
|
1373
1460
|
/**
|
|
@@ -1411,9 +1498,11 @@ export class TerminalInput extends EventEmitter {
|
|
|
1411
1498
|
const filtered = this.getFilteredCommands();
|
|
1412
1499
|
suggestionLines = Math.min(filtered.length, this.maxVisibleSuggestions) + 1; // +1 for header
|
|
1413
1500
|
}
|
|
1501
|
+
// Recent actions strip (single line when present)
|
|
1502
|
+
const recentLines = this.buildRecentActionLines(cols - 2).length;
|
|
1414
1503
|
// Total: meta + divider + input lines + suggestions + controls + buffer
|
|
1415
1504
|
// Leave a small buffer so streamed content still has space above the chat box
|
|
1416
|
-
const totalHeight = metaLines + 1 + inputLines + suggestionLines + controlLineCount + 1;
|
|
1505
|
+
const totalHeight = metaLines + recentLines + 1 + inputLines + suggestionLines + controlLineCount + 1;
|
|
1417
1506
|
const minContentRows = 2;
|
|
1418
1507
|
const maxHeight = Math.max(4, rows - minContentRows);
|
|
1419
1508
|
return Math.min(totalHeight, maxHeight);
|
|
@@ -1448,6 +1537,12 @@ export class TerminalInput extends EventEmitter {
|
|
|
1448
1537
|
return;
|
|
1449
1538
|
// Capture content in scrollback buffer
|
|
1450
1539
|
this.addToScrollback(content);
|
|
1540
|
+
if (!this.isTTY()) {
|
|
1541
|
+
this.write(content);
|
|
1542
|
+
const rowsUsed = this.countRenderedRows(content);
|
|
1543
|
+
this.contentRow += rowsUsed;
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1451
1546
|
writeLock.lock('writeToScrollRegion');
|
|
1452
1547
|
try {
|
|
1453
1548
|
// Position cursor at content row and write
|
|
@@ -1564,6 +1659,10 @@ export class TerminalInput extends EventEmitter {
|
|
|
1564
1659
|
}
|
|
1565
1660
|
return true;
|
|
1566
1661
|
case 'a': // Home
|
|
1662
|
+
if (key.shift) {
|
|
1663
|
+
this.emit('toggleAlphaZero');
|
|
1664
|
+
return true;
|
|
1665
|
+
}
|
|
1567
1666
|
this.moveCursorToLineStart();
|
|
1568
1667
|
return true;
|
|
1569
1668
|
case 'e': // End
|
|
@@ -1659,6 +1758,10 @@ export class TerminalInput extends EventEmitter {
|
|
|
1659
1758
|
// Alt+T: Toggle/cycle thinking mode
|
|
1660
1759
|
this.emit('toggleThinking');
|
|
1661
1760
|
break;
|
|
1761
|
+
case 'a':
|
|
1762
|
+
// Alt+A: Toggle AlphaZero RL mode
|
|
1763
|
+
this.emit('toggleAlphaZero');
|
|
1764
|
+
break;
|
|
1662
1765
|
case 'e':
|
|
1663
1766
|
// Alt+E: Toggle edit permission mode (ask/auto)
|
|
1664
1767
|
this.toggleEditMode();
|
|
@@ -2522,12 +2625,13 @@ export class TerminalInput extends EventEmitter {
|
|
|
2522
2625
|
* pending UI changes. Prevents meta/header lines from being echoed into the
|
|
2523
2626
|
* streamed log when nothing changed.
|
|
2524
2627
|
*/
|
|
2525
|
-
renderStreamingFrame() {
|
|
2628
|
+
renderStreamingFrame(force = false) {
|
|
2526
2629
|
if (!this.canRender())
|
|
2527
2630
|
return;
|
|
2528
2631
|
if (this.isRendering)
|
|
2529
2632
|
return;
|
|
2530
|
-
const shouldSkip = !
|
|
2633
|
+
const shouldSkip = !force &&
|
|
2634
|
+
!this.renderDirty &&
|
|
2531
2635
|
this.buffer === this.lastRenderContent &&
|
|
2532
2636
|
this.cursor === this.lastRenderCursor;
|
|
2533
2637
|
// Clear the dirty flag even when skipping to avoid runaway retries.
|
|
@@ -2536,7 +2640,7 @@ export class TerminalInput extends EventEmitter {
|
|
|
2536
2640
|
return;
|
|
2537
2641
|
}
|
|
2538
2642
|
if (writeLock.isLocked()) {
|
|
2539
|
-
writeLock.safeWrite(() => this.renderStreamingFrame());
|
|
2643
|
+
writeLock.safeWrite(() => this.renderStreamingFrame(force));
|
|
2540
2644
|
return;
|
|
2541
2645
|
}
|
|
2542
2646
|
this.renderPinnedChatBox();
|
|
@@ -2552,7 +2656,14 @@ export class TerminalInput extends EventEmitter {
|
|
|
2552
2656
|
if (!this.canRender())
|
|
2553
2657
|
return;
|
|
2554
2658
|
this.renderDirty = true;
|
|
2555
|
-
queueMicrotask(() =>
|
|
2659
|
+
queueMicrotask(() => {
|
|
2660
|
+
const streamingActive = this.scrollRegionActive || this.mode === 'streaming' || isStreamingMode();
|
|
2661
|
+
if (streamingActive && this.scrollRegionActive) {
|
|
2662
|
+
this.renderStreamingFrame();
|
|
2663
|
+
return;
|
|
2664
|
+
}
|
|
2665
|
+
this.render();
|
|
2666
|
+
});
|
|
2556
2667
|
}
|
|
2557
2668
|
canRender() {
|
|
2558
2669
|
return !this.disposed && this.enabled && this.isTTY();
|
|
@@ -2583,7 +2694,7 @@ export class TerminalInput extends EventEmitter {
|
|
|
2583
2694
|
return text
|
|
2584
2695
|
.replace(/\x1b\][^\x07]*(?:\x07|\x1b\\)/g, '') // OSC sequences
|
|
2585
2696
|
.replace(/\x1b\[[0-9;]*[A-Za-z]/g, '') // CSI sequences
|
|
2586
|
-
.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, '') // Control chars except \n and \r
|
|
2697
|
+
.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, '') // Control chars except \n and \r (incl. DEL/C1)
|
|
2587
2698
|
.replace(/\r\n?/g, '\n'); // Normalize line endings
|
|
2588
2699
|
}
|
|
2589
2700
|
getArrowKeyName(sequence) {
|