erosolar-cli 1.7.361 → 1.7.362
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 +13 -32
- 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 +214 -144
- 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/dist/ui/ShellUIAdapter.d.ts +0 -27
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +9 -175
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/theme.d.ts +3 -108
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/theme.js +3 -124
- package/dist/ui/theme.js.map +1 -1
- package/dist/ui/toolDisplay.d.ts +0 -44
- package/dist/ui/toolDisplay.d.ts.map +1 -1
- package/dist/ui/toolDisplay.js +1 -147
- package/dist/ui/toolDisplay.js.map +1 -1
- package/dist/ui/unified/index.d.ts +0 -11
- package/dist/ui/unified/index.d.ts.map +1 -1
- package/dist/ui/unified/index.js +0 -16
- package/dist/ui/unified/index.js.map +1 -1
- package/dist/ui/unified/layout.d.ts.map +1 -1
- package/dist/ui/unified/layout.js +44 -29
- package/dist/ui/unified/layout.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/compactRenderer.d.ts +0 -139
- package/dist/ui/compactRenderer.d.ts.map +0 -1
- package/dist/ui/compactRenderer.js +0 -398
- package/dist/ui/compactRenderer.js.map +0 -1
- package/dist/ui/inPlaceUpdater.d.ts +0 -181
- package/dist/ui/inPlaceUpdater.d.ts.map +0 -1
- package/dist/ui/inPlaceUpdater.js +0 -515
- package/dist/ui/inPlaceUpdater.js.map +0 -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 all keyboard shortcuts.
|
|
254
|
-
* Shows
|
|
255
|
-
* Enhanced with comprehensive feature status display.
|
|
253
|
+
* Build mode controls line with all keyboard shortcuts and toggle states.
|
|
254
|
+
* Shows below the chat box input area with spelled-out key names.
|
|
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;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAuD3C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;AACvD,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAE/D;;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;IA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,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"}
|
|
@@ -117,7 +117,7 @@ export class TerminalInput extends EventEmitter {
|
|
|
117
117
|
editMode = 'display-edits';
|
|
118
118
|
verificationEnabled = true;
|
|
119
119
|
autoContinueEnabled = false;
|
|
120
|
-
verificationHotkey = 'alt+
|
|
120
|
+
verificationHotkey = 'alt+d';
|
|
121
121
|
autoContinueHotkey = 'alt+c';
|
|
122
122
|
thinkingHotkey = '/thinking';
|
|
123
123
|
modelLabel = null;
|
|
@@ -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,96 @@ export class TerminalInput extends EventEmitter {
|
|
|
688
696
|
return [`${leftText}${' '.repeat(spacing)}${rightText}`];
|
|
689
697
|
}
|
|
690
698
|
/**
|
|
691
|
-
* Build mode controls line with all keyboard shortcuts.
|
|
692
|
-
* Shows
|
|
693
|
-
* Enhanced with comprehensive feature status display.
|
|
699
|
+
* Build mode controls line with all keyboard shortcuts and toggle states.
|
|
700
|
+
* Shows below the chat box input area with spelled-out key names.
|
|
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 status with stop hint
|
|
700
706
|
if (this.streamingLabel) {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
// Override status (warnings, errors)
|
|
704
|
-
if (this.overrideStatusMessage) {
|
|
705
|
-
leftParts.push({ text: `⚠ ${this.overrideStatusMessage}`, tone: 'warn' });
|
|
706
|
-
}
|
|
707
|
-
// Main status message
|
|
708
|
-
if (this.statusMessage) {
|
|
709
|
-
leftParts.push({ text: this.statusMessage, tone: this.streamingLabel ? 'muted' : 'info' });
|
|
707
|
+
parts.push({ text: `◐ ${this.streamingLabel}`, tone: 'info' });
|
|
708
|
+
parts.push({ text: `Esc:stop`, tone: 'warn' });
|
|
710
709
|
}
|
|
711
|
-
//
|
|
712
|
-
//
|
|
713
|
-
// Interrupt shortcut (during streaming)
|
|
714
|
-
if (this.mode === 'streaming' || this.scrollRegionActive) {
|
|
715
|
-
leftParts.push({ text: `${this.formatHotkey('esc')} stop`, tone: 'warn' });
|
|
716
|
-
}
|
|
717
|
-
// Edit mode toggle (Shift+Tab)
|
|
718
|
-
const editHotkey = this.formatHotkey('shift+tab');
|
|
710
|
+
// === ALL MODE TOGGLES ===
|
|
711
|
+
// Edit mode (Shift+Tab)
|
|
719
712
|
const editIcon = this.editMode === 'display-edits' ? '✓' : '?';
|
|
720
|
-
const editLabel = this.editMode === 'display-edits' ? 'edits:auto' : 'edits:ask';
|
|
721
713
|
const editTone = this.editMode === 'display-edits' ? 'success' : 'muted';
|
|
722
|
-
|
|
723
|
-
//
|
|
714
|
+
parts.push({ text: `⇧Tab:edits${editIcon}`, tone: editTone });
|
|
715
|
+
// Verify mode (Alt+D for double-check)
|
|
724
716
|
const verifyIcon = this.verificationEnabled ? '✓' : '○';
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
leftParts.push({ text: `${continueHotkey}${autoIcon}${continueLabel}`, tone: this.autoContinueEnabled ? 'info' : 'muted' });
|
|
733
|
-
// Thinking mode toggle (if available)
|
|
717
|
+
const verifyTone = this.verificationEnabled ? 'success' : 'muted';
|
|
718
|
+
parts.push({ text: `⌥D:verify${verifyIcon}`, tone: verifyTone });
|
|
719
|
+
// Auto-continue (Alt+C)
|
|
720
|
+
const autoIcon = this.autoContinueEnabled ? '✓' : '○';
|
|
721
|
+
const autoTone = this.autoContinueEnabled ? 'success' : 'muted';
|
|
722
|
+
parts.push({ text: `⌥C:auto${autoIcon}`, tone: autoTone });
|
|
723
|
+
// Thinking mode (Alt+T) - show current mode
|
|
734
724
|
if (this.thinkingModeLabel) {
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
}
|
|
744
|
-
//
|
|
745
|
-
//
|
|
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
|
|
725
|
+
const thinkingShort = this.thinkingModeLabel === 'minimal' ? 'min' :
|
|
726
|
+
this.thinkingModeLabel === 'balanced' ? 'bal' :
|
|
727
|
+
this.thinkingModeLabel === 'extended' ? 'ext' : this.thinkingModeLabel;
|
|
728
|
+
parts.push({ text: `⌥T:think:${thinkingShort}`, tone: 'info' });
|
|
729
|
+
}
|
|
730
|
+
// Clear context (Alt+X)
|
|
731
|
+
parts.push({ text: `⌥X:clear`, tone: 'muted' });
|
|
732
|
+
// Scroll (PgUp/Dn)
|
|
733
|
+
parts.push({ text: `PgUp/Dn:scroll`, tone: 'muted' });
|
|
734
|
+
// === STATUS INFO ===
|
|
735
|
+
// Context remaining
|
|
759
736
|
const contextRemaining = this.computeContextRemaining();
|
|
760
737
|
if (contextRemaining !== null) {
|
|
761
738
|
const tone = contextRemaining <= 10 ? 'warn' : contextRemaining <= 30 ? 'info' : 'muted';
|
|
762
|
-
const icon = contextRemaining <=
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
return renderStatusLine(merged, width);
|
|
777
|
-
}
|
|
778
|
-
const leftWidth = Math.max(12, Math.floor(width * 0.65));
|
|
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
|
+
const icon = contextRemaining <= 20 ? '⚠' : '◉';
|
|
740
|
+
parts.push({ text: `${icon}ctx:${contextRemaining}%`, tone });
|
|
741
|
+
}
|
|
742
|
+
// Token usage
|
|
743
|
+
if (this.metaTokensUsed !== null) {
|
|
744
|
+
const used = this.formatTokenCount(this.metaTokensUsed);
|
|
745
|
+
const limit = this.metaTokenLimit ? `/${this.formatTokenCount(this.metaTokenLimit)}` : '';
|
|
746
|
+
parts.push({ text: `⊛${used}${limit}`, tone: 'muted' });
|
|
747
|
+
}
|
|
748
|
+
// Elapsed time during streaming
|
|
749
|
+
if (this.metaElapsedSeconds !== null && this.streamingLabel) {
|
|
750
|
+
parts.push({ text: `⏱${this.formatElapsedLabel(this.metaElapsedSeconds)}`, tone: 'muted' });
|
|
751
|
+
}
|
|
752
|
+
return renderStatusLine(parts, width);
|
|
784
753
|
}
|
|
785
754
|
formatHotkey(hotkey) {
|
|
786
755
|
const normalized = hotkey.trim().toLowerCase();
|
|
787
756
|
if (!normalized)
|
|
788
757
|
return hotkey;
|
|
789
758
|
const parts = normalized.split('+').filter(Boolean);
|
|
759
|
+
// Use readable key names instead of symbols for better terminal compatibility
|
|
790
760
|
const map = {
|
|
791
|
-
shift: '
|
|
792
|
-
sh: '
|
|
793
|
-
alt: '
|
|
794
|
-
option: '
|
|
795
|
-
opt: '
|
|
796
|
-
ctrl: '
|
|
797
|
-
control: '
|
|
798
|
-
cmd: '
|
|
799
|
-
meta: '
|
|
761
|
+
shift: 'Shift',
|
|
762
|
+
sh: 'Shift',
|
|
763
|
+
alt: 'Alt',
|
|
764
|
+
option: 'Alt',
|
|
765
|
+
opt: 'Alt',
|
|
766
|
+
ctrl: 'Ctrl',
|
|
767
|
+
control: 'Ctrl',
|
|
768
|
+
cmd: 'Cmd',
|
|
769
|
+
meta: 'Cmd',
|
|
770
|
+
esc: 'Esc',
|
|
771
|
+
escape: 'Esc',
|
|
772
|
+
tab: 'Tab',
|
|
773
|
+
return: 'Enter',
|
|
774
|
+
enter: 'Enter',
|
|
775
|
+
pageup: 'PgUp',
|
|
776
|
+
pagedown: 'PgDn',
|
|
777
|
+
home: 'Home',
|
|
778
|
+
end: 'End',
|
|
800
779
|
};
|
|
801
780
|
const formatted = parts
|
|
802
781
|
.map((part) => {
|
|
803
|
-
const
|
|
804
|
-
if (
|
|
805
|
-
return
|
|
806
|
-
return part.length === 1 ? part.toUpperCase() : part.toUpperCase();
|
|
782
|
+
const label = map[part];
|
|
783
|
+
if (label)
|
|
784
|
+
return label;
|
|
785
|
+
return part.length === 1 ? part.toUpperCase() : part.charAt(0).toUpperCase() + part.slice(1);
|
|
807
786
|
})
|
|
808
|
-
.join('');
|
|
809
|
-
return formatted
|
|
787
|
+
.join('+');
|
|
788
|
+
return `[${formatted}]`;
|
|
810
789
|
}
|
|
811
790
|
computeContextRemaining() {
|
|
812
791
|
if (this.contextUsage === null) {
|
|
@@ -972,7 +951,7 @@ export class TerminalInput extends EventEmitter {
|
|
|
972
951
|
* Calculate chat box height.
|
|
973
952
|
*/
|
|
974
953
|
getChatBoxHeight() {
|
|
975
|
-
return
|
|
954
|
+
return 5; // Fixed: divider + input + status + buffer
|
|
976
955
|
}
|
|
977
956
|
/**
|
|
978
957
|
* @deprecated Use streamContent() instead
|
|
@@ -1008,26 +987,41 @@ export class TerminalInput extends EventEmitter {
|
|
|
1008
987
|
}
|
|
1009
988
|
}
|
|
1010
989
|
/**
|
|
1011
|
-
* Enter alternate screen buffer.
|
|
1012
|
-
*
|
|
990
|
+
* Enter alternate screen buffer and clear it.
|
|
991
|
+
* This gives us full control over the terminal without affecting user's history.
|
|
1013
992
|
*/
|
|
1014
993
|
enterAlternateScreen() {
|
|
1015
|
-
|
|
1016
|
-
|
|
994
|
+
writeLock.lock('enterAltScreen');
|
|
995
|
+
try {
|
|
996
|
+
this.write(ESC.ENTER_ALT_SCREEN);
|
|
997
|
+
this.write(ESC.HOME);
|
|
998
|
+
this.write(ESC.CLEAR_SCREEN);
|
|
999
|
+
this.contentRow = 1;
|
|
1000
|
+
this.alternateScreenActive = true;
|
|
1001
|
+
}
|
|
1002
|
+
finally {
|
|
1003
|
+
writeLock.unlock();
|
|
1004
|
+
}
|
|
1017
1005
|
}
|
|
1018
1006
|
/**
|
|
1019
1007
|
* Exit alternate screen buffer.
|
|
1020
|
-
*
|
|
1008
|
+
* Restores the user's previous terminal content.
|
|
1021
1009
|
*/
|
|
1022
1010
|
exitAlternateScreen() {
|
|
1023
|
-
|
|
1011
|
+
writeLock.lock('exitAltScreen');
|
|
1012
|
+
try {
|
|
1013
|
+
this.write(ESC.EXIT_ALT_SCREEN);
|
|
1014
|
+
this.alternateScreenActive = false;
|
|
1015
|
+
}
|
|
1016
|
+
finally {
|
|
1017
|
+
writeLock.unlock();
|
|
1018
|
+
}
|
|
1024
1019
|
}
|
|
1025
1020
|
/**
|
|
1026
1021
|
* Check if alternate screen buffer is currently active.
|
|
1027
|
-
* Always returns false - using terminal-native mode.
|
|
1028
1022
|
*/
|
|
1029
1023
|
isAlternateScreenActive() {
|
|
1030
|
-
return
|
|
1024
|
+
return this.alternateScreenActive;
|
|
1031
1025
|
}
|
|
1032
1026
|
/**
|
|
1033
1027
|
* Get a snapshot of the scrollback buffer (for display on exit).
|
|
@@ -1036,17 +1030,14 @@ export class TerminalInput extends EventEmitter {
|
|
|
1036
1030
|
return [...this.scrollbackBuffer];
|
|
1037
1031
|
}
|
|
1038
1032
|
/**
|
|
1039
|
-
* Clear the
|
|
1040
|
-
*
|
|
1041
|
-
* rather than clearing history (preserving scrollback).
|
|
1033
|
+
* Clear the entire terminal screen and reset content position.
|
|
1034
|
+
* This removes all content including the launching command.
|
|
1042
1035
|
*/
|
|
1043
1036
|
clearScreen() {
|
|
1044
1037
|
writeLock.lock('clearScreen');
|
|
1045
1038
|
try {
|
|
1046
|
-
// In native mode, scroll past existing content rather than clearing
|
|
1047
|
-
const { rows } = this.getSize();
|
|
1048
|
-
this.write('\n'.repeat(rows));
|
|
1049
1039
|
this.write(ESC.HOME);
|
|
1040
|
+
this.write(ESC.CLEAR_SCREEN);
|
|
1050
1041
|
this.contentRow = 1;
|
|
1051
1042
|
}
|
|
1052
1043
|
finally {
|
|
@@ -1146,8 +1137,8 @@ export class TerminalInput extends EventEmitter {
|
|
|
1146
1137
|
this.insertNewline();
|
|
1147
1138
|
break;
|
|
1148
1139
|
// === MODE TOGGLES ===
|
|
1149
|
-
case '
|
|
1150
|
-
// Alt+
|
|
1140
|
+
case 'd':
|
|
1141
|
+
// Alt+D: Toggle verification/double-check mode (auto-tests after edits)
|
|
1151
1142
|
this.emit('toggleVerify');
|
|
1152
1143
|
break;
|
|
1153
1144
|
case 'c':
|
|
@@ -1214,12 +1205,25 @@ export class TerminalInput extends EventEmitter {
|
|
|
1214
1205
|
return Math.max(5, rows - chatBoxHeight - 2);
|
|
1215
1206
|
}
|
|
1216
1207
|
/**
|
|
1217
|
-
* Build scroll indicator for the divider line.
|
|
1218
|
-
*
|
|
1219
|
-
* This returns null - no scroll indicator is shown.
|
|
1208
|
+
* Build scroll indicator for the divider line (Claude Code style).
|
|
1209
|
+
* Shows scroll position when in scrollback mode, or history size hint when idle.
|
|
1220
1210
|
*/
|
|
1221
1211
|
buildScrollIndicator() {
|
|
1222
|
-
|
|
1212
|
+
const bufferSize = this.scrollbackBuffer.length;
|
|
1213
|
+
// In scrollback mode - show position
|
|
1214
|
+
if (this.isInScrollbackMode && this.scrollbackOffset > 0) {
|
|
1215
|
+
const { rows } = this.getSize();
|
|
1216
|
+
const chatBoxHeight = this.getChatBoxHeight();
|
|
1217
|
+
const viewportHeight = Math.max(1, rows - chatBoxHeight);
|
|
1218
|
+
const currentPos = Math.max(0, bufferSize - this.scrollbackOffset - viewportHeight);
|
|
1219
|
+
const pct = bufferSize > 0 ? Math.round((currentPos / bufferSize) * 100) : 0;
|
|
1220
|
+
return `↑${this.scrollbackOffset} · ${pct}% · PgUp/Dn`;
|
|
1221
|
+
}
|
|
1222
|
+
// Not in scrollback - show hint if there's history
|
|
1223
|
+
if (bufferSize > 20) {
|
|
1224
|
+
const sizeLabel = bufferSize >= 1000 ? `${Math.floor(bufferSize / 1000)}k` : `${bufferSize}`;
|
|
1225
|
+
return `↕${sizeLabel}L · PgUp`;
|
|
1226
|
+
}
|
|
1223
1227
|
return null;
|
|
1224
1228
|
}
|
|
1225
1229
|
handleSpecialKey(_str, key) {
|
|
@@ -1281,11 +1285,10 @@ export class TerminalInput extends EventEmitter {
|
|
|
1281
1285
|
}
|
|
1282
1286
|
return true;
|
|
1283
1287
|
case 'pageup':
|
|
1284
|
-
//
|
|
1285
|
-
// Users should use terminal's native scrollback if available
|
|
1288
|
+
this.scrollUp(20); // Scroll up by 20 lines
|
|
1286
1289
|
return true;
|
|
1287
1290
|
case 'pagedown':
|
|
1288
|
-
//
|
|
1291
|
+
this.scrollDown(20); // Scroll down by 20 lines
|
|
1289
1292
|
return true;
|
|
1290
1293
|
case 'tab':
|
|
1291
1294
|
if (key.shift) {
|
|
@@ -1679,53 +1682,120 @@ export class TerminalInput extends EventEmitter {
|
|
|
1679
1682
|
}
|
|
1680
1683
|
/**
|
|
1681
1684
|
* 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
1685
|
*/
|
|
1685
|
-
scrollUp(
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1686
|
+
scrollUp(lines = 10) {
|
|
1687
|
+
const { rows } = this.getSize();
|
|
1688
|
+
const chatBoxHeight = this.getChatBoxHeight();
|
|
1689
|
+
const visibleLines = Math.max(1, rows - chatBoxHeight);
|
|
1690
|
+
// Calculate max scroll offset
|
|
1691
|
+
const maxOffset = Math.max(0, this.scrollbackBuffer.length - visibleLines);
|
|
1692
|
+
this.scrollbackOffset = Math.min(this.scrollbackOffset + lines, maxOffset);
|
|
1693
|
+
this.isInScrollbackMode = this.scrollbackOffset > 0;
|
|
1694
|
+
if (this.isInScrollbackMode) {
|
|
1695
|
+
this.renderScrollbackView();
|
|
1696
|
+
}
|
|
1689
1697
|
}
|
|
1690
1698
|
/**
|
|
1691
1699
|
* Scroll down by a number of lines (PageDown)
|
|
1692
|
-
* Note: Scrollback disabled - see scrollUp comment
|
|
1693
1700
|
*/
|
|
1694
|
-
scrollDown(
|
|
1695
|
-
|
|
1701
|
+
scrollDown(lines = 10) {
|
|
1702
|
+
this.scrollbackOffset = Math.max(0, this.scrollbackOffset - lines);
|
|
1703
|
+
this.isInScrollbackMode = this.scrollbackOffset > 0;
|
|
1704
|
+
if (this.isInScrollbackMode) {
|
|
1705
|
+
this.renderScrollbackView();
|
|
1706
|
+
}
|
|
1707
|
+
else {
|
|
1708
|
+
// Returned to live mode - force re-render
|
|
1709
|
+
this.forceRender();
|
|
1710
|
+
}
|
|
1696
1711
|
}
|
|
1697
1712
|
/**
|
|
1698
1713
|
* 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
1714
|
*/
|
|
1702
1715
|
scrollToTop() {
|
|
1703
|
-
|
|
1716
|
+
const { rows } = this.getSize();
|
|
1717
|
+
const chatBoxHeight = this.getChatBoxHeight();
|
|
1718
|
+
const visibleLines = Math.max(1, rows - chatBoxHeight);
|
|
1719
|
+
const maxOffset = Math.max(0, this.scrollbackBuffer.length - visibleLines);
|
|
1720
|
+
this.scrollbackOffset = maxOffset;
|
|
1721
|
+
this.isInScrollbackMode = true;
|
|
1722
|
+
this.renderScrollbackView();
|
|
1704
1723
|
}
|
|
1705
1724
|
/**
|
|
1706
1725
|
* Jump to the bottom (live mode)
|
|
1707
|
-
* DISABLED: Scrollback navigation causes display corruption.
|
|
1708
1726
|
*/
|
|
1709
1727
|
scrollToBottom() {
|
|
1710
|
-
// Reset scrollback state in case it was somehow enabled
|
|
1711
1728
|
this.scrollbackOffset = 0;
|
|
1712
1729
|
this.isInScrollbackMode = false;
|
|
1730
|
+
this.forceRender();
|
|
1713
1731
|
}
|
|
1714
1732
|
/**
|
|
1715
1733
|
* Toggle scrollback mode on/off (Alt+S hotkey)
|
|
1716
|
-
* DISABLED: Scrollback navigation causes display corruption in alternate screen mode.
|
|
1717
1734
|
*/
|
|
1718
1735
|
toggleScrollbackMode() {
|
|
1719
|
-
|
|
1736
|
+
if (this.isInScrollbackMode) {
|
|
1737
|
+
this.scrollToBottom();
|
|
1738
|
+
}
|
|
1739
|
+
else if (this.scrollbackBuffer.length > 0) {
|
|
1740
|
+
this.scrollUp(20);
|
|
1741
|
+
}
|
|
1720
1742
|
}
|
|
1721
1743
|
/**
|
|
1722
|
-
* Render the scrollback buffer view
|
|
1723
|
-
*
|
|
1724
|
-
*
|
|
1725
|
-
*
|
|
1744
|
+
* Render the scrollback buffer view with enhanced visuals
|
|
1745
|
+
* Features:
|
|
1746
|
+
* - Visual scroll position indicator
|
|
1747
|
+
* - Progress bar showing position in history
|
|
1748
|
+
* - Keyboard navigation hints
|
|
1749
|
+
* - Animated indicators
|
|
1726
1750
|
*/
|
|
1727
1751
|
renderScrollbackView() {
|
|
1728
|
-
|
|
1752
|
+
const { rows, cols } = this.getSize();
|
|
1753
|
+
const chatBoxHeight = this.getChatBoxHeight();
|
|
1754
|
+
const contentHeight = Math.max(1, rows - chatBoxHeight);
|
|
1755
|
+
writeLock.lock('renderScrollback');
|
|
1756
|
+
try {
|
|
1757
|
+
this.write(ESC.SAVE);
|
|
1758
|
+
this.write(ESC.HIDE);
|
|
1759
|
+
// Clear content area
|
|
1760
|
+
for (let i = 1; i <= contentHeight; i++) {
|
|
1761
|
+
this.write(ESC.TO(i, 1));
|
|
1762
|
+
this.write(ESC.CLEAR_LINE);
|
|
1763
|
+
}
|
|
1764
|
+
// Calculate which lines to show
|
|
1765
|
+
const totalLines = this.scrollbackBuffer.length;
|
|
1766
|
+
const startIdx = Math.max(0, totalLines - this.scrollbackOffset - contentHeight);
|
|
1767
|
+
const endIdx = Math.max(0, totalLines - this.scrollbackOffset);
|
|
1768
|
+
const visibleLines = this.scrollbackBuffer.slice(startIdx, endIdx);
|
|
1769
|
+
// Build header bar with navigation hints
|
|
1770
|
+
const headerInfo = this.buildScrollbackHeader(cols, totalLines, startIdx, endIdx);
|
|
1771
|
+
this.write(ESC.TO(1, 1));
|
|
1772
|
+
this.write(headerInfo);
|
|
1773
|
+
// Render visible lines with line numbers and visual guides
|
|
1774
|
+
const lineNumWidth = String(totalLines).length + 1;
|
|
1775
|
+
const contentStart = 2; // Start after header
|
|
1776
|
+
for (let i = 0; i < Math.min(visibleLines.length, contentHeight - 1); i++) {
|
|
1777
|
+
const line = visibleLines[i] ?? '';
|
|
1778
|
+
const lineNum = startIdx + i + 1;
|
|
1779
|
+
this.write(ESC.TO(contentStart + i, 1));
|
|
1780
|
+
// Line number gutter
|
|
1781
|
+
const numStr = String(lineNum).padStart(lineNumWidth, ' ');
|
|
1782
|
+
this.write(theme.ui.muted(`${numStr} │ `));
|
|
1783
|
+
// Content with truncation
|
|
1784
|
+
const gutterWidth = lineNumWidth + 4;
|
|
1785
|
+
const maxLen = cols - gutterWidth - 2;
|
|
1786
|
+
const displayLine = line.length > maxLen ? line.slice(0, maxLen - 3) + '...' : line;
|
|
1787
|
+
this.write(displayLine);
|
|
1788
|
+
}
|
|
1789
|
+
// Add visual scroll track on the right edge
|
|
1790
|
+
this.renderScrollTrack(cols, contentHeight, totalLines, startIdx, endIdx);
|
|
1791
|
+
this.write(ESC.RESTORE);
|
|
1792
|
+
this.write(ESC.SHOW);
|
|
1793
|
+
}
|
|
1794
|
+
finally {
|
|
1795
|
+
writeLock.unlock();
|
|
1796
|
+
}
|
|
1797
|
+
// Re-render chat box
|
|
1798
|
+
this.forceRender();
|
|
1729
1799
|
}
|
|
1730
1800
|
/**
|
|
1731
1801
|
* Build scrollback header with navigation hints
|