summaryrefslogtreecommitdiff
path: root/test/process/flags.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 21:19:47 -0300
committerGabriel Schneider <[email protected]>2026-11-04 21:20:02 -0300
commite67a1a561d9a9a7269bcc7c9af5678d3f50a95cb (patch)
tree195593cc6ae9d72fcd1e37f08637c5eb038920be /test/process/flags.zig
parentd6883afab40fb8cfcd40fc6abcde1aaf74b8b108 (diff)
downloadpardes-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/flags.zig')
-rw-r--r--test/process/flags.zig25
1 files changed, 12 insertions, 13 deletions
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")) {