diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 21:19:47 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-04 21:20:02 -0300 |
| commit | e67a1a561d9a9a7269bcc7c9af5678d3f50a95cb (patch) | |
| tree | 195593cc6ae9d72fcd1e37f08637c5eb038920be /test/process | |
| parent | d6883afab40fb8cfcd40fc6abcde1aaf74b8b108 (diff) | |
| download | pardes-e67a1a561d9a9a7269bcc7c9af5678d3f50a95cb.tar.gz pardes-e67a1a561d9a9a7269bcc7c9af5678d3f50a95cb.zip | |
main: the --tty flag again (it starts one shell pane in tty mode, the pane's raw mode, which the user keeps as tty, not the frontend): --tui and the old-flag case gone, the launch lines, the process runner's startTty and the cases' tty sessions as they were; the changelog says the frontend is the tui (-Dplatform=tui, src/tui/), the Tty builtin is Term and Tty still runs it; core, behaviour, fs-unit, pane and process tests (tui 36 of 36), all 113 snap scripts and the gui build pass
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/process')
| -rw-r--r-- | test/process/builtins.zig | 8 | ||||
| -rw-r--r-- | test/process/flags.zig | 25 | ||||
| -rw-r--r-- | test/process/mounts.zig | 6 | ||||
| -rw-r--r-- | test/process/root_ctl.zig | 10 |
4 files changed, 24 insertions, 25 deletions
diff --git a/test/process/builtins.zig b/test/process/builtins.zig index 0d8ef5d4..410a3f54 100644 --- a/test/process/builtins.zig +++ b/test/process/builtins.zig @@ -11,16 +11,16 @@ pub const cases = .{ }; fn lspinfo(gpa: std.mem.Allocator, exe: [:0]const u8) !void { - for ([_]bool{ false, true }) |tui| { + for ([_]bool{ false, true }) |tty| { var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); - const name = if (tui) "lsp-tui" else "lsp-detached"; - var d = try process.Detached.start(gpa, exe, if (tui) "lsp-root" else name, .{}); + const name = if (tty) "lsp-tty" else "lsp-detached"; + var d = try process.Detached.start(gpa, exe, if (tty) "lsp-root" else name, .{}); defer d.deinit(); var term: ?process.Child = null; defer if (term) |*t| t.deinit(); - if (tui) term = try d.startTui(exe, name, &.{}); + if (tty) term = try d.startTty(exe, name, &.{}); const address = d.abs(try std.fmt.allocPrint(a, "pardes-9p-{s}.sock", .{name})); const c = try Conn.dial(gpa, address); defer c.deinit(gpa); diff --git a/test/process/flags.zig b/test/process/flags.zig index 78be22f6..e8f30504 100644 --- a/test/process/flags.zig +++ b/test/process/flags.zig @@ -169,7 +169,7 @@ fn forwarding(gpa: std.mem.Allocator, exe: [:0]const u8) !void { .{ "/virtual/pane/1/body:1:2-4", "initial\n", .{ 1, 4 }, true }, }) |row| { const before = try c.serials(a); - const r = try process.run(a, &.{ exe, "--tui", row[0] }, opts); + const r = try process.run(a, &.{ exe, "--tty", row[0] }, opts); try check(r.code == 0, "{s}: exit {d}: {s}", .{ row[0], r.code, r.said }); if (row[3]) { try check(same(before, try c.serials(a)), "{s} made a pane", .{row[0]}); @@ -213,16 +213,15 @@ fn forwarding(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // Flags of a session's own start one, never forwarded. const Launch = struct { []const u8, []const [:0]const u8, ?[]const u8 }; for ([_]Launch{ - .{ "mount", &.{ "--tui", z(a, "--mount=peer={s}", .{address}), "/n/peer/pane/1/body" }, null }, - .{ "name", &.{ "--tui", "--9p=forwarded-name" }, "forwarded-name" }, + .{ "mount", &.{ "--tty", z(a, "--mount=peer={s}", .{address}), "/n/peer/pane/1/body" }, null }, + .{ "name", &.{ "--tty", "--9p=forwarded-name" }, "forwarded-name" }, // --tty, the old spelling, which an upgraded session may pass. - .{ "old-flag", &.{ "--tty", "--9p=old-flag" }, "old-flag" }, - .{ "tcp", &.{ "--tui", "--9p-tcp=tcp!127.0.0.1!0" }, null }, - .{ "load", &.{ "--tui", "-l", saved }, null }, + .{ "tcp", &.{ "--tty", "--9p-tcp=tcp!127.0.0.1!0" }, null }, + .{ "load", &.{ "--tty", "-l", saved }, null }, .{ "shells", &.{ "-n", "3" }, null }, - .{ "toggle", &.{ "--tui", "--tty-toggle=q" }, null }, - .{ "toggle-arg", &.{ "--tui", "--tty-toggle", "q" }, null }, - .{ "quic", &.{ "--tui", "--9p-quic=quic!127.0.0.1!0" }, null }, + .{ "toggle", &.{ "--tty", "--tty-toggle=q" }, null }, + .{ "toggle-arg", &.{ "--tty", "--tty-toggle", "q" }, null }, + .{ "quic", &.{ "--tty", "--9p-quic=quic!127.0.0.1!0" }, null }, }) |row| { if (std.mem.eql(u8, row[0], "quic") and !try process.quicIncluded(a, exe)) continue; var argv: [8][:0]const u8 = undefined; @@ -260,7 +259,7 @@ fn forwarding(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // A session that answers takes the file or says why, as acme's B does: // a pane it has not is its refusal and exit 1, never a nested editor. - const gone = try process.run(a, &.{ exe, "--tui", spaced }, .{ .root = d.root(), .env = &.{ inherited[0], .{ "PARDES_PANE", "4294967295" }, inherited[2] } }); + const gone = try process.run(a, &.{ exe, "--tty", spaced }, .{ .root = d.root(), .env = &.{ inherited[0], .{ "PARDES_PANE", "4294967295" }, inherited[2] } }); try check(gone.code == 1 and std.mem.startsWith(u8, gone.said, "pardes: "), "gone pane: exit {d}: {s}", .{ gone.code, gone.said }); try std.testing.expectEqualStrings(before, try c.read(a, "/index")); const absent = d.abs("absent.sock"); @@ -274,7 +273,7 @@ fn forwarding(gpa: std.mem.Allocator, exe: [:0]const u8) !void { .{ "not-nested", inherited[0..2], spaced }, }) |row| { const existing = try process.entries(a, d.root()); - var argv: [3][:0]const u8 = .{ exe, "--tui", undefined }; + var argv: [3][:0]const u8 = .{ exe, "--tty", undefined }; if (row[2]) |w| argv[2] = w; var child = try Child.spawn(argv[0..if (row[2] != null) 3 else 2], .{ .root = d.root(), .env = row[1], .pty = .{ .log = d.abs(try std.fmt.allocPrint(a, "{s}.pty", .{row[0]})) } }); defer child.deinit(); @@ -680,7 +679,7 @@ fn outside(gpa: std.mem.Allocator, exe: [:0]const u8) !void { } // A launch with no terminal to draw on (a pty that is no one's // controlling terminal) says so and exits 1, no error trace. - var tty = try Child.spawn(&.{ exe, "--tui", "x.txt" }, .{ .root = d.root(), .pty = .{ .log = d.abs("noctty.pty"), .ctty = false } }); + var tty = try Child.spawn(&.{ exe, "--tty", "x.txt" }, .{ .root = d.root(), .pty = .{ .log = d.abs("noctty.pty"), .ctty = false } }); defer tty.deinit(); const words = try tty.said(a); try exitsWith(&tty, 1, 10_000); @@ -720,7 +719,7 @@ fn killedTty(gpa: std.mem.Allocator, exe: [:0]const u8) !void { const existing = try process.entries(a, d.root()); const log = d.abs(try std.fmt.allocPrint(a, "killed-{t}.pty", .{sig})); // The daemon's, as a user's editor has: a hangup leaves the session. - var killed = try Child.spawn(&.{ exe, "--tui", "x.txt" }, .{ .root = d.root(), .env = &.{.{ "PARDES_DAEMON", "on" }}, .pty = .{ .log = log } }); + var killed = try Child.spawn(&.{ exe, "--tty", "x.txt" }, .{ .root = d.root(), .env = &.{.{ "PARDES_DAEMON", "on" }}, .pty = .{ .log = log } }); defer killed.deinit(); const deadline = process.nowMs() + 10_000; while (!has(d.get(a, std.fs.path.basename(log)) catch "", "\x1b[?1049h")) { diff --git a/test/process/mounts.zig b/test/process/mounts.zig index f59a7a0f..10dc7b5a 100644 --- a/test/process/mounts.zig +++ b/test/process/mounts.zig @@ -129,7 +129,7 @@ fn quic(gpa: std.mem.Allocator, exe: [:0]const u8) !void { std.debug.print("SKIP a build without QUIC (-Dquic=true)\n", .{}); return; } - for ([_]bool{ false, true }) |tui| for ([_][:0]const u8{ "127.0.0.1", "::1" }) |host| { + for ([_]bool{ false, true }) |tty| for ([_][:0]const u8{ "127.0.0.1", "::1" }) |host| { var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); @@ -137,11 +137,11 @@ fn quic(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try std.fmt.allocPrintSentinel(a, "--9p-tcp=tcp!{s}!0", .{host}, 0), try std.fmt.allocPrintSentinel(a, "--9p-quic=quic!{s}!0", .{host}, 0), }; - var d = try Detached.start(gpa, exe, if (tui) "quic-root" else "server", .{ .args = if (tui) &.{} else &args }); + var d = try Detached.start(gpa, exe, if (tty) "quic-root" else "server", .{ .args = if (tty) &.{} else &args }); defer d.deinit(); var term: ?process.Child = null; defer if (term) |*t| t.deinit(); - if (tui) term = try d.startTui(exe, "server", &args); + if (tty) term = try d.startTty(exe, "server", &args); const address = d.abs("pardes-9p-server.sock"); const unix = try Conn.dial(gpa, address); defer unix.deinit(gpa); diff --git a/test/process/root_ctl.zig b/test/process/root_ctl.zig index f4a0149b..e3420ac5 100644 --- a/test/process/root_ctl.zig +++ b/test/process/root_ctl.zig @@ -118,16 +118,16 @@ fn redial(gpa: std.mem.Allocator, path: []const u8) !*Conn { } fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void { - for ([_]bool{ false, true }) |tui| { + for ([_]bool{ false, true }) |tty| { var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); - const name = if (tui) "restore tui space" else "restore detached space"; - var d = try process.Detached.start(gpa, exe, if (tui) "restore-root" else name, .{}); + const name = if (tty) "restore tty space" else "restore detached space"; + var d = try process.Detached.start(gpa, exe, if (tty) "restore-root" else name, .{}); defer d.deinit(); var term: ?process.Child = null; defer if (term) |*t| t.deinit(); - if (tui) term = try d.startTui(exe, name, &.{}); + if (tty) term = try d.startTty(exe, name, &.{}); const address = d.abs(try std.fmt.allocPrint(a, "pardes-9p-{s}.sock", .{name})); const old = try Conn.dial(gpa, address); defer old.deinit(gpa); @@ -179,7 +179,7 @@ fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void { defer screen.deinit(); const width = try std.unicode.utf8CountCodepoints(std.mem.sliceTo(try screen.screen(), '\n')); // A detached one is 160x50; a window keeps its own size. - if (process.backend == .tui) try std.testing.expectEqual(@as(usize, if (tui) 80 else 160), width); + if (process.backend == .tui) try std.testing.expectEqual(@as(usize, if (tty) 80 else 160), width); const opened = try restored.look(a, try std.fmt.allocPrint(a, "/n/own/os{s}", .{d.abs(try std.fmt.allocPrint(a, "{s}.txt", .{name}))}), ids[1]); try std.testing.expectEqualStrings("initial\n", try restored.pane(a, opened, "body")); } |
