erosolar-cli 1.7.355 → 1.7.357
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/shell/interactiveShell.d.ts +0 -2
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +10 -29
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/terminalInput.d.ts +17 -26
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +197 -140
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +2 -5
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/subagents/taskRunner.d.ts.map +1 -1
- package/dist/subagents/taskRunner.js +25 -7
- package/dist/subagents/taskRunner.js.map +1 -1
- package/dist/tools/learnTools.js +4 -127
- package/dist/tools/learnTools.js.map +1 -1
- package/package.json +1 -1
|
@@ -125,8 +125,8 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
125
125
|
*/
|
|
126
126
|
disableMouseTracking(): void;
|
|
127
127
|
/**
|
|
128
|
-
* Process raw terminal data (handles bracketed paste sequences and
|
|
129
|
-
* Returns true if the data was consumed (paste sequence)
|
|
128
|
+
* Process raw terminal data (handles bracketed paste sequences, mouse events, and escape sequences)
|
|
129
|
+
* Returns true if the data was consumed (paste sequence, mouse event, etc.)
|
|
130
130
|
*/
|
|
131
131
|
processRawData(data: string): {
|
|
132
132
|
consumed: boolean;
|
|
@@ -250,9 +250,8 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
250
250
|
*/
|
|
251
251
|
private buildMetaLines;
|
|
252
252
|
/**
|
|
253
|
-
* Build mode controls line with
|
|
254
|
-
*
|
|
255
|
-
* Enhanced with comprehensive feature status display.
|
|
253
|
+
* Build mode controls line with status and key shortcuts.
|
|
254
|
+
* Compact single line with essential info.
|
|
256
255
|
*/
|
|
257
256
|
private buildModeControls;
|
|
258
257
|
private formatHotkey;
|
|
@@ -328,18 +327,17 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
328
327
|
*/
|
|
329
328
|
writeToScrollRegion(content: string): void;
|
|
330
329
|
/**
|
|
331
|
-
* Enter alternate screen buffer.
|
|
332
|
-
*
|
|
330
|
+
* Enter alternate screen buffer and clear it.
|
|
331
|
+
* This gives us full control over the terminal without affecting user's history.
|
|
333
332
|
*/
|
|
334
333
|
enterAlternateScreen(): void;
|
|
335
334
|
/**
|
|
336
335
|
* Exit alternate screen buffer.
|
|
337
|
-
*
|
|
336
|
+
* Restores the user's previous terminal content.
|
|
338
337
|
*/
|
|
339
338
|
exitAlternateScreen(): void;
|
|
340
339
|
/**
|
|
341
340
|
* Check if alternate screen buffer is currently active.
|
|
342
|
-
* Always returns false - using terminal-native mode.
|
|
343
341
|
*/
|
|
344
342
|
isAlternateScreenActive(): boolean;
|
|
345
343
|
/**
|
|
@@ -347,9 +345,8 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
347
345
|
*/
|
|
348
346
|
getScrollbackSnapshot(): string[];
|
|
349
347
|
/**
|
|
350
|
-
* Clear the
|
|
351
|
-
*
|
|
352
|
-
* rather than clearing history (preserving scrollback).
|
|
348
|
+
* Clear the entire terminal screen and reset content position.
|
|
349
|
+
* This removes all content including the launching command.
|
|
353
350
|
*/
|
|
354
351
|
clearScreen(): void;
|
|
355
352
|
/**
|
|
@@ -381,9 +378,8 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
381
378
|
*/
|
|
382
379
|
private getPageSize;
|
|
383
380
|
/**
|
|
384
|
-
* Build scroll indicator for the divider line.
|
|
385
|
-
*
|
|
386
|
-
* This returns null - no scroll indicator is shown.
|
|
381
|
+
* Build scroll indicator for the divider line (Claude Code style).
|
|
382
|
+
* Shows scroll position when in scrollback mode, or history size hint when idle.
|
|
387
383
|
*/
|
|
388
384
|
private buildScrollIndicator;
|
|
389
385
|
private handleSpecialKey;
|
|
@@ -414,36 +410,31 @@ export declare class TerminalInput extends EventEmitter {
|
|
|
414
410
|
private addToScrollback;
|
|
415
411
|
/**
|
|
416
412
|
* Scroll up by a number of lines (PageUp)
|
|
417
|
-
* Note: Scrollback is disabled in alternate screen mode to avoid display corruption.
|
|
418
|
-
* Users should use their terminal's native scrollback or copy/paste features.
|
|
419
413
|
*/
|
|
420
414
|
private scrollUp;
|
|
421
415
|
/**
|
|
422
416
|
* Scroll down by a number of lines (PageDown)
|
|
423
|
-
* Note: Scrollback disabled - see scrollUp comment
|
|
424
417
|
*/
|
|
425
418
|
private scrollDown;
|
|
426
419
|
/**
|
|
427
420
|
* Jump to the top of scrollback buffer
|
|
428
|
-
* DISABLED: Scrollback navigation causes display corruption in alternate screen mode.
|
|
429
|
-
* The scrollback buffer is maintained but cannot be rendered properly.
|
|
430
421
|
*/
|
|
431
422
|
private scrollToTop;
|
|
432
423
|
/**
|
|
433
424
|
* Jump to the bottom (live mode)
|
|
434
|
-
* DISABLED: Scrollback navigation causes display corruption.
|
|
435
425
|
*/
|
|
436
426
|
private scrollToBottom;
|
|
437
427
|
/**
|
|
438
428
|
* Toggle scrollback mode on/off (Alt+S hotkey)
|
|
439
|
-
* DISABLED: Scrollback navigation causes display corruption in alternate screen mode.
|
|
440
429
|
*/
|
|
441
430
|
private toggleScrollbackMode;
|
|
442
431
|
/**
|
|
443
|
-
* Render the scrollback buffer view
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
432
|
+
* Render the scrollback buffer view with enhanced visuals
|
|
433
|
+
* Features:
|
|
434
|
+
* - Visual scroll position indicator
|
|
435
|
+
* - Progress bar showing position in history
|
|
436
|
+
* - Keyboard navigation hints
|
|
437
|
+
* - Animated indicators
|
|
447
438
|
*/
|
|
448
439
|
private renderScrollbackView;
|
|
449
440
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminalInput.d.ts","sourceRoot":"","sources":["../../src/shell/terminalInput.ts"],"names":[],"mappings":"AAAA;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OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,sBAAsB;IAuB9B,OAAO,CAAC,iBAAiB;IAQzB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI;IAe7E,WAAW,IAAI,aAAa;IAI5B,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAIxC,OAAO,CAAC,WAAW;IAOnB,cAAc,IAAI,IAAI;IAKtB,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,4BAA4B;IAQpC,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,QAAQ;IAUhB,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"}
|
|
@@ -173,8 +173,8 @@ export class TerminalInput extends EventEmitter {
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
/**
|
|
176
|
-
* Process raw terminal data (handles bracketed paste sequences and
|
|
177
|
-
* Returns true if the data was consumed (paste sequence)
|
|
176
|
+
* Process raw terminal data (handles bracketed paste sequences, mouse events, and escape sequences)
|
|
177
|
+
* Returns true if the data was consumed (paste sequence, mouse event, etc.)
|
|
178
178
|
*/
|
|
179
179
|
processRawData(data) {
|
|
180
180
|
// Check for mouse events (SGR mode: \x1b[<button;x;yM or m)
|
|
@@ -190,6 +190,14 @@ export class TerminalInput extends EventEmitter {
|
|
|
190
190
|
const remaining = data.slice(mouseEventEnd);
|
|
191
191
|
return { consumed: true, passthrough: remaining };
|
|
192
192
|
}
|
|
193
|
+
// Filter out arrow key escape sequences (they're handled by keypress events)
|
|
194
|
+
// Arrow keys: \x1b[A (up), \x1b[B (down), \x1b[C (right), \x1b[D (left)
|
|
195
|
+
const arrowMatch = data.match(/\x1b\[[ABCD]/);
|
|
196
|
+
if (arrowMatch) {
|
|
197
|
+
// Arrow keys should be handled by keypress handler, strip them from passthrough
|
|
198
|
+
const filtered = data.replace(/\x1b\[[ABCD]/g, '');
|
|
199
|
+
return { consumed: filtered.length !== data.length, passthrough: filtered };
|
|
200
|
+
}
|
|
193
201
|
// Check for paste start
|
|
194
202
|
if (data.includes(ESC.PASTE_START)) {
|
|
195
203
|
this.isPasting = true;
|
|
@@ -688,125 +696,83 @@ export class TerminalInput extends EventEmitter {
|
|
|
688
696
|
return [`${leftText}${' '.repeat(spacing)}${rightText}`];
|
|
689
697
|
}
|
|
690
698
|
/**
|
|
691
|
-
* Build mode controls line with
|
|
692
|
-
*
|
|
693
|
-
* Enhanced with comprehensive feature status display.
|
|
699
|
+
* Build mode controls line with status and key shortcuts.
|
|
700
|
+
* Compact single line with essential info.
|
|
694
701
|
*/
|
|
695
702
|
buildModeControls(cols) {
|
|
696
703
|
const width = Math.max(8, cols - 2);
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
// Streaming indicator with animated spinner
|
|
704
|
+
const parts = [];
|
|
705
|
+
// Streaming indicator
|
|
700
706
|
if (this.streamingLabel) {
|
|
701
|
-
|
|
707
|
+
parts.push({ text: `◐ ${this.streamingLabel}`, tone: 'info' });
|
|
702
708
|
}
|
|
703
|
-
//
|
|
704
|
-
if (this.
|
|
705
|
-
|
|
709
|
+
// Interrupt hint (during streaming)
|
|
710
|
+
if (this.mode === 'streaming' || this.scrollRegionActive) {
|
|
711
|
+
parts.push({ text: `[Esc] stop`, tone: 'warn' });
|
|
706
712
|
}
|
|
707
|
-
//
|
|
708
|
-
if (this.
|
|
709
|
-
|
|
713
|
+
// Scrollback indicator
|
|
714
|
+
if (this.isInScrollbackMode && this.scrollbackOffset > 0) {
|
|
715
|
+
parts.push({ text: `↕${this.scrollbackOffset}L`, tone: 'info' });
|
|
710
716
|
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
// Interrupt shortcut (during streaming)
|
|
714
|
-
if (this.mode === 'streaming' || this.scrollRegionActive) {
|
|
715
|
-
leftParts.push({ text: `${this.formatHotkey('esc')} stop`, tone: 'warn' });
|
|
717
|
+
else if (this.scrollbackBuffer.length > 50) {
|
|
718
|
+
parts.push({ text: `↕${this.scrollbackBuffer.length}L`, tone: 'muted' });
|
|
716
719
|
}
|
|
717
|
-
//
|
|
718
|
-
const editHotkey = this.formatHotkey('shift+tab');
|
|
720
|
+
// Toggle states (compact)
|
|
719
721
|
const editIcon = this.editMode === 'display-edits' ? '✓' : '?';
|
|
720
|
-
const editLabel = this.editMode === 'display-edits' ? 'edits:auto' : 'edits:ask';
|
|
721
|
-
const editTone = this.editMode === 'display-edits' ? 'success' : 'muted';
|
|
722
|
-
leftParts.push({ text: `${editHotkey}${editIcon}${editLabel}`, tone: editTone });
|
|
723
|
-
// Verification toggle (Alt+V)
|
|
724
722
|
const verifyIcon = this.verificationEnabled ? '✓' : '○';
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
const continueLabel = this.autoContinueEnabled ? 'auto' : 'manual';
|
|
732
|
-
leftParts.push({ text: `${continueHotkey}${autoIcon}${continueLabel}`, tone: this.autoContinueEnabled ? 'info' : 'muted' });
|
|
733
|
-
// Thinking mode toggle (if available)
|
|
734
|
-
if (this.thinkingModeLabel) {
|
|
735
|
-
const thinkingHotkey = this.formatHotkey(this.thinkingHotkey || '/thinking');
|
|
736
|
-
rightParts.push({ text: `${thinkingHotkey}◐${this.thinkingModeLabel}`, tone: 'info' });
|
|
737
|
-
}
|
|
738
|
-
// === CONTEXTUAL INFO ===
|
|
739
|
-
// Queued commands
|
|
740
|
-
if (this.queue.length > 0) {
|
|
741
|
-
const queueIcon = this.mode === 'streaming' ? '⏳' : '▸';
|
|
742
|
-
leftParts.push({ text: `${queueIcon}${this.queue.length}queued`, tone: 'info' });
|
|
743
|
-
}
|
|
744
|
-
// Scrollback buffer hint removed - scrollback navigation is disabled
|
|
745
|
-
// Multi-line indicator
|
|
746
|
-
if (this.buffer.includes('\n')) {
|
|
747
|
-
const lineCount = this.buffer.split('\n').length;
|
|
748
|
-
rightParts.push({ text: `${lineCount}L`, tone: 'muted' });
|
|
749
|
-
}
|
|
750
|
-
// Paste indicator
|
|
751
|
-
if (this.pastePlaceholders.length > 0) {
|
|
752
|
-
const latest = this.pastePlaceholders[this.pastePlaceholders.length - 1];
|
|
753
|
-
rightParts.push({
|
|
754
|
-
text: `paste#${latest.id}+${latest.lineCount}L`,
|
|
755
|
-
tone: 'info',
|
|
756
|
-
});
|
|
757
|
-
}
|
|
758
|
-
// Context remaining warning with visual indicator
|
|
723
|
+
const autoIcon = this.autoContinueEnabled ? '✓' : '○';
|
|
724
|
+
parts.push({
|
|
725
|
+
text: `edits${editIcon} verify${verifyIcon} auto${autoIcon}`,
|
|
726
|
+
tone: 'muted'
|
|
727
|
+
});
|
|
728
|
+
// Context remaining
|
|
759
729
|
const contextRemaining = this.computeContextRemaining();
|
|
760
|
-
if (contextRemaining !== null) {
|
|
761
|
-
const tone = contextRemaining <= 10 ? 'warn' :
|
|
762
|
-
|
|
763
|
-
const label = contextRemaining === 0 && this.contextUsage !== null
|
|
764
|
-
? `${icon}compact!`
|
|
765
|
-
: `${icon}${contextRemaining}%`;
|
|
766
|
-
rightParts.push({ text: label, tone });
|
|
767
|
-
}
|
|
768
|
-
// Model/provider quick reference (compact)
|
|
769
|
-
if (this.modelLabel && !this.streamingLabel) {
|
|
770
|
-
const shortModel = this.modelLabel.length > 12 ? this.modelLabel.slice(0, 10) + '..' : this.modelLabel;
|
|
771
|
-
rightParts.push({ text: shortModel, tone: 'muted' });
|
|
730
|
+
if (contextRemaining !== null && contextRemaining <= 50) {
|
|
731
|
+
const tone = contextRemaining <= 10 ? 'warn' : 'info';
|
|
732
|
+
parts.push({ text: `${contextRemaining}%`, tone });
|
|
772
733
|
}
|
|
773
|
-
//
|
|
774
|
-
if (
|
|
775
|
-
const
|
|
776
|
-
|
|
734
|
+
// Model info (when not streaming)
|
|
735
|
+
if (this.modelLabel && !this.streamingLabel) {
|
|
736
|
+
const shortModel = this.modelLabel.length > 20 ? this.modelLabel.slice(0, 18) + '..' : this.modelLabel;
|
|
737
|
+
parts.push({ text: shortModel, tone: 'muted' });
|
|
777
738
|
}
|
|
778
|
-
|
|
779
|
-
const rightWidth = Math.max(14, width - leftWidth - 1);
|
|
780
|
-
const leftText = renderStatusLine(leftParts, leftWidth);
|
|
781
|
-
const rightText = renderStatusLine(rightParts, rightWidth);
|
|
782
|
-
const spacing = Math.max(1, width - this.visibleLength(leftText) - this.visibleLength(rightText));
|
|
783
|
-
return `${leftText}${' '.repeat(spacing)}${rightText}`;
|
|
739
|
+
return renderStatusLine(parts, width);
|
|
784
740
|
}
|
|
785
741
|
formatHotkey(hotkey) {
|
|
786
742
|
const normalized = hotkey.trim().toLowerCase();
|
|
787
743
|
if (!normalized)
|
|
788
744
|
return hotkey;
|
|
789
745
|
const parts = normalized.split('+').filter(Boolean);
|
|
746
|
+
// Use readable key names instead of symbols for better terminal compatibility
|
|
790
747
|
const map = {
|
|
791
|
-
shift: '
|
|
792
|
-
sh: '
|
|
793
|
-
alt: '
|
|
794
|
-
option: '
|
|
795
|
-
opt: '
|
|
796
|
-
ctrl: '
|
|
797
|
-
control: '
|
|
798
|
-
cmd: '
|
|
799
|
-
meta: '
|
|
748
|
+
shift: 'Shift',
|
|
749
|
+
sh: 'Shift',
|
|
750
|
+
alt: 'Alt',
|
|
751
|
+
option: 'Alt',
|
|
752
|
+
opt: 'Alt',
|
|
753
|
+
ctrl: 'Ctrl',
|
|
754
|
+
control: 'Ctrl',
|
|
755
|
+
cmd: 'Cmd',
|
|
756
|
+
meta: 'Cmd',
|
|
757
|
+
esc: 'Esc',
|
|
758
|
+
escape: 'Esc',
|
|
759
|
+
tab: 'Tab',
|
|
760
|
+
return: 'Enter',
|
|
761
|
+
enter: 'Enter',
|
|
762
|
+
pageup: 'PgUp',
|
|
763
|
+
pagedown: 'PgDn',
|
|
764
|
+
home: 'Home',
|
|
765
|
+
end: 'End',
|
|
800
766
|
};
|
|
801
767
|
const formatted = parts
|
|
802
768
|
.map((part) => {
|
|
803
|
-
const
|
|
804
|
-
if (
|
|
805
|
-
return
|
|
806
|
-
return part.length === 1 ? part.toUpperCase() : part.toUpperCase();
|
|
769
|
+
const label = map[part];
|
|
770
|
+
if (label)
|
|
771
|
+
return label;
|
|
772
|
+
return part.length === 1 ? part.toUpperCase() : part.charAt(0).toUpperCase() + part.slice(1);
|
|
807
773
|
})
|
|
808
|
-
.join('');
|
|
809
|
-
return formatted
|
|
774
|
+
.join('+');
|
|
775
|
+
return `[${formatted}]`;
|
|
810
776
|
}
|
|
811
777
|
computeContextRemaining() {
|
|
812
778
|
if (this.contextUsage === null) {
|
|
@@ -972,7 +938,7 @@ export class TerminalInput extends EventEmitter {
|
|
|
972
938
|
* Calculate chat box height.
|
|
973
939
|
*/
|
|
974
940
|
getChatBoxHeight() {
|
|
975
|
-
return
|
|
941
|
+
return 5; // Fixed: divider + input + status + buffer
|
|
976
942
|
}
|
|
977
943
|
/**
|
|
978
944
|
* @deprecated Use streamContent() instead
|
|
@@ -1008,26 +974,41 @@ export class TerminalInput extends EventEmitter {
|
|
|
1008
974
|
}
|
|
1009
975
|
}
|
|
1010
976
|
/**
|
|
1011
|
-
* Enter alternate screen buffer.
|
|
1012
|
-
*
|
|
977
|
+
* Enter alternate screen buffer and clear it.
|
|
978
|
+
* This gives us full control over the terminal without affecting user's history.
|
|
1013
979
|
*/
|
|
1014
980
|
enterAlternateScreen() {
|
|
1015
|
-
|
|
1016
|
-
|
|
981
|
+
writeLock.lock('enterAltScreen');
|
|
982
|
+
try {
|
|
983
|
+
this.write(ESC.ENTER_ALT_SCREEN);
|
|
984
|
+
this.write(ESC.HOME);
|
|
985
|
+
this.write(ESC.CLEAR_SCREEN);
|
|
986
|
+
this.contentRow = 1;
|
|
987
|
+
this.alternateScreenActive = true;
|
|
988
|
+
}
|
|
989
|
+
finally {
|
|
990
|
+
writeLock.unlock();
|
|
991
|
+
}
|
|
1017
992
|
}
|
|
1018
993
|
/**
|
|
1019
994
|
* Exit alternate screen buffer.
|
|
1020
|
-
*
|
|
995
|
+
* Restores the user's previous terminal content.
|
|
1021
996
|
*/
|
|
1022
997
|
exitAlternateScreen() {
|
|
1023
|
-
|
|
998
|
+
writeLock.lock('exitAltScreen');
|
|
999
|
+
try {
|
|
1000
|
+
this.write(ESC.EXIT_ALT_SCREEN);
|
|
1001
|
+
this.alternateScreenActive = false;
|
|
1002
|
+
}
|
|
1003
|
+
finally {
|
|
1004
|
+
writeLock.unlock();
|
|
1005
|
+
}
|
|
1024
1006
|
}
|
|
1025
1007
|
/**
|
|
1026
1008
|
* Check if alternate screen buffer is currently active.
|
|
1027
|
-
* Always returns false - using terminal-native mode.
|
|
1028
1009
|
*/
|
|
1029
1010
|
isAlternateScreenActive() {
|
|
1030
|
-
return
|
|
1011
|
+
return this.alternateScreenActive;
|
|
1031
1012
|
}
|
|
1032
1013
|
/**
|
|
1033
1014
|
* Get a snapshot of the scrollback buffer (for display on exit).
|
|
@@ -1036,17 +1017,14 @@ export class TerminalInput extends EventEmitter {
|
|
|
1036
1017
|
return [...this.scrollbackBuffer];
|
|
1037
1018
|
}
|
|
1038
1019
|
/**
|
|
1039
|
-
* Clear the
|
|
1040
|
-
*
|
|
1041
|
-
* rather than clearing history (preserving scrollback).
|
|
1020
|
+
* Clear the entire terminal screen and reset content position.
|
|
1021
|
+
* This removes all content including the launching command.
|
|
1042
1022
|
*/
|
|
1043
1023
|
clearScreen() {
|
|
1044
1024
|
writeLock.lock('clearScreen');
|
|
1045
1025
|
try {
|
|
1046
|
-
// In native mode, scroll past existing content rather than clearing
|
|
1047
|
-
const { rows } = this.getSize();
|
|
1048
|
-
this.write('\n'.repeat(rows));
|
|
1049
1026
|
this.write(ESC.HOME);
|
|
1027
|
+
this.write(ESC.CLEAR_SCREEN);
|
|
1050
1028
|
this.contentRow = 1;
|
|
1051
1029
|
}
|
|
1052
1030
|
finally {
|
|
@@ -1214,12 +1192,25 @@ export class TerminalInput extends EventEmitter {
|
|
|
1214
1192
|
return Math.max(5, rows - chatBoxHeight - 2);
|
|
1215
1193
|
}
|
|
1216
1194
|
/**
|
|
1217
|
-
* Build scroll indicator for the divider line.
|
|
1218
|
-
*
|
|
1219
|
-
* This returns null - no scroll indicator is shown.
|
|
1195
|
+
* Build scroll indicator for the divider line (Claude Code style).
|
|
1196
|
+
* Shows scroll position when in scrollback mode, or history size hint when idle.
|
|
1220
1197
|
*/
|
|
1221
1198
|
buildScrollIndicator() {
|
|
1222
|
-
|
|
1199
|
+
const bufferSize = this.scrollbackBuffer.length;
|
|
1200
|
+
// In scrollback mode - show position
|
|
1201
|
+
if (this.isInScrollbackMode && this.scrollbackOffset > 0) {
|
|
1202
|
+
const { rows } = this.getSize();
|
|
1203
|
+
const chatBoxHeight = this.getChatBoxHeight();
|
|
1204
|
+
const viewportHeight = Math.max(1, rows - chatBoxHeight);
|
|
1205
|
+
const currentPos = Math.max(0, bufferSize - this.scrollbackOffset - viewportHeight);
|
|
1206
|
+
const pct = bufferSize > 0 ? Math.round((currentPos / bufferSize) * 100) : 0;
|
|
1207
|
+
return `↑${this.scrollbackOffset} · ${pct}% · PgUp/Dn`;
|
|
1208
|
+
}
|
|
1209
|
+
// Not in scrollback - show hint if there's history
|
|
1210
|
+
if (bufferSize > 20) {
|
|
1211
|
+
const sizeLabel = bufferSize >= 1000 ? `${Math.floor(bufferSize / 1000)}k` : `${bufferSize}`;
|
|
1212
|
+
return `↕${sizeLabel}L · PgUp`;
|
|
1213
|
+
}
|
|
1223
1214
|
return null;
|
|
1224
1215
|
}
|
|
1225
1216
|
handleSpecialKey(_str, key) {
|
|
@@ -1281,11 +1272,10 @@ export class TerminalInput extends EventEmitter {
|
|
|
1281
1272
|
}
|
|
1282
1273
|
return true;
|
|
1283
1274
|
case 'pageup':
|
|
1284
|
-
//
|
|
1285
|
-
// Users should use terminal's native scrollback if available
|
|
1275
|
+
this.scrollUp(20); // Scroll up by 20 lines
|
|
1286
1276
|
return true;
|
|
1287
1277
|
case 'pagedown':
|
|
1288
|
-
//
|
|
1278
|
+
this.scrollDown(20); // Scroll down by 20 lines
|
|
1289
1279
|
return true;
|
|
1290
1280
|
case 'tab':
|
|
1291
1281
|
if (key.shift) {
|
|
@@ -1679,53 +1669,120 @@ export class TerminalInput extends EventEmitter {
|
|
|
1679
1669
|
}
|
|
1680
1670
|
/**
|
|
1681
1671
|
* Scroll up by a number of lines (PageUp)
|
|
1682
|
-
* Note: Scrollback is disabled in alternate screen mode to avoid display corruption.
|
|
1683
|
-
* Users should use their terminal's native scrollback or copy/paste features.
|
|
1684
1672
|
*/
|
|
1685
|
-
scrollUp(
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1673
|
+
scrollUp(lines = 10) {
|
|
1674
|
+
const { rows } = this.getSize();
|
|
1675
|
+
const chatBoxHeight = this.getChatBoxHeight();
|
|
1676
|
+
const visibleLines = Math.max(1, rows - chatBoxHeight);
|
|
1677
|
+
// Calculate max scroll offset
|
|
1678
|
+
const maxOffset = Math.max(0, this.scrollbackBuffer.length - visibleLines);
|
|
1679
|
+
this.scrollbackOffset = Math.min(this.scrollbackOffset + lines, maxOffset);
|
|
1680
|
+
this.isInScrollbackMode = this.scrollbackOffset > 0;
|
|
1681
|
+
if (this.isInScrollbackMode) {
|
|
1682
|
+
this.renderScrollbackView();
|
|
1683
|
+
}
|
|
1689
1684
|
}
|
|
1690
1685
|
/**
|
|
1691
1686
|
* Scroll down by a number of lines (PageDown)
|
|
1692
|
-
* Note: Scrollback disabled - see scrollUp comment
|
|
1693
1687
|
*/
|
|
1694
|
-
scrollDown(
|
|
1695
|
-
|
|
1688
|
+
scrollDown(lines = 10) {
|
|
1689
|
+
this.scrollbackOffset = Math.max(0, this.scrollbackOffset - lines);
|
|
1690
|
+
this.isInScrollbackMode = this.scrollbackOffset > 0;
|
|
1691
|
+
if (this.isInScrollbackMode) {
|
|
1692
|
+
this.renderScrollbackView();
|
|
1693
|
+
}
|
|
1694
|
+
else {
|
|
1695
|
+
// Returned to live mode - force re-render
|
|
1696
|
+
this.forceRender();
|
|
1697
|
+
}
|
|
1696
1698
|
}
|
|
1697
1699
|
/**
|
|
1698
1700
|
* Jump to the top of scrollback buffer
|
|
1699
|
-
* DISABLED: Scrollback navigation causes display corruption in alternate screen mode.
|
|
1700
|
-
* The scrollback buffer is maintained but cannot be rendered properly.
|
|
1701
1701
|
*/
|
|
1702
1702
|
scrollToTop() {
|
|
1703
|
-
|
|
1703
|
+
const { rows } = this.getSize();
|
|
1704
|
+
const chatBoxHeight = this.getChatBoxHeight();
|
|
1705
|
+
const visibleLines = Math.max(1, rows - chatBoxHeight);
|
|
1706
|
+
const maxOffset = Math.max(0, this.scrollbackBuffer.length - visibleLines);
|
|
1707
|
+
this.scrollbackOffset = maxOffset;
|
|
1708
|
+
this.isInScrollbackMode = true;
|
|
1709
|
+
this.renderScrollbackView();
|
|
1704
1710
|
}
|
|
1705
1711
|
/**
|
|
1706
1712
|
* Jump to the bottom (live mode)
|
|
1707
|
-
* DISABLED: Scrollback navigation causes display corruption.
|
|
1708
1713
|
*/
|
|
1709
1714
|
scrollToBottom() {
|
|
1710
|
-
// Reset scrollback state in case it was somehow enabled
|
|
1711
1715
|
this.scrollbackOffset = 0;
|
|
1712
1716
|
this.isInScrollbackMode = false;
|
|
1717
|
+
this.forceRender();
|
|
1713
1718
|
}
|
|
1714
1719
|
/**
|
|
1715
1720
|
* Toggle scrollback mode on/off (Alt+S hotkey)
|
|
1716
|
-
* DISABLED: Scrollback navigation causes display corruption in alternate screen mode.
|
|
1717
1721
|
*/
|
|
1718
1722
|
toggleScrollbackMode() {
|
|
1719
|
-
|
|
1723
|
+
if (this.isInScrollbackMode) {
|
|
1724
|
+
this.scrollToBottom();
|
|
1725
|
+
}
|
|
1726
|
+
else if (this.scrollbackBuffer.length > 0) {
|
|
1727
|
+
this.scrollUp(20);
|
|
1728
|
+
}
|
|
1720
1729
|
}
|
|
1721
1730
|
/**
|
|
1722
|
-
* Render the scrollback buffer view
|
|
1723
|
-
*
|
|
1724
|
-
*
|
|
1725
|
-
*
|
|
1731
|
+
* Render the scrollback buffer view with enhanced visuals
|
|
1732
|
+
* Features:
|
|
1733
|
+
* - Visual scroll position indicator
|
|
1734
|
+
* - Progress bar showing position in history
|
|
1735
|
+
* - Keyboard navigation hints
|
|
1736
|
+
* - Animated indicators
|
|
1726
1737
|
*/
|
|
1727
1738
|
renderScrollbackView() {
|
|
1728
|
-
|
|
1739
|
+
const { rows, cols } = this.getSize();
|
|
1740
|
+
const chatBoxHeight = this.getChatBoxHeight();
|
|
1741
|
+
const contentHeight = Math.max(1, rows - chatBoxHeight);
|
|
1742
|
+
writeLock.lock('renderScrollback');
|
|
1743
|
+
try {
|
|
1744
|
+
this.write(ESC.SAVE);
|
|
1745
|
+
this.write(ESC.HIDE);
|
|
1746
|
+
// Clear content area
|
|
1747
|
+
for (let i = 1; i <= contentHeight; i++) {
|
|
1748
|
+
this.write(ESC.TO(i, 1));
|
|
1749
|
+
this.write(ESC.CLEAR_LINE);
|
|
1750
|
+
}
|
|
1751
|
+
// Calculate which lines to show
|
|
1752
|
+
const totalLines = this.scrollbackBuffer.length;
|
|
1753
|
+
const startIdx = Math.max(0, totalLines - this.scrollbackOffset - contentHeight);
|
|
1754
|
+
const endIdx = Math.max(0, totalLines - this.scrollbackOffset);
|
|
1755
|
+
const visibleLines = this.scrollbackBuffer.slice(startIdx, endIdx);
|
|
1756
|
+
// Build header bar with navigation hints
|
|
1757
|
+
const headerInfo = this.buildScrollbackHeader(cols, totalLines, startIdx, endIdx);
|
|
1758
|
+
this.write(ESC.TO(1, 1));
|
|
1759
|
+
this.write(headerInfo);
|
|
1760
|
+
// Render visible lines with line numbers and visual guides
|
|
1761
|
+
const lineNumWidth = String(totalLines).length + 1;
|
|
1762
|
+
const contentStart = 2; // Start after header
|
|
1763
|
+
for (let i = 0; i < Math.min(visibleLines.length, contentHeight - 1); i++) {
|
|
1764
|
+
const line = visibleLines[i] ?? '';
|
|
1765
|
+
const lineNum = startIdx + i + 1;
|
|
1766
|
+
this.write(ESC.TO(contentStart + i, 1));
|
|
1767
|
+
// Line number gutter
|
|
1768
|
+
const numStr = String(lineNum).padStart(lineNumWidth, ' ');
|
|
1769
|
+
this.write(theme.ui.muted(`${numStr} │ `));
|
|
1770
|
+
// Content with truncation
|
|
1771
|
+
const gutterWidth = lineNumWidth + 4;
|
|
1772
|
+
const maxLen = cols - gutterWidth - 2;
|
|
1773
|
+
const displayLine = line.length > maxLen ? line.slice(0, maxLen - 3) + '...' : line;
|
|
1774
|
+
this.write(displayLine);
|
|
1775
|
+
}
|
|
1776
|
+
// Add visual scroll track on the right edge
|
|
1777
|
+
this.renderScrollTrack(cols, contentHeight, totalLines, startIdx, endIdx);
|
|
1778
|
+
this.write(ESC.RESTORE);
|
|
1779
|
+
this.write(ESC.SHOW);
|
|
1780
|
+
}
|
|
1781
|
+
finally {
|
|
1782
|
+
writeLock.unlock();
|
|
1783
|
+
}
|
|
1784
|
+
// Re-render chat box
|
|
1785
|
+
this.forceRender();
|
|
1729
1786
|
}
|
|
1730
1787
|
/**
|
|
1731
1788
|
* Build scrollback header with navigation hints
|