diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-21 17:47:24 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-21 18:30:04 -0300 |
| commit | 0000e169c52da6d77e9cf3538896d7202d0a313b (patch) | |
| tree | 326a58d65dc145314a828c28b896d1d18bb9afe4 | |
| parent | f11ba0c54b500d855740c54f26208217793bcef6 (diff) | |
| download | pardes-0000e169c52da6d77e9cf3538896d7202d0a313b.tar.gz pardes-0000e169c52da6d77e9cf3538896d7202d0a313b.zip | |
a terminal showing a kitty image no longer parts a screen-state client from its session: whether the terminal holds an image is the session's fact, `Pane.term_images`, set at its output's step (core/Core.zig `.output`: taped under screen state, tape site `images`, the session's answer replayed on every client, whose emulator is fed cells and never has the image; read directly otherwise, every side fed the same bytes) and read by the tag (core/tagline.zig, for `Term.hasImages` of each side's own emulator, whose ` petscii:on|off` made the digested `tag_lead` longer on the session's side only: every quiet check differed and a plain attach joined again 3.2 times a second for as long as the image was there, the installed build too); taped and not a bit beside the cells because the step that computes the tag is the output's own unit, which a client replays before that pump's flush reaches it; wire 28 (a pane's new field in the join's dump and the digest, the tape's new site; test/daemon.py `WIRE`); daemon.py `--kitty-image` on Debug: 0 joins in 5 s, 3 of 3 (16 before); core-test 898/1060 (162 skipped), shell-test 1102/1105 (3 skipped), term-test 18/18, kitty-test 45/45
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
| -rw-r--r-- | abi/wire.zig | 6 | ||||
| -rw-r--r-- | core/Core.zig | 1 | ||||
| -rw-r--r-- | core/panes.zig | 5 | ||||
| -rw-r--r-- | core/tagline.zig | 2 | ||||
| -rw-r--r-- | core/tape.zig | 3 | ||||
| -rw-r--r-- | test/daemon.py | 2 |
6 files changed, 16 insertions, 3 deletions
diff --git a/abi/wire.zig b/abi/wire.zig index 88a82e52..d7df7bc3 100644 --- a/abi/wire.zig +++ b/abi/wire.zig @@ -10,6 +10,10 @@ const pardes = @import("core"); const config = @import("pardes_options"); const build_info = @import("build_info"); +/// 28: whether a terminal holds a kitty image is the session's, taped +/// after its output (tape site `images`), and a pane's (Pane.term_images) +/// in its join's dump and its digest: a screen-state client's tag says +/// what the session's does; /// 27: a pair's first client makes its own core from the session's /// options and says its digest (`boot`) before its `far`: the session sends /// no dump when its own at the join has the same; @@ -46,7 +50,7 @@ const build_info = @import("build_info"); /// part B); 14: the hello names a session and /// carries the semantics hash, and a ping is answered (phase 5's /// groundwork); 13: the frames went (phase 3). -pub const version: u16 = 27; +pub const version: u16 = 28; /// The terminal's build and the window's step alike (`semantics`). const family = switch (config.platform) { diff --git a/core/Core.zig b/core/Core.zig index 177a6e78..73d0738a 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -1684,6 +1684,7 @@ fn updateInner(p: *Pardes, ev: Event) void { pane.shell_spoke = true; ctlfs.events.notePtyOutput(p, o.pane.index(), o.bytes); pane.feedOutput(p, o.bytes); + pane.term_images = if (p.tape.screen_state) p.tape.value(.images, pardes.Term.hasImages, .{pane.terminal}) else pardes.Term.hasImages(pane.terminal); ctlfs.pty.noteMarks(p, o.pane.index(), pane); exec.flushReplEnter(p, o.pane.index(), true); }, diff --git a/core/panes.zig b/core/panes.zig index 8b152132..2f561d05 100644 --- a/core/panes.zig +++ b/core/panes.zig @@ -134,6 +134,11 @@ pub const Pane = struct { /// cell), and its kitty graphics drawn as glyph art (Petscii). term_mouse: ?Term.Coordinate = null, term_petscii: bool = false, + /// Whether its terminal holds a kitty image, as the session's emulator + /// said after its program's last output (taped under screen state: a + /// client's emulator is fed the session's cells, never an image). Its + /// tag says so (tagline.zig), on every side. + term_images: bool = false, gpa: std.mem.Allocator, serial: u32 = 0, /// What the control filesystem keeps of this pane -- addr and limit, the diff --git a/core/tagline.zig b/core/tagline.zig index afee0659..26f83fba 100644 --- a/core/tagline.zig +++ b/core/tagline.zig @@ -160,7 +160,7 @@ pub fn pathPrefix(p: *const Pardes, arena: std.mem.Allocator, pane: *Pane) ![]co if (pane.terminal != null) { const chosen = pane.term_petscii; const on = chosen or !p.view().frontend.native_images; - if (chosen or panes.Term.hasImages(pane.terminal)) + if (chosen or pane.term_images) return std.fmt.allocPrint(arena, "{s} petscii:{s}", .{ (try shownDir(arena, pane)), if (on) "on" else "off" }); } return (try shownDir(arena, pane)); diff --git a/core/tape.zig b/core/tape.zig index d32f8dd8..f231831d 100644 --- a/core/tape.zig +++ b/core/tape.zig @@ -140,6 +140,9 @@ pub const Site = enum(u16) { /// A kitty image's medium as a terminal's emulator read it (a file, a /// temporary file, shared memory: Term.media), its bytes or its failure. medium, + /// Whether a terminal holds a kitty image after its program's output + /// (Pane.term_images): a screen-state replica's emulator never has one. + images, }; /// What the sites return. wire.semantics hashes their shape with the diff --git a/test/daemon.py b/test/daemon.py index e1be141a..e334b6e8 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -258,7 +258,7 @@ class Replica: """A replica's connection (abi/wire.zig): length-prefixed messages, a tag byte and a little-endian u32 length. It is a near client: its first word after the hello says so.""" - WIRE = 27 + WIRE = 28 def __init__(self, path, timeout=10): self.path, self.timeout = path, timeout |
