summaryrefslogtreecommitdiff
path: root/src/Terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 14:43:17 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commitada81f05127506dec0dbb7af390cb43fd0da9d40 (patch)
tree6559fe9446530528dbd62b37a4dbf9d70c331736 /src/Terminal.zig
parentdef16a1bc1c71d2fdcc7954e2ddec1384c2f05f7 (diff)
downloadpardes-ada81f05127506dec0dbb7af390cb43fd0da9d40.tar.gz
pardes-ada81f05127506dec0dbb7af390cb43fd0da9d40.zip
A reused command pane leaves the last program's screen modes before the next command
A program that crashed out of a full screen left the command pane's emulator in the alternate screen with mouse reports, bracketed paste or a hidden cursor on, and the next command ran in that. Before the '% line' separator the pane now leaves the alternate screen, turns those modes off and soft-resets (DECSTR). The docs add that a command which clears the screen and its scrollback erases the pane's history above it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Terminal.zig')
-rw-r--r--src/Terminal.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Terminal.zig b/src/Terminal.zig
index cd292e5f..e204b44c 100644
--- a/src/Terminal.zig
+++ b/src/Terminal.zig
@@ -932,6 +932,13 @@ test "raw terminal output needs no position tracking allocations" {
try std.testing.expectEqual(pins, pane.terminal.?.vt.screens.active.pages.countTrackedPins());
}
+/// A full-screen program has the emulator on its alternate screen.
+pub fn onAlternateScreen(pane: *const Pane) bool {
+ if (comptime !enabled) return false;
+ const state = pane.terminal orelse return false;
+ return state.vt.screens.active_key == .alternate;
+}
+
pub fn promptInputReady(pane: *const Pane) bool {
if (comptime !enabled) return false;
const state = pane.terminal orelse return false;