summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-30 02:51:00 -0300
committerGabriel Schneider <[email protected]>2026-10-30 03:13:15 -0300
commitec1eb94cfbccdd590365fdf9fa1e76e6285a1f90 (patch)
treedae0fe75b13aa13e338f2954ccaa4abb795429f7 /src/main.zig
parent349cf7b0062b7881e868fb5adc996b2e642b76f7 (diff)
downloadpardes-ec1eb94cfbccdd590365fdf9fa1e76e6285a1f90.tar.gz
pardes-ec1eb94cfbccdd590365fdf9fa1e76e6285a1f90.zip
`pardes --attach=<host>:<name>` 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 <[email protected]>
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig8
1 files changed, 6 insertions, 2 deletions
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=<host>:<name> a client of session <name> 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=<sock>:<name> ...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", .{});