From aea460be8577be92b0910f1eb007fc99aab4ef30 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 7 Jul 2026 22:01:58 -0300 Subject: shell panes follow new pty output only in tty mode: normal/insert hold the scrolled view even when the pane isn't active (the old gate only protected the active pane; tag edits use the remembered body mode). New ttyfollow.snap: background job streams into a scrolled-up normal-mode pane without moving it, tty mode follows again. --- src/pardes.zig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 8fb0b43d..f647ed00 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -939,9 +939,12 @@ pub const Pardes = struct { const pane = p.panes[o.pane] orelse return; pane.tty_stream.appendSlice(p.gpa, o.bytes) catch {}; pane.stream.nextSlice(o.bytes); - // follow new output to the bottom — except in the pane being - // actively navigated in a text mode. - if (!(o.pane == p.active and pane.mode != .tty)) + // follow new output to the bottom only in tty mode; in + // normal/insert the user is reading scrollback and the view + // holds still while output streams in. Tag edits hijack + // pane.mode to insert — the body mode sits in tag_mode. + const bmode = if (pane.tag_edit) pane.tag_mode else pane.mode; + if (bmode == .tty) pane.vt.screens.active.scroll(.active); }, .eof => |e| p.removePane(e.pane), -- cgit v1.3