pi-interactive-shell 0.3.2 → 0.3.3
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/CHANGELOG.md +5 -0
- package/overlay-component.ts +28 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the `pi-interactive-shell` extension will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.3.3] - 2026-01-17
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- Handoff preview now uses raw output stream instead of xterm buffer. TUI apps using alternate screen buffer (like Codex, Claude, etc.) would show misleading/stale content in the preview.
|
|
9
|
+
|
|
5
10
|
## [0.3.0] - 2026-01-17
|
|
6
11
|
|
|
7
12
|
### Added
|
package/overlay-component.ts
CHANGED
|
@@ -438,11 +438,20 @@ export class InteractiveShellOverlay implements Component, Focusable {
|
|
|
438
438
|
const maxChars = this.options.handoffPreviewMaxChars ?? this.config.handoffPreviewMaxChars;
|
|
439
439
|
if (lines <= 0 || maxChars <= 0) return undefined;
|
|
440
440
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
441
|
+
// Use raw output stream instead of xterm buffer - TUI apps using alternate
|
|
442
|
+
// screen buffer can have misleading content in getTailLines()
|
|
443
|
+
const rawOutput = this.session.getRawStream({ stripAnsi: true });
|
|
444
|
+
const outputLines = rawOutput.split("\n");
|
|
445
|
+
|
|
446
|
+
// Get last N lines, respecting maxChars
|
|
447
|
+
let tail: string[] = [];
|
|
448
|
+
let charCount = 0;
|
|
449
|
+
for (let i = outputLines.length - 1; i >= 0 && tail.length < lines; i--) {
|
|
450
|
+
const line = outputLines[i];
|
|
451
|
+
if (charCount + line.length > maxChars && tail.length > 0) break;
|
|
452
|
+
tail.unshift(line);
|
|
453
|
+
charCount += line.length + 1; // +1 for newline
|
|
454
|
+
}
|
|
446
455
|
|
|
447
456
|
return { type: "tail", when, lines: tail };
|
|
448
457
|
}
|
|
@@ -907,11 +916,20 @@ export class ReattachOverlay implements Component, Focusable {
|
|
|
907
916
|
const maxChars = this.config.handoffPreviewMaxChars;
|
|
908
917
|
if (lines <= 0 || maxChars <= 0) return undefined;
|
|
909
918
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
919
|
+
// Use raw output stream instead of xterm buffer - TUI apps using alternate
|
|
920
|
+
// screen buffer can have misleading content in getTailLines()
|
|
921
|
+
const rawOutput = this.session.getRawStream({ stripAnsi: true });
|
|
922
|
+
const outputLines = rawOutput.split("\n");
|
|
923
|
+
|
|
924
|
+
// Get last N lines, respecting maxChars
|
|
925
|
+
let tail: string[] = [];
|
|
926
|
+
let charCount = 0;
|
|
927
|
+
for (let i = outputLines.length - 1; i >= 0 && tail.length < lines; i--) {
|
|
928
|
+
const line = outputLines[i];
|
|
929
|
+
if (charCount + line.length > maxChars && tail.length > 0) break;
|
|
930
|
+
tail.unshift(line);
|
|
931
|
+
charCount += line.length + 1; // +1 for newline
|
|
932
|
+
}
|
|
915
933
|
|
|
916
934
|
return { type: "tail", when, lines: tail };
|
|
917
935
|
}
|