Commit 266a733

Eric Bower  ·  2026-07-31 10:35:17 -0400 EDT
parent fa93c35
fix(switch): reset screen and pass shell to next daemon
1 files changed,  +5, -0
+5, -0
......@@ -1347,6 +1347,10 @@ fn attach(gpa: std.mem.Allocator, io: std.Io, daemon: *Daemon) !void {
13471347 .detach => return,
13481348 .switch_session => {
13491349 if (looper.session_name) |session_name| {
1350+ // Reset terminal modes when switching sessions
1351+ const restore_seq = "\x1bc";
1352+ _ = lib_posix.write(lib_posix.STDOUT_FILENO, restore_seq) catch {};
1353+
13501354 var cwd_buf: [std.fs.max_path_bytes]u8 = undefined;
13511355 const cwd_len = std.process.currentPath(io, &cwd_buf) catch 0;
13521356 const cwd = cwd_buf[0..cwd_len];
......@@ -1365,6 +1369,7 @@ fn attach(gpa: std.mem.Allocator, io: std.Io, daemon: *Daemon) !void {
13651369
13661370 var target_daemon = Daemon.init(io, daemon.cfg, session_name, target_path);
13671371 target_daemon.cwd = cwd;
1372+ target_daemon.shell = daemon.shell;
13681373 return attach(gpa, io, &target_daemon);
13691374 }
13701375 },