summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-07 22:01:58 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commitaea460be8577be92b0910f1eb007fc99aab4ef30 (patch)
treee66c4d4aded304030720c86cbdce875232fb6b4b /src
parent4612901858b229533c8e2ffc36db3da6bbadaa32 (diff)
downloadpardes-aea460be8577be92b0910f1eb007fc99aab4ef30.tar.gz
pardes-aea460be8577be92b0910f1eb007fc99aab4ef30.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/pardes.zig9
1 files changed, 6 insertions, 3 deletions
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),