diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 22:02:15 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 22:06:24 -0300 |
| commit | 7d10ad68b07a7bbab23fa8565d39183e4387c478 (patch) | |
| tree | 5711e0680c6eb681a02965c17eb616265f189131 /src/tui | |
| parent | 484841325bb35b0bb7c55f7980178388c4e39c71 (diff) | |
| download | pardes-7d10ad68b07a7bbab23fa8565d39183e4387c478.tar.gz pardes-7d10ad68b07a7bbab23fa8565d39183e4387c478.zip | |
words: `remote` out of the code where it meant a client (PARDES.md ruling 1: it meant any client, this machine's too): tui.zig's `Remote` is `Client` (the window's word already), `tui.remote` and `gui.remote` are `runClient`, `gui.remoteSession` is `clientSession`, `main.remoteAttach` is `attachClient`, the Shell's and Input's `remote` fields `client`, `fonts.remote` `fromSession` and the window's `remote_font_request` `session_font_request`; what a person reads: the window client's log "remote font is not installed here" is "the session's font is not installed here", attach's "no runtime directory to name the remote socket by" names the far socket; NOT renamed: the env var PARDES_REMOTE_RUNTIME (the user types it), 9p_io's error.Remote and RemoteError (a 9P peer's refusal), fs.zig's remote_path (a 9P mount's), tui.zig:86's terminal over ssh and :1579's shell over ssh, pty.zig's test prompt; names only, no logic moved; tui core-test 811/950 (139 skipped), shell-test 993/996, behaviour-test 269/273 (the four addon ABI tests the base fails), process-test 2 of 144 failed (lspcomplete and lspcompletemoved, the base's), daemon.py main passes; gui frame corpus 77/77 byte-identical against mbase, unit-test 1582/1590 (the base's 8 failures)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'src/tui')
| -rw-r--r-- | src/tui/tui.zig | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/tui/tui.zig b/src/tui/tui.zig index ce2dc84a..7aebeb7a 100644 --- a/src/tui/tui.zig +++ b/src/tui/tui.zig @@ -619,15 +619,15 @@ pub fn run(init: std.process.Init, opts: pardes.Options, term: Term) !void { try localSession(init, opts, &screen, &loop, &paste_buf); } -/// A replica client's link to its session (`remote`), drawn here. -const Remote = struct { +/// A replica client's link to its session (`runClient`), drawn here. +const Client = struct { link: replica.Link, /// The client's own view drawn on its terminal, outside any step: the /// replica's digest stays the session's (views.drawOne). What the host /// writes in the core as it presents (a frame skipped, one owed) is put /// back, as the frame statistics are this process's. - fn draw(c: *Remote, s: *Shell) void { + fn draw(c: *Client, s: *Shell) void { const r = c.link.r; const core = r.core(); const skipped = core.present_skipped; @@ -664,7 +664,7 @@ fn linkReader(gpa: std.mem.Allocator, fd: posix.fd_t, rest: *replica.Framer, loo /// from the session's dump, applies its keys at once (src/replica.zig); /// the session's units are the truth it rolls back to. Its own view of the /// session is drawn here, as the session draws its terminals'. -pub fn remote(init: std.process.Init, opts: pardes.Options, path: []const u8, session: []const u8, far_link: bool) !void { +pub fn runClient(init: std.process.Init, opts: pardes.Options, path: []const u8, session: []const u8, far_link: bool) !void { const io = init.io; const gpa = init.gpa; const Said = struct { @@ -718,8 +718,8 @@ pub fn remote(init: std.process.Init, opts: pardes.Options, path: []const u8, se var loop: Loop = .init(io, &screen.tty, &screen.vx); var frame_arena: std.heap.ArenaAllocator = .init(allocs.frame); defer frame_arena.deinit(); - var remote_link: Remote = .{ .link = .{ .r = r, .fd = joined.fd } }; - const link = &remote_link.link; + var client_link: Client = .{ .link = .{ .r = r, .fd = joined.fd } }; + const link = &client_link.link; try link.fromEnv(gpa, init.environ_map); defer link.deinit(gpa); var sh: Shell = .{ @@ -734,7 +734,7 @@ pub fn remote(init: std.process.Init, opts: pardes.Options, path: []const u8, se .inotify_fd = -1, .own = joined.view, .screen = &screen, - .remote = &remote_link, + .client = &client_link, }; try startInput(&loop, &screen); @@ -758,7 +758,7 @@ pub fn remote(init: std.process.Init, opts: pardes.Options, path: []const u8, se while (!link.quit) { // Its predicted echo judged and caught up, once a frame. if (r.echoFrame()) link.dirty = true; - if (link.dirty) remote_link.draw(&sh); + if (link.dirty) client_link.draw(&sh); // The tty's own motions (its glide, a jump's trail) drawn a frame // a tick while they move, as waitInput wakes the local loop: a // wheel's glide was drawn only at the next event. After the @@ -1244,14 +1244,14 @@ const Shell = struct { took_input: bool = false, took_output: bool = false, held: ?Msg = null, - /// This process a replica client of a session elsewhere (`remote`): + /// This process a replica client of a session elsewhere (`runClient`): /// its inputs go to the replica, never straight to the core. - remote: ?*Remote = null, + client: ?*Client = null, /// A terminal's input, to the core, or to a replica client's engine /// (applied at once there, and sent to the session). fn feed(s: *Shell, ev: pardes.Event) void { - const c = s.remote orelse return s.core.update(ev); + const c = s.client orelse return s.core.update(ev); c.link.input(ev); } @@ -1413,7 +1413,7 @@ const Shell = struct { /// A client's own build is not the session's to say (its core's host /// is the session's, through the tape). fn newerBuild(ctx: ?*anyopaque) bool { - return of(ctx).remote == null and upgrade.newer(); + return of(ctx).client == null and upgrade.newer(); } fn upgradeAsked(ctx: ?*anyopaque, pane: u8) void { @@ -1687,7 +1687,7 @@ const Shell = struct { // The terminal's input goes into its view. switch (event) { .key_press, .mouse, .paste, .paste_start, .paste_end, .winsize, .focus_in, .focus_out, .quit => { - if (s.local() and s.remote == null) core.toView(s.own); + if (s.local() and s.client == null) core.toView(s.own); }, else => {}, } @@ -1704,7 +1704,7 @@ const Shell = struct { virtual.* = @max(virtual.*, s.wake_to); }, .quit => { - if (s.remote) |c| { + if (s.client) |c| { c.link.quit = true; return true; } @@ -1727,14 +1727,14 @@ const Shell = struct { s.input_seen = true; }, .replica_mail => s.input_seen = true, - .said => |said| if (s.remote) |c| { + .said => |said| if (s.client) |c| { c.link.take(said); if (said == .refused) return true; } else switch (said) { .unit, .screen, .refused => |b| std.heap.c_allocator.free(b), .checked => {}, }, - .link_gone => if (s.remote) |c| { + .link_gone => if (s.client) |c| { c.link.quit = true; c.link.gone = true; return true; @@ -1851,7 +1851,7 @@ const Shell = struct { if (!sc.on or sc.vx.state.in_band_resize) return; const ws = sc.tty.getWinsize() catch return; if (sc.size) |was| if (std.meta.eql(was, ws)) return; - if (s.remote == null) s.core.toView(s.own); + if (s.client == null) s.core.toView(s.own); s.resized(sc, ws); } @@ -1924,7 +1924,7 @@ const Shell = struct { const trail_on = s.core.settings.jump_trail and truecolor; const shown = trailCells(s.frame.allocator(), glided, &sc.trail, trail_on, now) catch glided; paintCells(win, shown.cells, shown.cols, shown.rows); - if (s.remote) |c| if (c.link.notice_len > 0) noticeLine(win, c.link.notice(), shown.cols, shown.rows); + if (s.client) |c| if (c.link.notice_len > 0) noticeLine(win, c.link.notice(), shown.cols, shown.rows); tz_cells.end(); if (vx.caps.kitty_graphics) for (canonical.placements.items) |place| { if (place.art.glyph or !kittyImageRepresentable(place)) continue; @@ -2253,7 +2253,7 @@ fn watchFiles(io: std.Io, fd: c_int, loop: *Loop) void { fn keepSignal(_: posix.SIG) callconv(.c) void {} -/// A replica client's (`remote`): a hangup is its end, whoever sent it. +/// A replica client's (`runClient`): a hangup is its end, whoever sent it. var hangup_quits = false; fn winchWatch(loop: *Loop) void { @@ -2400,7 +2400,7 @@ pub fn cellOf(v: i16) u16 { return @intCast(@max(0, v)); } -/// A replica client's own line over its frame's last row (`Remote.notify`), +/// A replica client's own line over its frame's last row (`Client.notify`), /// reversed. `text` is printable ASCII and outlives the render (vaxis keeps /// the slices). fn noticeLine(win: vaxis.Window, text: []const u8, cols: u16, rows: u16) void { |
