summaryrefslogtreecommitdiff
path: root/src/terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 18:04:38 -0300
committerGabriel Schneider <[email protected]>2026-10-29 21:13:33 -0300
commit7ba57610929544bf3d1b3d0bf65dbb039d97942b (patch)
tree3cfa59be7b0b56e82b8bff80856eaa7f1cf63b53 /src/terminal.zig
parent70de5ec5ff3dad01afcc45244ad5e5a481486da6 (diff)
downloadpardes-7ba57610929544bf3d1b3d0bf65dbb039d97942b.tar.gz
pardes-7ba57610929544bf3d1b3d0bf65dbb039d97942b.zip
snapshots: dump, load, restore, tagnav and headersweep-restored show the session as it was dumped: a terminal's view, its prompts hidden in text mode, a pane's message, typed text over its history
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/terminal.zig')
-rw-r--r--src/terminal.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/terminal.zig b/src/terminal.zig
index 6fdd46f0..ad35784f 100644
--- a/src/terminal.zig
+++ b/src/terminal.zig
@@ -835,8 +835,11 @@ pub const restored_banner = "\x1b[0m\r\n\x1b[2m\u{2500}\u{2500} restored history
pub fn reviveShell(pane: *Pane) void {
if (comptime !enabled) return;
if (pane.terminal == null) return;
- // The primary screen, modes and mouse as a shell starts with them.
- ingest(pane, "\x1b[?1049l\x1b[!p\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?2004l\x1b[<u");
+ // The primary screen, keys, cursor and mouse as a shell starts with
+ // them, the cursor where it was (a soft reset, or leaving a primary
+ // screen for itself, would take it home).
+ if (pane.terminal.?.vt.screens.active_key == .alternate) ingest(pane, "\x1b[?1049l");
+ ingest(pane, "\x1b[?1l\x1b>\x1b[?25h\x1b[?7h\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l\x1b[?2004l\x1b[<u");
ingest(pane, restored_banner);
// What the old shell was, ran and said is gone with it: the REPL it
// ran, the Tty+ word naming it.