diff options
Diffstat (limited to 'src/terminal.zig')
| -rw-r--r-- | src/terminal.zig | 7 |
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. |
