diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-04 20:54:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-04 21:12:33 -0300 |
| commit | 0ff1fc99eb870f8a1e714a71c1a853066737c822 (patch) | |
| tree | 2c8b4720e2ed190e6f9062cfe8586c3da22aeb42 /test/process/flags.zig | |
| parent | 3b082687c7da1c5d8cc52c71fdf4ddd38d860cd8 (diff) | |
| download | pardes-0ff1fc99eb870f8a1e714a71c1a853066737c822.tar.gz pardes-0ff1fc99eb870f8a1e714a71c1a853066737c822.zip | |
rename: the terminal frontend is the tui (-Dplatform=tui, src/tui/tui.zig, --tui with --tty kept as its old spelling, the process tests' backend .tui and --backend=tui, docs/typ/builtins-tui.json, the Settings report's platform), and the builtin Tty is Term (its registry entry, SPC n t, every default tag, the docs, tests and snap scripts), Tty still run as Term through exec.acme_words, Tty+fish too on a tag and a ctl; tty as a pane's raw mode and as the OS's terminal unchanged
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/process/flags.zig')
| -rw-r--r-- | test/process/flags.zig | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/test/process/flags.zig b/test/process/flags.zig index aa5b7497..78be22f6 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, "--tty", row[0] }, opts); + const r = try process.run(a, &.{ exe, "--tui", 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,14 +213,16 @@ 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", &.{ "--tty", z(a, "--mount=peer={s}", .{address}), "/n/peer/pane/1/body" }, null }, - .{ "name", &.{ "--tty", "--9p=forwarded-name" }, "forwarded-name" }, - .{ "tcp", &.{ "--tty", "--9p-tcp=tcp!127.0.0.1!0" }, null }, - .{ "load", &.{ "--tty", "-l", saved }, null }, + .{ "mount", &.{ "--tui", z(a, "--mount=peer={s}", .{address}), "/n/peer/pane/1/body" }, null }, + .{ "name", &.{ "--tui", "--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 }, .{ "shells", &.{ "-n", "3" }, 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 }, + .{ "toggle", &.{ "--tui", "--tty-toggle=q" }, null }, + .{ "toggle-arg", &.{ "--tui", "--tty-toggle", "q" }, null }, + .{ "quic", &.{ "--tui", "--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; @@ -258,7 +260,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, "--tty", spaced }, .{ .root = d.root(), .env = &.{ inherited[0], .{ "PARDES_PANE", "4294967295" }, inherited[2] } }); + const gone = try process.run(a, &.{ exe, "--tui", 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"); @@ -272,7 +274,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, "--tty", undefined }; + var argv: [3][:0]const u8 = .{ exe, "--tui", 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(); @@ -653,7 +655,7 @@ fn commandBody(a: std.mem.Allocator, c: *Conn, node: []const u8) ![]const u8 { fn outside(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // The terminal frontend's and a detached session's own: a window is neither. - try process.only(.tty); + try process.only(.tui); var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); @@ -678,7 +680,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, "--tty", "x.txt" }, .{ .root = d.root(), .pty = .{ .log = d.abs("noctty.pty"), .ctty = false } }); + var tty = try Child.spawn(&.{ exe, "--tui", "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); @@ -699,7 +701,7 @@ fn socketFile(path: []const u8) !void { fn killedTty(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // The terminal frontend's and a detached session's own: a window is neither. - try process.only(.tty); + try process.only(.tui); var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); @@ -718,7 +720,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, "--tty", "x.txt" }, .{ .root = d.root(), .env = &.{.{ "PARDES_DAEMON", "on" }}, .pty = .{ .log = log } }); + var killed = try Child.spawn(&.{ exe, "--tui", "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")) { @@ -763,7 +765,7 @@ fn daemonGone(d: *const process.Detached) void { fn signalCleansUp(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // The terminal frontend's and a detached session's own: a window is neither. - try process.only(.tty); + try process.only(.tui); // A detached session told to stop by a signal unlinks its sockets. A // hangup is a terminal's end, not a session's: the daemon keeps it. for ([_]libc.SIG{ .TERM, .INT, .HUP }) |first| { |
