From ec1eb94cfbccdd590365fdf9fa1e76e6285a1f90 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 02:51:00 -0300 Subject: `pardes --attach=:` runs `ssh -C` when $PARDES_SSH is not set: through the FreeBSD box a 3.9 MB join took 7.8 to 7.9 s plain and 5.4 to 5.8 s compressed (ssh brings the forward up in 2.0 s of either) Co-Authored-By: Claude Opus 5.5 --- src/main.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.zig b/src/main.zig index ab5047ce..b4f97128 100644 --- a/src/main.zig +++ b/src/main.zig @@ -110,7 +110,8 @@ const help_text = \\ --detach name, else its pid) \\ --attach=: a client of session on another machine, \\ over `ssh -L` to its pardes-replica.sock - \\ ($PARDES_SSH: the ssh command, words; and + \\ ($PARDES_SSH: the ssh command, words, default + \\ `ssh -C`; and \\ $PARDES_REMOTE_RUNTIME: its runtime directory, \\ if not this one's path). Its keys show at once \\ --attach=: ...through that socket (a path, with a '/'), @@ -860,7 +861,10 @@ fn remoteAttach(init: std.process.Init, opts: pardes.Options, where: []const u8, var argv: [48:null]?[*:0]const u8 = @splat(null); var n: usize = 0; var words_buf: [1024]u8 = undefined; - var words = std.mem.tokenizeScalar(u8, std.mem.span(std.c.getenv("PARDES_SSH") orelse "ssh"), ' '); + // Compressed by default: the join's dump is text, and the FreeBSD box's + // link carries 170 to 400 KB/s (a 3.9 MB join: 7.8 s plain, 5.4 with + // -C). $PARDES_SSH, when set, is the whole command. + var words = std.mem.tokenizeScalar(u8, std.mem.span(std.c.getenv("PARDES_SSH") orelse "ssh -C"), ' '); var at: usize = 0; while (words.next()) |w| { if (n >= 40 or at + w.len + 1 > words_buf.len) Say.no(io, "PARDES_SSH has too many words", .{}); -- cgit v1.3