From 3abf68dbef943f03050eeca40aacb0067eaf7bbe Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Mon, 27 Apr 2026 21:50:13 -0700 Subject: [PATCH] fix(terminal): restore cursor visibility after scrollback replay (#1192) Co-authored-by: Orca --- .../src/components/terminal-pane/layout-serialization.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/terminal-pane/layout-serialization.ts b/src/renderer/src/components/terminal-pane/layout-serialization.ts index 90450199f2c..143d67827c1 100644 --- a/src/renderer/src/components/terminal-pane/layout-serialization.ts +++ b/src/renderer/src/components/terminal-pane/layout-serialization.ts @@ -24,11 +24,15 @@ export const EMPTY_LAYOUT: TerminalLayoutSnapshot = { // so replayed mode bits do not leak into the fresh shell. ghostty achieves // the same end by not restoring state at all. // +// 25 — DECTCEM cursor visibility (SerializeAddon captures +// `?25l` when the cursor was hidden at snapshot time; +// without an explicit `?25h` here the cursor stays +// invisible in the restored terminal) // 1000/1002/1003/1006 — mouse reporting variants // 1004 — focus event reporting (the actual bug source) // 2004 — bracketed paste export const POST_REPLAY_MODE_RESET = - '\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1004l\x1b[?1006l\x1b[?2004l' + '\x1b[?25h\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1004l\x1b[?1006l\x1b[?2004l' // Why: daemon snapshot restore reattaches to a live session, so we avoid the // full POST_REPLAY_MODE_RESET bundle there — a still-running TUI may still