repos / zmx

session persistence for terminal processes
git clone https://github.com/neurosnap/zmx.git

commit
9db69ec
parent
48520f9
author
L.B.R.
date
2026-02-21 10:08:20 -0500 EST
fix(terminal): pop Kitty keyboard protocol on detach (#59)

1 files changed,  +3, -0
M src/main.zig
+3, -0
 1@@ -936,6 +936,9 @@ fn attach(daemon: *Daemon) !void {
 2         // want to corrupt any programs that rely on it including ghostty's session restore.
 3         const restore_seq = "\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l" ++
 4             "\x1b[?2004l\x1b[?1004l\x1b[?1049l" ++
 5+            // Restore pre-attach Kitty keyboard protocol mode so Ctrl combos
 6+            // return to legacy encoding in the user's outer shell.
 7+            "\x1b[<u" ++
 8             "\x1b[?25h";
 9         _ = posix.write(posix.STDOUT_FILENO, restore_seq) catch {};
10     }