diff options
Diffstat (limited to 'test')
46 files changed, 165 insertions, 163 deletions
diff --git a/test/agent_session.py b/test/agent_session.py index aa87c845..8a62bf26 100644 --- a/test/agent_session.py +++ b/test/agent_session.py @@ -47,7 +47,7 @@ def run(args, command, status): signal.setitimer(signal.ITIMER_REAL, args.timeout) try: context = session(str(args.binary.resolve()), root, 'agent-session', tty=True, - socket_name='agent-session', launch=['--tty', '--9p=agent-session'], + socket_name='agent-session', launch=['--tui', '--9p=agent-session'], inherited={'PARDES_TEST_GRID': '1'} if args.gui_grid else {}) client, _ = context.__enter__() try: diff --git a/test/appearance_gallery.py b/test/appearance_gallery.py index 98420a15..8672de71 100644 --- a/test/appearance_gallery.py +++ b/test/appearance_gallery.py @@ -16,7 +16,7 @@ THEMES = ('forge', 'lagoon', 'solarium', 'spectrum', 'harvest', 'clay') NOTES = b'''Pardes / workspace review New belongs to the column. -Tty opens a terminal. +Term opens a terminal. Mode switches its input mode. Font MartianMono-NrRg:18 @@ -84,7 +84,7 @@ def run(args): client.write(f'/pane/{right}/body', PREFERENCE_NOTES if args.theme_selector else NOTES, truncate=True) client.write(f'/pane/{right}/dirty', b'0\n') before = set(panes(client)) - command(client, right, 'Tty') + command(client, right, 'Term') terminal = require(wait_for(lambda: next((s for s in panes(client) if s not in before), None)), 'terminal missing') client.write(f'/pane/{terminal}/pty/data', b"PS1='$ '; printf '\\033[2J\\033[H\\033[1;36mPardes workspace\\033[0m\\n\\n'; printf 'Agave source: read-only\\nTerminal: ready\\n\\n'; printf '\\033[32mSmall touches. Same workflow.\\033[0m\\n'\r") require(wait_for(lambda: b'Small touches. Same workflow.' in client.read(f'/pane/{terminal}/body')), 'terminal output missing') diff --git a/test/behaviour/columns_and_tags.zig b/test/behaviour/columns_and_tags.zig index 22f55774..d5820610 100644 --- a/test/behaviour/columns_and_tags.zig +++ b/test/behaviour/columns_and_tags.zig @@ -57,11 +57,11 @@ test "columns-and-tags: Newcol makes an empty column with the keyboard on its ta const left, const col = .{ try s.column(0), try s.column(1) }; try expectEqualStrings(s.at("{d}:{d} {d}:", .{ left, first, col }), try s.columns()); try s.expect("/focus", ""); - try s.write(s.at("/pane/{d}/exec", .{first}), "Tty\n"); + try s.write(s.at("/pane/{d}/exec", .{first}), "Term\n"); const shell = try s.focused(); try expectEqualStrings(s.at("{d}:{d} {d}:{d}", .{ left, first, col, shell }), try s.columns()); - // The next Tty splits as it always has: nothing is empty any more. - try s.write(s.at("/pane/{d}/exec", .{shell}), "Tty\n"); + // The next Term splits as it always has: nothing is empty any more. + try s.write(s.at("/pane/{d}/exec", .{shell}), "Term\n"); try expectEqualStrings(s.at("{d}:{d} {d}:{d},{d}", .{ left, first, col, shell, try s.focused() }), try s.columns()); } @@ -160,7 +160,7 @@ test "columns-and-tags: New is a column tag's word, in no pane's tag nor the wor var words = std.mem.tokenizeScalar(u8, tag, ' '); while (words.next()) |word| try std.testing.expect(!std.mem.eql(u8, word, "New")); } - try expectEqualStrings("New Tty Find Grep Joincol Delcol", try s.read(s.at("/col/{d}/tag", .{try s.column(0)}))); + try expectEqualStrings("New Term Find Grep Joincol Delcol", try s.read(s.at("/col/{d}/tag", .{try s.column(0)}))); } test "columns-and-tags: a click past a column tag's text types after it, a newline typed there a space, and a long tag scrolls to its caret" { @@ -168,12 +168,12 @@ test "columns-and-tags: a click past a column tag's text types after it, a newli defer s.deinit(); const tag = s.at("/col/{d}/tag", .{try s.column(0)}); // Its row, then the pane's tag: the column's stays one row. - const rows = " New Tty Find Grep Joincol Delcol"; + const rows = " New Term Find Grep Joincol Delcol"; try std.testing.expect(std.mem.indexOf(u8, try s.screen(), rows ++ " ") != null); try s.click("Delcol", 20, 1); // A clicked tag is in normal mode: `i` types where it was clicked. try s.keys("i\nSnarf"); - try expectEqualStrings("New Tty Find Grep Joincol Delcol Snarf", try s.read(tag)); + try expectEqualStrings("New Term Find Grep Joincol Delcol Snarf", try s.read(tag)); try std.testing.expect(std.mem.indexOf(u8, try s.screen(), rows ++ " Snarf ") != null); // The pane's tag on the row right under it: the column's is one row. try std.testing.expectEqual((try s.where(rows))[1] + 1, (try s.where("/test.txt Save"))[1]); @@ -265,7 +265,7 @@ test "columns-and-tags: a column tag lights the word under the mouse, is clicked try s.write("/mousein", s.at("m {d} 1 0\n", .{x})); const lit = try s.bg(x, 1); try std.testing.expect(!std.mem.eql(u8, plain, lit)); - try expectEqualStrings(plain, try s.bg(x + 4, 1)); // Tty, another word + try expectEqualStrings(plain, try s.bg(x + 4, 1)); // Term, another word // Pressed, the keyboard is on the tag, its caret where it was pressed. try s.write("/mousein", s.at("m {d} 1 1\n", .{x})); try s.expect("/focus", ""); @@ -277,7 +277,7 @@ test "columns-and-tags: a column tag lights the word under the mouse, is clicked try std.testing.expect(!std.mem.eql(u8, lit, try s.bg(x + 4, 1))); // A clicked tag is in normal mode: `i` types at its caret. try s.keys("\u{F00D}iHelp "); - try std.testing.expect(std.mem.startsWith(u8, try s.read(tag), "Help New Tty")); + try std.testing.expect(std.mem.startsWith(u8, try s.read(tag), "Help New Term")); try std.testing.expectEqual(x + 5, (try s.cursor()).?[0]); // A tag one short of its room: its caret at the end is drawn on the // last cell, and one more letter scrolls the text, never the caret. diff --git a/test/behaviour/look_and_exec.zig b/test/behaviour/look_and_exec.zig index c46ca394..ee9554cc 100644 --- a/test/behaviour/look_and_exec.zig +++ b/test/behaviour/look_and_exec.zig @@ -135,7 +135,7 @@ test "look-and-exec: look and exec read back what the last command touched, a ct try s.write("/exec", "Msg first\n"); try s.expect("/exec", s.at("{d}\n", .{n})); // A pane made through ctl is what both read next, not the Msg's pane. - try s.write(s.at("/pane/{d}/ctl", .{n}), "Tty\n"); + try s.write(s.at("/pane/{d}/ctl", .{n}), "Term\n"); const made = try s.focused(); try std.testing.expect(made != n); try s.expect("/exec", s.at("{d}\n", .{made})); @@ -159,7 +159,7 @@ test "look-and-exec: a line starting with # runs as nothing at an exec or a ctl, const log = try s.read("/log"); const col = std.mem.sliceTo(try s.read("/layout"), ' '); for ([_][]const u8{ "/exec", s.at("/pane/{d}/exec", .{n}), "/ctl", s.at("/pane/{d}/ctl", .{n}), s.at("/col/{s}/ctl", .{col}) }) |path| - try s.write(path, "# Platform: tty\n # indented too\n"); + try s.write(path, "# Platform: tui\n # indented too\n"); try s.expect("/index", index); try s.expect("/log", log); } diff --git a/test/behaviour/modes.zig b/test/behaviour/modes.zig index ba792086..961ca788 100644 --- a/test/behaviour/modes.zig +++ b/test/behaviour/modes.zig @@ -32,7 +32,7 @@ test "modes: Esc in a column or the workspace tag gives the keyboard back to a p var s = try Session.initFile(std.testing.allocator, "x\n"); defer s.deinit(); _ = try s.newPane(); - for ([_][]const u8{ "New Tty", "Newcol" }) |tag| { + for ([_][]const u8{ "New Term", "Newcol" }) |tag| { const was = try s.focused(); // A click puts the tag in normal mode, the keyboard there; Esc is // out of it. @@ -96,7 +96,7 @@ test "modes: Esc back into a file leaves its view where it was, and a look centr // The other arm still centres: a look's `:NN`. const line = 60; try s.write(s.at("/pane/{d}/look", .{doc}), s.at(":{d}\n", .{line})); - const rows = (try s.where("Tty Save Mode"))[1] - (try s.where("/test.txt"))[1] - 1; + const rows = (try s.where("Term Save Mode"))[1] - (try s.where("/test.txt"))[1] - 1; // Drawn mid-pane, a row either way. const drawn_at = line - try topLine(&s, "/test.txt"); try std.testing.expect(drawn_at + 1 >= rows / 2 and drawn_at <= rows / 2 + 1); @@ -468,7 +468,7 @@ test "modes: hopping between two panes by Esc, window mode or a click makes no p try expectEqual(want, try s.focused()); } const doc_row = (try s.where("row"))[1]; - const shell_row = (try s.where("Tty Save Mode"))[1] + 1; + const shell_row = (try s.where("Term Save Mode"))[1] + 1; for (0..8) |_| { const other = if (try s.focused() == doc) shell else doc; const row = if (other == doc) doc_row else shell_row; diff --git a/test/behaviour/mouse.zig b/test/behaviour/mouse.zig index d7da46e8..a0ac7a23 100644 --- a/test/behaviour/mouse.zig +++ b/test/behaviour/mouse.zig @@ -129,7 +129,7 @@ test "mouse: a B1 sweep over several lines is a stream, as acme's, in a body and const tx, const ty = try s.where("Collapse"); const lx, const ly = try s.where("Look Edit"); try mouse(&s, "m {d} {d} 1\nm {d} {d} 1\nm {d} {d} 3\nm {d} {d} 0\n", .{ tx + 3, ty, lx + 1, ly, lx + 1, ly, lx + 1, ly }); - try s.expect(tag, "/test.txt Save Tty Colok Edit"); + try s.expect(tag, "/test.txt Save Term Colok Edit"); } test "mouse: a click on either half of a wide character lands before it, in the text and on a tag's path, and the caret steps over it whole" { diff --git a/test/behaviour/tags.zig b/test/behaviour/tags.zig index 8609e134..71faed3a 100644 --- a/test/behaviour/tags.zig +++ b/test/behaviour/tags.zig @@ -41,9 +41,9 @@ test "tags: ms and md edit a tag's own text, and the text the edit made is read defer s.deinit(); const n = try s.focused(); try s.keys(":miwms("); - try std.testing.expectEqualStrings("/test.txt (Save) Tty Collapse Del", try tag(&s, n)); + try std.testing.expectEqualStrings("/test.txt (Save) Term Collapse Del", try tag(&s, n)); try s.keys("md("); - try std.testing.expectEqualStrings("/test.txt Save Tty Collapse Del", try tag(&s, n)); + try std.testing.expectEqualStrings("/test.txt Save Term Collapse Del", try tag(&s, n)); } test "tags: the keyboard reaches a tag's path, which it can select and yank but not edit" { @@ -66,7 +66,7 @@ test "tags: the keyboard reaches a tag's path, which it can select and yank but try s.expect(s.at("/pane/{d}/name", .{n}), "/test.txt\n"); // After the path, the text is the tag's own to edit. try s.keys(":A!\x1b"); - try std.testing.expectEqualStrings("/test.txt Save Tty Collapse Del!", try tag(&s, n)); + try std.testing.expectEqualStrings("/test.txt Save Term Collapse Del!", try tag(&s, n)); // What it yanked was the path. try s.keys(":P"); try s.expect(s.at("/pane/{d}/body", .{n}), "/test.txtbody\n"); @@ -102,7 +102,7 @@ test "tags: a tag remembers its cursor, starts on Save, and a click moves it" { try std.testing.expectEqual(@as(usize, 5), try tagCol(&s, "/second.txt")); try s.keys(":"); // A click in the tag puts its cursor there, the pane's keyboard with it. - try s.click("Save Tty", 6, 1); + try s.click("Save Term", 6, 1); try std.testing.expectEqual(first, try s.focused()); try std.testing.expectEqual(@as(usize, "/test.txt Save T".len), try tagCol(&s, "/test.txt")); // A prompt opened and left from the body leaves it there (a clicked @@ -187,7 +187,7 @@ test "tags: a tag's normal mode is the body's: motions stay in the tag and inser try s.keys(window ++ "h\n"); try std.testing.expectEqual(first, try s.focused()); try s.keys(":i\u{F018}hjklHJKL:"); - try std.testing.expectEqualStrings("/test.txt Save Tty Collapse DelhjklHJKL:", try tag(&s, first)); + try std.testing.expectEqualStrings("/test.txt Save Term Collapse DelhjklHJKL:", try tag(&s, first)); try std.testing.expect(std.mem.endsWith(u8, try s.read(s.at("/pane/{d}/ctl", .{first})), " mode:normal ")); try s.expect(s.at("/pane/{d}/body", .{first}), "body\n"); try std.testing.expectEqual(first, try s.focused()); @@ -202,7 +202,7 @@ test "tags: a tag with a newline in it is as tall as its lines, and each line is if (bottom) try s.write("/ctl", "Tagbottom on\n"); // Insert mode in a tag is a body's: Enter is a new line. try s.keys(":A\nSecond"); - try std.testing.expectEqualStrings("/test.txt Save Tty Collapse Del\nSecond", try tag(&s, n)); + try std.testing.expectEqualStrings("/test.txt Save Term Collapse Del\nSecond", try tag(&s, n)); const x, const y = try s.where("/test.txt"); try std.testing.expectEqual(.{ x, y + 1 }, try s.where("Second")); // The caret is on the second line, after what was typed. @@ -216,7 +216,7 @@ test "tags: a tag with a newline in it is as tall as its lines, and each line is try std.testing.expectEqual(.{ x + 2, y + 1 }, (try s.cursor()).?); // A clicked tag is in normal mode: `i` types where it was clicked. try s.keys("iX"); - try std.testing.expectEqualStrings("/test.txt Save Tty Collapse Del\nSeXcond", try tag(&s, n)); + try std.testing.expectEqualStrings("/test.txt Save Term Collapse Del\nSeXcond", try tag(&s, n)); try s.expect(s.at("/pane/{d}/body", .{n}), "body\n"); } } @@ -311,14 +311,14 @@ test "tags: a name drafted in the tag commits with Enter, cancels with two Escs, try clickPathEnd(&s, path); try s.keys("\x15/new name.zig"); try s.expect(name, s.at("{s}\n", .{path})); - _ = try s.where("/new name.zig Save Tty Collapse Del SyntaxBold"); + _ = try s.where("/new name.zig Save Term Collapse Del SyntaxBold"); try s.expect(s.at("/pane/{d}/body", .{n}), "original body\n"); // Esc keeps the draft pending; a second drops it. try s.keys(if (commit) "\n" else "\x1b\x1b"); try s.expect(name, if (commit) "/new name.zig\n" else "/test.txt\n"); - try std.testing.expectEqualStrings(s.at("{s} Save Tty Collapse Del SyntaxBold", .{if (commit) "/new name.zig" else "/test.txt"}), try tag(&s, n)); + try std.testing.expectEqualStrings(s.at("{s} Save Term Collapse Del SyntaxBold", .{if (commit) "/new name.zig" else "/test.txt"}), try tag(&s, n)); // The keyboard is the body's again. - try std.testing.expect((try s.cursor()).?[1] != (try s.where("Save Tty"))[1]); + try std.testing.expect((try s.cursor()).?[1] != (try s.where("Save Term"))[1]); } try std.testing.expectEqual(@as(usize, 0), s.saved); // A name alone is no edit: the pane stays clean. @@ -365,9 +365,9 @@ test "tags: middle clicking Save commits the drafted name before saving" { const n = try s.focused(); try clickPathEnd(&s, "/test.txt"); try s.keys("\x15/renamed.txt"); - try s.click("Save Tty", 0, 2); + try s.click("Save Term", 0, 2); try s.expect(s.at("/pane/{d}/name", .{n}), "/renamed.txt\n"); - try std.testing.expectEqualStrings("/renamed.txt Save Tty Collapse Del", try tag(&s, n)); + try std.testing.expectEqualStrings("/renamed.txt Save Term Collapse Del", try tag(&s, n)); try s.expect(s.at("/pane/{d}/body", .{n}), "untouched\n"); try std.testing.expectEqual(@as(usize, 1), s.saved); } diff --git a/test/column_tags.py b/test/column_tags.py index ba638b7d..838dbd9a 100644 --- a/test/column_tags.py +++ b/test/column_tags.py @@ -114,9 +114,9 @@ def run(args): launch=launch, inherited=env, terminal=handles) as (client, address), contextlib.ExitStack() as connections: print('socket', address, flush=True) keys = Input(handles['input_fd']) - await_text(client, 1, 'New Tty Find Grep Joincol') - require(locate(client, 'New Tty', row=1) == (0, 1), 'left column tag does not start flush-left') - require(tag(client, 1).startswith(str(source) + ' Save Tty Del'), + await_text(client, 1, 'New Term Find Grep Joincol') + require(locate(client, 'New Term', row=1) == (0, 1), 'left column tag does not start flush-left') + require(tag(client, 1).startswith(str(source) + ' Save Term Del'), 'generated gap still separates the filename from pane commands') checks.append('pane commands follow the filename with one space') @@ -147,14 +147,14 @@ def run(args): right_body = b'// Column-local scratch\nfn main() {\n let ready = true;\n}\n' client.write(f'/pane/{right}/body', right_body) client.write(f'/pane/{right}/dirty', b'0\n') - require(wait_for(lambda: locate(client, 'New Tty', row=1, minimum_col=75)), 'right column tag missing') - require(locate(client, 'New Tty', row=1, minimum_col=75) == (75, 1), + require(wait_for(lambda: locate(client, 'New Term', row=1, minimum_col=75)), 'right column tag missing') + require(locate(client, 'New Term', row=1, minimum_col=75) == (75, 1), 'right column tag retains an inset') checks.append('column tags start at the first cell of each column') # Column header uses half-open drag ranges; replacement must not leak # into its neighbour, the global header, or the active pane's body. - col_start, _ = locate(client, 'New Tty', row=1, minimum_col=75) + col_start, _ = locate(client, 'New Term', row=1, minimum_col=75) keys.click(col_start, 1) keys.send(b'\x1b[F') keys.send(' Scope λ界') @@ -181,7 +181,7 @@ def run(args): # An owned short-path file makes its complete tag visible. Pane-tag # selections retain the existing inclusive endpoint convention. - save_x, pane_y = require(wait_for(lambda: locate(client, 'Save Tty', minimum_col=75)), 'right pane actions missing') + save_x, pane_y = require(wait_for(lambda: locate(client, 'Save Term', minimum_col=75)), 'right pane actions missing') keys.click(save_x, pane_y) keys.send(b'\x1b[F') keys.send(' TailMark') @@ -206,9 +206,9 @@ def run(args): # Keep a real embedded shell in the right column for useful captures. keys.click(12, 4) before = panes(client) - keys.click(*require(locate(client, 'Tty', row=1, minimum_col=75), 'Tty missing'), button=1) - terminal = require(wait_for(lambda: new_serial(client, before)), 'column Tty did not create a pane') - require('pty' in client.list(f'/pane/{terminal}'), 'Tty created a non-terminal pane') + keys.click(*require(locate(client, 'Term', row=1, minimum_col=75), 'Term missing'), button=1) + terminal = require(wait_for(lambda: new_serial(client, before)), 'column Term did not create a pane') + require('pty' in client.list(f'/pane/{terminal}'), 'Term created a non-terminal pane') client.write(f'/pane/{terminal}/pty/data', b"printf 'Column-local terminal ready\\n'; pwd\r") require(wait_for(lambda: b'\nColumn-local terminal ready\n' in client.read(f'/pane/{terminal}/body').replace(b'\r', b'')), 'terminal command output missing') checks.append('right-column embedded terminal executes harmless commands') @@ -222,7 +222,7 @@ def run(args): saved_global = re.search(rb'\.topbar_custom\s*=\s*"((?:[^"\\]|\\.)*)"', dumped) require(saved_global and codecs.escape_decode(saved_global[1])[0].decode() == global_text, 'global custom tag absent from dump') - require(b'New Tty Find Grep Joincol Work' in dumped, 'column custom tag absent from dump') + require(b'New Term Find Grep Joincol Work' in dumped, 'column custom tag absent from dump') keys.click(1, 0) keys.send(b'\x1b[F') keys.send(' TEMP') @@ -256,19 +256,19 @@ def run(args): keys.send(clean_global) require(wait_for(lambda: row_text(client, 0) == clean_global), 'clean global tag replacement failed') keys.escape() - col_start, _ = require(locate(client, 'New Tty', row=1, minimum_col=75), 'right column tag missing after restore') + col_start, _ = require(locate(client, 'New Term', row=1, minimum_col=75), 'right column tag missing after restore') keys.click(col_start, 1) keys.send(b'\x1b[H\x1b[1;2F') - keys.send('New Tty Find Grep Joincol Work') - require(wait_for(lambda: row_text(client, 1).endswith('New Tty Find Grep Joincol Work')), + keys.send('New Term Find Grep Joincol Work') + require(wait_for(lambda: row_text(client, 1).endswith('New Term Find Grep Joincol Work')), 'clean column tag replacement failed') keys.escape() - clean_pane = str(right_name) + ' Save Tty Del Collapse' + clean_pane = str(right_name) + ' Save Term Del Collapse' current_pane = tag(client, right) require(current_pane.startswith(clean_pane), 'unexpected scratch tag before presentation cleanup') suffix = current_pane[len(clean_pane):] require(suffix.isascii(), 'presentation cleanup expects its own ASCII test suffix') - keys.click(*require(locate(client, 'Save Tty', minimum_col=75), 'scratch pane commands missing')) + keys.click(*require(locate(client, 'Save Term', minimum_col=75), 'scratch pane commands missing')) keys.send(b'\x1b[F') keys.send(b'\x7f' * len(suffix)) require(wait_for(lambda: tag(client, right) == clean_pane), 'clean pane command tail replacement failed') @@ -282,7 +282,7 @@ def run(args): source_tag = tag(client, source_serial) keys.click(12, 2) keys.send(b'\x1b[F') - require(wait_for(lambda: (point := locate(client, 'Save Tty Del', row=2)) + require(wait_for(lambda: (point := locate(client, 'Save Term Del', row=2)) and point[0] < 75), 'long-path tag did not reveal its command tail at End') require(tag(client, source_serial) == source_tag, 'caret movement changed the source tag') capture(client, root, 'columns-tag-reveal', not args.tty) diff --git a/test/daemon.py b/test/daemon.py index 954433a9..7db7e055 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -449,7 +449,7 @@ def clients(binary): assert b'let this client go' in ta.text(), ta.text()[-300:] # A third client, a shell: its keys wait for the session (a pty # write), its output comes back in units, the same on both sides. - nine.write(f'/pane/{pane}/exec', b'Tty\n') + nine.write(f'/pane/{pane}/exec', b'Term\n') shell = wait_for('a shell pane', lambda: next((int(row.split()[0]) for row in nine.read('/index').splitlines() if row.split()[1] == b'term'), None)) wait_for('the shell\'s prompt', lambda: b'$' in nine.read(f'/pane/{shell}/body') or b'#' in nine.read(f'/pane/{shell}/body')) @@ -522,7 +522,7 @@ def manage(binary): status = dict(line.split(maxsplit=1) for line in c.read('/status').decode().splitlines()) sessions[name] = int(status['pid']) started.append(sessions[name]) - c.write('/pane/1/exec', b'Tty\n') + c.write('/pane/1/exec', b'Term\n') wait_for(f'session {name}\'s shell', lambda: terminals(c)) shell = terminals(c)[0] wait_for(f'session {name}\'s shell answers', lambda: run(c, shell, b'true\n') == b'exit 0\n') @@ -1078,7 +1078,7 @@ def main(binary, cycles): started = [] try: term = Term() - stub = term.spawn([binary, '--tty', '--9p=work'], env) + stub = term.spawn([binary, '--tui', '--9p=work'], env) started.append(stub.pid) sock = root / 'pardes-9p-work.sock' wait_for('the session\'s 9P socket', sock.exists) @@ -1181,7 +1181,7 @@ def main(binary, cycles): term = Term() stub_pid = root / 'stub.pid' shell = term.spawn(['sh', '-c', '"$@" & echo $! > "$0"; wait; exec sleep 600', - str(stub_pid), binary, '--tty', '--9p=fresh'], env) + str(stub_pid), binary, '--tui', '--9p=fresh'], env) started.append(shell.pid) sock = root / 'pardes-9p-fresh.sock' wait_for('the second session', sock.exists) @@ -1403,7 +1403,7 @@ def install(binary, at): def upgrades(old, new): - """Upgrade (docs/next-daemon.md, phase 6): a tty session with an unsaved + """Upgrade (docs/next-daemon.md, phase 6): a tui session with an unsaved edit, a shell running `sleep 1000; echo done` and two terminals (two views) moved onto another build installed at the path it started from, the daemon with it; then a build that refuses the dump, which falls back @@ -1425,7 +1425,7 @@ def upgrades(old, new): started = [] try: term = Term() - stub = term.spawn([str(binary), '--tty', '--9p=work'], env) + stub = term.spawn([str(binary), '--tui', '--9p=work'], env) started.append(stub.pid) sock = root / 'pardes-9p-work.sock' wait_for('the session\'s 9P socket', sock.exists) @@ -1610,7 +1610,7 @@ def upgrades(old, new): time.sleep(.3) assert alive(shell_pid) and alive(daemon) term = Term() - stub = term.spawn([str(binary), '--tty', '--9p=again'], env) + stub = term.spawn([str(binary), '--tui', '--9p=again'], env) started.append(stub.pid) sock = root / 'pardes-9p-again.sock' wait_for('the next session', sock.exists) diff --git a/test/e2e_harness.zig b/test/e2e_harness.zig index 6011ba16..6d0a43ca 100644 --- a/test/e2e_harness.zig +++ b/test/e2e_harness.zig @@ -91,7 +91,7 @@ pub const Harness = struct { return initArgs(gpa, exe, rows, cols, null); } - /// Like init, but passes one extra CLI arg to the app (e.g. "--tty"). + /// Like init, but passes one extra CLI arg to the app (e.g. "--tui"). pub fn initArgs(gpa: std.mem.Allocator, exe: [*:0]const u8, rows: u16, cols: u16, arg: ?[*:0]const u8) !Harness { var argv: [2]?[*:0]const u8 = .{ null, null }; if (arg) |a| argv[0] = a; @@ -221,7 +221,7 @@ pub const Harness = struct { /// The app's output into the emulator. The one query answered is the /// device status request (`CSI 5 n` → `CSI 0 n`), as every terminal /// does: the tty asks it after each frame and draws no other until the - /// answer (FrameAck in src/tty/tty.zig). + /// answer (FrameAck in src/tui/tui.zig). fn feed(self: *Harness, bytes: []const u8) void { self.stream.nextSlice(bytes); const request = "\x1b[5n"; @@ -45,7 +45,7 @@ def session(binary, root, name, *options, socket_name=None, file=None, tty=False master, slave = os.openpty() fcntl.ioctl(slave, termios.TIOCSWINSZ, struct.pack('HHHH', 24, 80, 0, 0)) env['TERM'] = 'xterm-256color' - args = [binary, '--tty', '--9p=' + (socket_name or name), *options, str(file or fixture)] + args = [binary, '--tui', '--9p=' + (socket_name or name), *options, str(file or fixture)] preexec = lambda: fcntl.ioctl(0, termios.TIOCSCTTY, 0) if launch is not None: args = [binary, *launch] diff --git a/test/gui_golden.py b/test/gui_golden.py index 24fc5986..9afc9c19 100644 --- a/test/gui_golden.py +++ b/test/gui_golden.py @@ -208,8 +208,8 @@ def run(args): client.write('/ctl', b'Debug\n') # A terminal pane: raw rows, ANSI colours, a hidden prompt. before = set(panes(client)) - client.write(f'/pane/{first}/exec', b'Tty\n') - terminal = require(wait_for(lambda: next((s for s in panes(client) if s not in before), None)), 'Tty missing') + client.write(f'/pane/{first}/exec', b'Term\n') + terminal = require(wait_for(lambda: next((s for s in panes(client) if s not in before), None)), 'Term missing') client.write(f'/pane/{terminal}/pty/data', b"PS1='$ '; clear; printf '\\033[1;36mcolour\\033[0m plain \\033[32mgreen\\033[0m\\n'\r") require(wait_for(lambda: b'green' in client.read(f'/pane/{terminal}/body')), 'terminal output missing') scene('17-terminal') diff --git a/test/image_harness.zig b/test/image_harness.zig index b45851cc..18392851 100644 --- a/test/image_harness.zig +++ b/test/image_harness.zig @@ -58,7 +58,7 @@ pub fn main(init: std.process.Init) !void { _ = setenv("TERM", "xterm-256color", 1); _ = setenv("LC_ALL", "C", 1); - if (std.mem.eql(u8, backend, "tty")) { + if (std.mem.eql(u8, backend, "tui")) { if (pdf_mode) try runKittyPdf(arena, exe, base) else diff --git a/test/kitty.zig b/test/kitty.zig index 1e1e8331..f5de44e7 100644 --- a/test/kitty.zig +++ b/test/kitty.zig @@ -1,6 +1,6 @@ //! Kitty graphics protocol conformance for terminal panes, at the core. //! -//! zig build kitty-test -Dplatform=tty|gui these cases alone +//! zig build kitty-test -Dplatform=tui|gui these cases alone //! zig build unit-test they run with the rest //! //! ghostty-vt implements the protocol; what pardes owns is the proxy around diff --git a/test/kitty_harness.zig b/test/kitty_harness.zig index 652395b8..204dae69 100644 --- a/test/kitty_harness.zig +++ b/test/kitty_harness.zig @@ -1,6 +1,6 @@ //! Kitty graphics end to end through a terminal pane. //! -//! zig build kitty-harness -Dplatform=tty a fake kitty terminal outside +//! zig build kitty-harness -Dplatform=tui a fake kitty terminal outside //! zig build kitty-harness -Dplatform=gui the SDL renderer's capture //! //! test/kitty.zig checks the proxy at the core; this checks it through the @@ -67,7 +67,7 @@ pub fn main(init: std.process.Init) !void { try run.start(); if (std.c.getenv("PARDES_KITTY_EXPLORE")) |list| return run.explore(std.mem.span(list)); - std.debug.print("kitty harness ({s}):\n", .{if (gui) "gui" else "tty"}); + std.debug.print("kitty harness ({s}):\n", .{if (gui) "gui" else "tui"}); try run.query(); try run.place(); try run.media(); diff --git a/test/monkey.zig b/test/monkey.zig index 2e19cb21..70a4b4e4 100644 --- a/test/monkey.zig +++ b/test/monkey.zig @@ -1,6 +1,6 @@ // pardes-monkey: random snapshot scripts against the tty, hunting panics. // -// zig build monkey -Dplatform=tty -- <seeds> [steps] [--from=N] [--out=DIR] [--keep] [--views=N] +// zig build monkey -Dplatform=tui -- <seeds> [steps] [--from=N] [--out=DIR] [--keep] [--views=N] // // Each seed makes one script (a fixed seed makes the same script, so a hit // replays): keys and leader bursts, typing, mouse presses, drags and wheel, diff --git a/test/monkey9p.zig b/test/monkey9p.zig index 45c5d12f..8870e389 100644 --- a/test/monkey9p.zig +++ b/test/monkey9p.zig @@ -4,8 +4,8 @@ //! /log said meanwhile. It was test/monkey9p.py, which drove a real //! `pardes --detach` over its socket. //! -//! zig build monkey-session -Dplatform=tty -- [--seed N]... [--steps M] [--only i,j,k] [--no-shrink] [-v] -//! zig build monkey-session-smoke -Dplatform=tty (part of behaviour-test) +//! zig build monkey-session -Dplatform=tui -- [--seed N]... [--steps M] [--only i,j,k] [--no-shrink] [-v] +//! zig build monkey-session-smoke -Dplatform=tui (part of behaviour-test) //! //! A step's op is drawn from the seed alone: the panes, columns and held //! files it names are tokens (`{p3}`: /index's 4th serial, mod its length, @@ -72,7 +72,7 @@ const shell_lines = [_][]const u8{ "true", "false", "echo hi", "echo m9p", "slee const builtins = [_][]const u8{ "Look", "Exec", "Kill", "Dump", "Msg", "NextColor", "Themes", "DumpThemes", "TreeContext", "PdfFit", "PdfTint", "PdfSections", "Petscii", "Palette", "Ascii", "Save", "New", "Newcol", "Del", "Filter", "Mode", "Togglettymode", "Edit", "Undo", "Redo", "Collapse", - "Delcol", "DelAbove", "DelBelow", "Tty", "Repl", "Joincol", "Config", "LocationsConfig", "Messages", "Mini", "Find", "Grep", "Left", + "Delcol", "DelAbove", "DelBelow", "Term", "Repl", "Joincol", "Config", "LocationsConfig", "Messages", "Mini", "Find", "Grep", "Left", "Down", "Up", "Right", "Back", "Forward", "Last", "Recent", "Jumplist", "Colors", "Wrap", "Tagbottom", "Debug", "FocusTint", "Verbose", "Motion", "InactiveDim", "DumpDir", "Theme", "Placement", "BootShell", "LookWord", "Get", "Put", "Undo", "Redo", "Zerox", "Snarf", "Paste", "Cut", "Sort", "Font", "Local", @@ -426,7 +426,7 @@ fn gen(r: Random, a: Allocator) Op { const s = pickSerial(r, a); const line = shellSafe(a, pick(r, &shell_lines)); const x = chance(r); - if (x < 0.25) return .{ .write = .{ .path = print(a, "/pane/{s}/ctl", .{s}), .data = "Tty\n" } }; + if (x < 0.25) return .{ .write = .{ .path = print(a, "/pane/{s}/ctl", .{s}), .data = "Term\n" } }; if (x < 0.45) return .{ .write = .{ .path = print(a, "/pane/{s}/pty/run", .{s}), .data = cat(a, &.{ line, "\n" }), .mode = ORDWR } }; if (x < 0.6) return .{ .write = .{ .path = print(a, "/pane/{s}/pty/data", .{s}), .data = cat(a, &.{ line, "\r" }) } }; if (x < 0.75) return .{ .write = .{ .path = print(a, "/pane/{s}/pty/ctl", .{s}), .data = pick(r, &[_][]const u8{ "sig INT\n", "sig TERM\n", "sig KILL\n", "sig HUP\n" }) } }; @@ -1603,7 +1603,7 @@ fn shrink(gpa: Allocator, seed: u64, f: Found, budget: usize) !void { const small = try ddmin(gpa, body, &trial, Trial.fails); var text: std.ArrayList(u8) = .empty; for (small, 0..) |n, i| try text.print(gpa, "{s}{d}", .{ if (i > 0) "," else "", n }); - std.debug.print(" shrunk {d} -> {d} ops: zig build monkey-session -Dplatform=tty -- --seed {d} --steps {d} --only {s} -v\n", .{ body.len, small.len, seed, f.step + 1, text.items }); + std.debug.print(" shrunk {d} -> {d} ops: zig build monkey-session -Dplatform=tui -- --seed {d} --steps {d} --only {s} -v\n", .{ body.len, small.len, seed, f.step + 1, text.items }); } fn usage() noreturn { diff --git a/test/output.zig b/test/output.zig index 876cd8fc..f484c3e6 100644 --- a/test/output.zig +++ b/test/output.zig @@ -578,7 +578,7 @@ test "EffectCode lists readable virtual sources used by this backend" { try std.testing.expect(out.content.len < 1024); try std.testing.expect(std.mem.indexOf(u8, out.content, "/virtual/src/layout.zig\n") != null); const backend_source = switch (platform) { - .tty => "/virtual/src/tty/panel_compositor.zig", + .tui => "/virtual/src/tui/panel_compositor.zig", .gui => "/virtual/shaders/ui.vert.glsl", .macos => "/virtual/src/macos/Sources/ScenePostprocessor.swift", .web, .esp32p4 => unreachable, diff --git a/test/pdf_scroll_bench.zig b/test/pdf_scroll_bench.zig index 0f93068d..f3d47b1e 100644 --- a/test/pdf_scroll_bench.zig +++ b/test/pdf_scroll_bench.zig @@ -21,7 +21,7 @@ //! the single render — not on one notch. Every timed region below is exactly //! that: `ticks_per_frame` real `Mouse.wheel_down`/`wheel_up` presses through //! `Pardes.update`, one `render()` into a reset frame arena, and the effect -//! drain, which is the loop src/tty/tty.zig and src/gui/gui.zig both run. +//! drain, which is the loop src/tui/tui.zig and src/gui/gui.zig both run. //! //! Rows are per-FRAME latency, not per-notch: a dropped frame is what a reader //! feels, and the batch is indivisible from the reader's point of view. @@ -60,7 +60,7 @@ const gpa = std.heap.smp_allocator; // A reading-sized window. Wide enough that fit-width pages are taller than the // viewport (so a fling genuinely crosses page boundaries) and small enough // that the Kitty raster policy's 1200px cap is the binding quality term, which -// is what the tty shell actually ships. +// is what the tui shell actually ships. const bench_cols: u16 = 120; const bench_rows: u16 = 40; const default_cell_pixels: pardes.CellPixels = .{ .w = 8, .h = 16 }; @@ -383,7 +383,7 @@ fn measure(config: Config, plan: Plan) !Result { total += elapsed; recorder.observe(frame, surface); peak_raster_bytes = @max(peak_raster_bytes, rasterBytes(pv)); - // The same frame boundary src/tty/tty.zig marks, so a Tracy capture + // The same frame boundary src/tui/tui.zig marks, so a Tracy capture // of this benchmark reads like a capture of the real shell. pardes.frameMark(); if (round >= config.warmup) { diff --git a/test/perf.zig b/test/perf.zig index 31a48cc7..31a813cb 100644 --- a/test/perf.zig +++ b/test/perf.zig @@ -1319,7 +1319,7 @@ fn liveYes(l: *Live, exe: [:0]const u8) !void { var h = try eh.Harness.initArgv(gpa, exe, screen_rows, screen_cols, &.{ "-n", "1" }); errdefer h.dump("live yes"); // The prompt shows in tty mode only: the shell's tag, then Ctrl-b in. - if (!try h.waitFor("Tty+bash", 20_000)) return error.LiveNoPrompt; + if (!try h.waitFor("Term+bash", 20_000)) return error.LiveNoPrompt; try h.pump(500); try h.send("\x02"); if (!try h.waitFor("$ ", 20_000)) return error.LiveNoPrompt; @@ -1387,7 +1387,7 @@ fn measureLive(io: std.Io, exe: []const u8, gui: bool, reps: usize, json: bool) try liveOpen(&l, exe_z); liveSweep(io); } - const frontend = if (gui) "gui" else "tty"; + const frontend = if (gui) "gui" else "tui"; const out = std.Io.File.stdout(); var buf: [256]u8 = undefined; for (live_phases, &l.samples, &l.core) |name, *samples, *core| { diff --git a/test/process.zig b/test/process.zig index 21bc8e31..94dfd313 100644 --- a/test/process.zig +++ b/test/process.zig @@ -507,13 +507,13 @@ pub fn of(gpa: std.mem.Allocator, h: *const eh.Harness) Files { /// of the user's is reached. No daemon (PARDES_DAEMON=off, as the pty /// harness starts one): the process is the session, and nothing outlives it. /// Which build the process tests drive (`zig build process-test -/// -Dplatform=tty|gui`, the runner's --backend): a session's effects +/// -Dplatform=tui|gui`, the runner's --backend): a session's effects /// (saves, shells, watches, dumps) are its host's, so each case runs on the /// host it was built with. -pub const Backend = enum { tty, gui }; -pub var backend: Backend = .tty; +pub const Backend = enum { tui, gui }; +pub var backend: Backend = .tui; -/// A case about one frontend's own behaviour (`--tty`, a killed terminal +/// A case about one frontend's own behaviour (`--tui`, a killed terminal /// editor) skips on the other. pub fn only(b: Backend) !void { if (backend != b) return error.SkipZigTest; @@ -725,15 +725,15 @@ pub const Detached = struct { return std.fmt.allocPrintSentinel(d.files.arena.allocator(), "{s}/{s}", .{ d.root(), rel }, 0) catch @panic("out of memory"); } - /// Another session in this root, in a pty, as fs.py's tty sessions: - /// `pardes --tty --9p=<name> <args> <root>/<name>.txt` (holding + /// Another session in this root, in a pty, as fs.py's tui sessions: + /// `pardes --tui --9p=<name> <args> <root>/<name>.txt` (holding /// "initial\n"), back once its socket (`abs("pardes-9p-<name>.sock")`) /// is there. - pub fn startTty(d: *Detached, exe: [:0]const u8, name: []const u8, args: []const [:0]const u8) !Child { + pub fn startTui(d: *Detached, exe: [:0]const u8, name: []const u8, args: []const [:0]const u8) !Child { const a = d.files.arena.allocator(); try d.put(try std.fmt.allocPrint(a, "{s}.txt", .{name}), "initial\n"); var argv: std.ArrayList([:0]const u8) = .empty; - try argv.appendSlice(a, &.{ exe, "--tty", try std.fmt.allocPrintSentinel(a, "--9p={s}", .{name}, 0) }); + try argv.appendSlice(a, &.{ exe, "--tui", try std.fmt.allocPrintSentinel(a, "--9p={s}", .{name}, 0) }); try argv.appendSlice(a, args); try argv.append(a, d.abs(try std.fmt.allocPrint(a, "{s}.txt", .{name}))); const env = try a.dupe([2][:0]const u8, &.{.{ "PARDES_DUMP", d.abs(try std.fmt.allocPrint(a, "{s}.dump.zon", .{name})) }}); diff --git a/test/process/builtins.zig b/test/process/builtins.zig index 410a3f54..0d8ef5d4 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 }) |tty| { + for ([_]bool{ false, true }) |tui| { var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); - const name = if (tty) "lsp-tty" else "lsp-detached"; - var d = try process.Detached.start(gpa, exe, if (tty) "lsp-root" else name, .{}); + const name = if (tui) "lsp-tui" else "lsp-detached"; + var d = try process.Detached.start(gpa, exe, if (tui) "lsp-root" else name, .{}); defer d.deinit(); var term: ?process.Child = null; defer if (term) |*t| t.deinit(); - if (tty) term = try d.startTty(exe, name, &.{}); + if (tui) term = try d.startTui(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 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| { diff --git a/test/process/look_and_exec.zig b/test/process/look_and_exec.zig index 8ff01054..83836def 100644 --- a/test/process/look_and_exec.zig +++ b/test/process/look_and_exec.zig @@ -64,9 +64,9 @@ const Flow = struct { fn canary(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // shortcut: on the window, after its terminal steps, Newcol is refused - // (or a run hangs), where a fresh window takes it; tty alone until that + // (or a run hangs), where a fresh window takes it; tui alone until that // is found (docs/next-tests.md). - try process.only(.tty); + try process.only(.tui); const started = process.nowMs(); var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); @@ -121,7 +121,7 @@ fn canary(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try std.testing.expectEqualStrings("from disk\n", try c.pane(a, pb, "body")); // A terminal: pty/run failing then passing. - const term = try f.madeBy(1, "Tty\n"); + const term = try f.madeBy(1, "Term\n"); { const deadline = process.nowMs() + 10_000; while (true) { diff --git a/test/process/mounts.zig b/test/process/mounts.zig index 10dc7b5a..f59a7a0f 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 }) |tty| for ([_][:0]const u8{ "127.0.0.1", "::1" }) |host| { + for ([_]bool{ false, true }) |tui| 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 (tty) "quic-root" else "server", .{ .args = if (tty) &.{} else &args }); + var d = try Detached.start(gpa, exe, if (tui) "quic-root" else "server", .{ .args = if (tui) &.{} else &args }); defer d.deinit(); var term: ?process.Child = null; defer if (term) |*t| t.deinit(); - if (tty) term = try d.startTty(exe, "server", &args); + if (tui) term = try d.startTui(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/repls.zig b/test/process/repls.zig index 09e25e96..a6fe07ac 100644 --- a/test/process/repls.zig +++ b/test/process/repls.zig @@ -35,7 +35,7 @@ fn pythonRepl(gpa: std.mem.Allocator, exe: [:0]const u8) !void { const c = try Conn.dial(gpa, d.socket()); defer c.deinit(gpa); const before = try c.serials(a); - try c.write("/pane/1/ctl", "Tty\n"); + try c.write("/pane/1/ctl", "Term\n"); const deadline = process.nowMs() + 10_000; var tty: u32 = 0; while (tty == 0 and process.nowMs() < deadline) : (process.nap(50)) { @@ -43,7 +43,7 @@ fn pythonRepl(gpa: std.mem.Allocator, exe: [:0]const u8) !void { tty = @max(tty, n); }; } - try check(tty != 0, "Tty made no pane", .{}); + try check(tty != 0, "Term made no pane", .{}); try check(try waitFor(a, c, tty, "$", 15_000) or try waitFor(a, c, tty, ">", 15_000), "no prompt: {s}", .{try c.pane(a, tty, "body")}); try c.write(try std.fmt.allocPrint(a, "/pane/{d}/pty/data", .{tty}), "python3 -q\r"); try check(try waitFor(a, c, tty, ">>>", 15_000), "no >>>: {s}", .{try c.pane(a, tty, "body")}); diff --git a/test/process/root_ctl.zig b/test/process/root_ctl.zig index 8ad92f7d..f4a0149b 100644 --- a/test/process/root_ctl.zig +++ b/test/process/root_ctl.zig @@ -28,7 +28,7 @@ fn exitAnswers(gpa: std.mem.Allocator, exe: [:0]const u8) !void { /// Nothing attached, no key, no click, no other request comes to move it along. fn messagesExpire(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // With nothing attached: a window always is. - try process.only(.tty); + try process.only(.tui); var d = try process.Detached.start(gpa, exe, "msg", .{}); defer d.deinit(); try d.files.write("/pane/1/ctl", "Msg lingering-words\n"); @@ -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 }) |tty| { + for ([_]bool{ false, true }) |tui| { var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); - 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, .{}); + 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, .{}); defer d.deinit(); var term: ?process.Child = null; defer if (term) |*t| t.deinit(); - if (tty) term = try d.startTty(exe, name, &.{}); + if (tui) term = try d.startTui(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 == .tty) try std.testing.expectEqual(@as(usize, if (tty) 80 else 160), width); + if (process.backend == .tui) try std.testing.expectEqual(@as(usize, if (tui) 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")); } diff --git a/test/process/terminals.zig b/test/process/terminals.zig index e7e93a4f..96804adf 100644 --- a/test/process/terminals.zig +++ b/test/process/terminals.zig @@ -79,9 +79,9 @@ const Other = struct { }; fn runFile(gpa: std.mem.Allocator, exe: [:0]const u8) !void { - // shortcut: on the window a fresh Tty's first pty/run sometimes never - // answers (4 runs of 6); tty alone until that is found (docs/next-tests.md). - try process.only(.tty); + // shortcut: on the window a fresh Term's first pty/run sometimes never + // answers (4 runs of 6); tui alone until that is found (docs/next-tests.md). + try process.only(.tui); var d = try process.Detached.start(gpa, exe, "run", .{}); defer d.deinit(); const f = &d.files; @@ -97,12 +97,12 @@ fn runFile(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try c.write(f.at("/pane/{d}/name", .{peer}), "/n/nosuchpeer/d/f.txt\n"); const count = std.mem.count(u8, try c.read(a, "/index"), "\n"); try refusedSaying(c, f.at("/pane/{d}/exec", .{peer}), "ls\n", "no such directory"); - try refusedSaying(c, f.at("/pane/{d}/exec", .{peer}), "Tty\n", "no such directory"); + try refusedSaying(c, f.at("/pane/{d}/exec", .{peer}), "Term\n", "no such directory"); try expectEqual(count, std.mem.count(u8, try c.read(a, "/index"), "\n")); try expect(!has(try c.read(a, "/log"), "exit 127")); try c.remove(f.at("/pane/{d}", .{peer})); try c.write("/exec", "Shell bash\n"); - try c.write("/exec", "Tty\n"); + try c.write("/exec", "Term\n"); var term: u32 = 0; var rows = std.mem.tokenizeScalar(u8, try c.read(a, "/index"), '\n'); while (rows.next()) |r| { @@ -222,8 +222,8 @@ fn namedOnce(gpa: std.mem.Allocator, exe: [:0]const u8) !void { var made: std.ArrayList(u32) = .empty; try made.append(a, try c.look(a, f.at("{s}/sub", .{root}), null)); const before = try serials(a, c); - try c.write("/pane/1/ctl", "Tty\n"); - if (shell(a, "command -v fish >/dev/null", .{}) == 0) try c.write("/pane/1/ctl", "Tty fish\n"); + try c.write("/pane/1/ctl", "Term\n"); + if (shell(a, "command -v fish >/dev/null", .{}) == 0) try c.write("/pane/1/ctl", "Term fish\n"); for (try serials(a, c)) |s| if (std.mem.indexOfScalar(u32, before, s) == null) try made.append(a, s); try expect(made.items.len >= 2); process.sleep(1500); // their shells start and say where they are @@ -235,14 +235,14 @@ fn namedOnce(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try expect(!has(log, f.at("\nrename {d} ", .{s}))); try expect(has(log, f.at("\nnew {d} {s}", .{ s, root }))); } - // A shell that cannot start (its interpreter is not there): Tty fails + // A shell that cannot start (its interpreter is not there): Term fails // the write with why and leaves no pane; pty/ctl exec fails with why // and keeps its terminal. try d.put("badsh", "#!/nonexistent/interp\n"); const bad = f.at("{s}/badsh", .{root}); _ = libc.chmod(try std.fmt.allocPrintSentinel(a, "{s}", .{bad}, 0), 0o755); const panes = std.mem.count(u8, try c.read(a, "/index"), "\n"); - try refusedSaying(c, "/pane/1/ctl", f.at("Tty {s}\n", .{bad}), "interpreter /nonexistent/interp not found"); + try refusedSaying(c, "/pane/1/ctl", f.at("Term {s}\n", .{bad}), "interpreter /nonexistent/interp not found"); try refusedSaying(c, "/ctl", f.at("Shell {s}\n", .{bad}), "interpreter /nonexistent/interp not found"); process.sleep(300); try expectEqual(panes, std.mem.count(u8, try c.read(a, "/index"), "\n")); @@ -275,7 +275,7 @@ fn drive(gpa: std.mem.Allocator, exe: [:0]const u8, script: []const u8, key: ?u8 const f = &d.files; try d.put("command.sh", f.at("exec /bin/sh -c '{s}'\n", .{script})); try f.write("/ctl", "Shell /bin/sh\n"); - try f.write("/exec", "Tty\n"); + try f.write("/exec", "Term\n"); const term = try f.focused(); const body = f.at("/pane/{d}/body", .{term}); const data = f.at("/pane/{d}/pty/data", .{term}); diff --git a/test/process/tree.zig b/test/process/tree.zig index ee39170b..27b51bf1 100644 --- a/test/process/tree.zig +++ b/test/process/tree.zig @@ -482,7 +482,7 @@ fn cutWrites(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try expectEqual(@as(usize, 2500), k); // A detached session with no frontend is 160x50 until told; a // window's size is its own, and refuses size. - if (process.backend == .tty) { + if (process.backend == .tui) { const cols, const rows = try screenSize(f); try expect(cols == 160 and rows == 50); try c.write("/ctl", "size 132 40\n"); diff --git a/test/process_test.zig b/test/process_test.zig index a870f13a..67f28f53 100644 --- a/test/process_test.zig +++ b/test/process_test.zig @@ -21,7 +21,7 @@ const files = .{ pub fn main(init: std.process.Init) !void { const all = try init.minimal.args.toSlice(init.arena.allocator()); - // <pardes> [--backend=tty|gui] [filter] + // <pardes> [--backend=tui|gui] [filter] var args: [3][:0]const u8 = undefined; var n: usize = 0; for (all[1..]) |a| { diff --git a/test/record_casts.py b/test/record_casts.py index 13893517..15f46ced 100644 --- a/test/record_casts.py +++ b/test/record_casts.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """Record the documentation site's terminal casts (asciicast v2). -zig build -Dplatform=tty -Doptimize=ReleaseSafe --prefix <scratch dir> +zig build -Dplatform=tui -Doptimize=ReleaseSafe --prefix <scratch dir> python3 -B test/record_casts.py <scratch dir>/bin/pardes [cast ...] [--show] Each cast runs the tty pardes in a pty this script owns, sized 100x30 with @@ -770,8 +770,8 @@ def terminals(r): """A shell beside the notes: run, Ctrl-b, copy a line of output into the file; then git log paged through pardes - into a +Pager.""" r.step(None, until=lambda s: 'What ./hello prints' in s.text(), quiet=.4, hold=1.2) - start, end = word_at(r, 'Tty', 2) - r.sweep(1, start, end, show=.5, hold=.6, until=lambda s: 'Tty+sh' in s.text(), what='the shell') + start, end = word_at(r, 'Term', 2) + r.sweep(1, start, end, show=.5, hold=.6, until=lambda s: 'Term+sh' in s.text(), what='the shell') r.step(None, until=lambda s: s.text().count('$') >= 2, hold=.4) # Its own column, beside the file: Ctrl-b to normal, Alt-c, Ctrl-b back. r.step('\x02', hold=.3) @@ -909,7 +909,7 @@ def show(name, work, at=None): def main(): parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('binary', type=Path, nargs='?', help='a pardes built with -Dplatform=tty') + parser.add_argument('binary', type=Path, nargs='?', help='a pardes built with -Dplatform=tui') parser.add_argument('casts', nargs='*', help='which casts (default: all): ' + ', '.join(CASTS)) parser.add_argument('--work', type=Path, default=REPO.parent / '.scratch/casts/work', help='the session home, step logs and check pictures (default %(default)s)') diff --git a/test/record_demos.py b/test/record_demos.py index a2e48d73..4468ffb6 100644 --- a/test/record_demos.py +++ b/test/record_demos.py @@ -220,7 +220,7 @@ class Session: def terminal_rows(self): """The screen's rows below the (one) terminal's tag.""" rows = self.screen() - return rows[next(i for i, line in enumerate(rows) if 'Tty+sh' in line) + 1:] + return rows[next(i for i, line in enumerate(rows) if 'Term+sh' in line) + 1:] def wait(self, predicate, what, seconds=20): deadline = time.monotonic() + seconds @@ -594,7 +594,7 @@ def text_is_the_interface(s): def shell_setup(s): """A terminal under the file, at the project, with a short prompt.""" - s.write('/pane/1/exec', 'Tty\n') + s.write('/pane/1/exec', 'Term\n') s.wait(lambda: 2 in s.panes(), 'the terminal') s.write('/pane/2/pty/data', f"cd {PROJECT}; PS1='$ '; clear\r") s.wait(lambda: any(line.rstrip() == ' $' for line in s.screen()), 'the prompt') @@ -844,7 +844,7 @@ def theme_scene(s): subprocess.run(['git', '-C', str(PROJECT), *args], check=True, env=env, capture_output=True) main = PROJECT / 'src/main.c' main.write_text(main.read_text().replace('i <= 4', 'i <= 5')) - s.write('/pane/1/exec', 'Tty\n') + s.write('/pane/1/exec', 'Term\n') s.wait(lambda: 2 in s.panes(), 'the terminal') s.write('/pane/2/pty/data', f"cd {PROJECT}; PS1='$ '; clear; make; git diff\r") s.wait(lambda: len(s.panes()) == 3, 'the pager') diff --git a/test/replicas.zig b/test/replicas.zig index 18060763..4fcb9920 100644 --- a/test/replicas.zig +++ b/test/replicas.zig @@ -12,8 +12,8 @@ //! the authority steps, each replica acknowledging them over its link and //! asking for the rows it scrolls back into and does not hold. //! -//! zig build replicas -Dplatform=tty -- [--seeds N] [--steps M] [--clients C] [--rtt 30,80,207] [--first K] [--flood MB] [--shared] -//! zig build replicas -Dplatform=tty -- --echo [--seeds N] [--rtt 30,80,207] [--first K] +//! zig build replicas -Dplatform=tui -- [--seeds N] [--steps M] [--clients C] [--rtt 30,80,207] [--first K] [--flood MB] [--shared] +//! zig build replicas -Dplatform=tui -- --echo [--seeds N] [--rtt 30,80,207] [--first K] //! //! `--echo` types a corpus into a shell instead, with and without the //! predicted echo (src/echo.zig), and gates what it draws: below, at diff --git a/test/rollback_bench.zig b/test/rollback_bench.zig index 0f0c77a4..659a73d3 100644 --- a/test/rollback_bench.zig +++ b/test/rollback_bench.zig @@ -9,7 +9,7 @@ //! Then a fork of the big one, child gone at once, and the authority's //! copy-on-write after it. //! -//! zig build rollback-bench -Dplatform=tty -Doptimize=ReleaseFast +//! zig build rollback-bench -Dplatform=tui -Doptimize=ReleaseFast const std = @import("std"); const libc = std.c; const pardes = @import("pardes"); diff --git a/test/selfmount.py b/test/selfmount.py index 61d32523..1df17226 100644 --- a/test/selfmount.py +++ b/test/selfmount.py @@ -37,7 +37,7 @@ def unix_mount(ns, binary, served, env, name, fixture): env = dict(env, PARDES_DUMP=f'/tmp/{second}.dump.zon') pid, master = pty.fork() if pid == 0: - os.execve(ns, ['9ns', '--unix', served, '--', binary, '--tty', '--9p=' + second, str(fixture)], env) + os.execve(ns, ['9ns', '--unix', served, '--', binary, '--tui', '--9p=' + second, str(fixture)], env) fcntl.ioctl(master, termios.TIOCSWINSZ, struct.pack('HHHH', 30, 100, 0, 0)) os.set_blocking(master, False) try: @@ -83,7 +83,7 @@ def run(binary): env['PARDES_LSP_' + language] = '' pid, master = pty.fork() if pid == 0: - os.execve(ns, ['9ns', '--mntgen', '--', binary, '--tty', '--9p=' + name, str(fixture)], env) + os.execve(ns, ['9ns', '--mntgen', '--', binary, '--tui', '--9p=' + name, str(fixture)], env) fcntl.ioctl(master, termios.TIOCSWINSZ, struct.pack('HHHH', 30, 100, 0, 0)) os.set_blocking(master, False) tail = bytearray() @@ -276,7 +276,7 @@ def run(binary): other_env = dict(env, PARDES_DUMP=f'/tmp/{other}.dump.zon') other_pid, other_master = pty.fork() if other_pid == 0: - os.execve(binary, [binary, '--tty', '--9p=' + other], other_env) + os.execve(binary, [binary, '--tui', '--9p=' + other], other_env) os.set_blocking(other_master, False) deadline = time.monotonic() + 15 while not os.path.exists(other_sock) and time.monotonic() < deadline: diff --git a/test/snapshot.zig b/test/snapshot.zig index 95d07cc7..00585018 100644 --- a/test/snapshot.zig +++ b/test/snapshot.zig @@ -1132,7 +1132,7 @@ fn readProc(buf: []u8, path: [*:0]const u8) ?[]const u8 { /// What a capture is made of: grid text, cursor cell, and a compact digest of /// every cell style. Style used not to matter to `stable`, which let a -/// color-only animation look idle while the TTY frontend was deliberately +/// color-only animation look idle while the TUI frontend was deliberately /// asleep between frames; a following `snapstyle` then caught a midpoint. fn stateKey(h: *eh.Harness) ![]u8 { const text = try h.screenText(); @@ -1455,7 +1455,7 @@ fn styleRows(arena: std.mem.Allocator, h: *eh.Harness) ![]const []const u8 { var run_len: usize = 0; var run_start: u16 = 0; // A blank's ink shows nowhere, and the tty leaves whatever ink the - // terminal had there (tty.zig blankInk), so it depends on the frames + // terminal had there (tui.zig blankInk), so it depends on the frames // before: a blank is written with the ink of the cell before it. var ink_buf: [16]u8 = undefined; var ink: []const u8 = "d"; diff --git a/test/snapshots/images.snap b/test/snapshots/images.snap index caed1fa1..d5dc580d 100644 --- a/test/snapshots/images.snap +++ b/test/snapshots/images.snap @@ -1,6 +1,6 @@ # image panes: right-click a .ppm opens petscii glyph art (no kitty in the # harness). The tag starts with the renderer's plain state fields followed by -# its path and `Tty Del`; the fields are display-only, while their toggles are +# its path and `Term Del`; the fields are display-only, while their toggles are # builtins under SPC t (the old clickable tag words sat past the pane's right # edge, so clicking them only ever hit the neighbouring shell's tag). ppmdiag pic.ppm @@ -41,12 +41,12 @@ snap no-ascii # prefix is wider than this source-local column, so widen the grid for this # final assertion. (A column-border drag intentionally takes width from only # one neighbour, which cannot expose this 82-column prefix.) Then click the -# visible tail itself, at its `Tty`. This proves the image tag is an ordinary +# visible tail itself, at its `Term`. This proves the image tag is an ordinary # editor rather than accidentally typing at a clipped read-only path. resize 31 400 stable 400 5000 -press left @Tty 7 -release left @Tty 7 +press left @Term 7 +release left @Term 7 stable 400 5000 key i send Zork\x20 diff --git a/test/snapshots/look-fd-deep.snap b/test/snapshots/look-fd-deep.snap index 8df0aaaf..d9e5ac06 100644 --- a/test/snapshots/look-fd-deep.snap +++ b/test/snapshots/look-fd-deep.snap @@ -18,7 +18,7 @@ stable 700 20000 text cd a && ls && fd key enter wait 8000 c.txt -wait 8000 cwd/a Tty +wait 8000 cwd/a Term stable 700 20000 snap listed press right 6 8 diff --git a/test/snapshots/look-file-1col.snap b/test/snapshots/look-file-1col.snap index 490aaf38..1b23e054 100644 --- a/test/snapshots/look-file-1col.snap +++ b/test/snapshots/look-file-1col.snap @@ -1,5 +1,5 @@ # single narrow column (-n 1): the first document splits below its source -# shell, like Tty. A new column would require at least 200 cells of width. +# shell, like Term. A new column would require at least 200 cells of width. lines big.txt 60 start 31 100 -n 1 wait 8000 big.txt diff --git a/test/snapshots/ttyclick.snap b/test/snapshots/ttyclick.snap index 65b6f9fc..534005b9 100644 --- a/test/snapshots/ttyclick.snap +++ b/test/snapshots/ttyclick.snap @@ -18,8 +18,8 @@ snap tty-bodyclick # tag edit from tty: the box still reads `$` while the tag is typed into (the # tag's mode is its own: a clicked tag is in normal mode), and `:` hands the keyboard back — a bug # that lost the body's mode would show `•` in one snap or the other -press left @Tty 3 -release left @Tty 3 +press left @Term 3 +release left @Term 3 stable 400 5000 snap tty-tagedit key : diff --git a/test/snapshots/ttyonly.snap b/test/snapshots/ttyonly.snap index 1008e084..0c2d8738 100644 --- a/test/snapshots/ttyonly.snap +++ b/test/snapshots/ttyonly.snap @@ -1,6 +1,6 @@ -# --tty: a single fullscreen shell already in raw tty mode, prompts visible +# --tui: a single fullscreen shell already in raw tty mode, prompts visible file t.txt x -start 31 100 --tty +start 31 100 --tui wait 8000 $ stable 700 20000 text echo TTY''ONLY diff --git a/test/soak.py b/test/soak.py index e3ff18c7..99f43cc9 100644 --- a/test/soak.py +++ b/test/soak.py @@ -935,7 +935,7 @@ class Run: self.safe_tags() # Two shells beside the directory, as the user's had. for _ in range(self.shells): - self.nine_write('/pane/1/exec', b'Tty\n') + self.nine_write('/pane/1/exec', b'Term\n') time.sleep(0.5) def session_alive(self): @@ -1027,7 +1027,7 @@ class BoxRun(Run): self.session_pid = int(dict(line.split(maxsplit=1) for line in status.splitlines())['pid']) self.safe_tags() for _ in range(self.shells): - self.nine_write('/pane/1/exec', b'Tty\n') + self.nine_write('/pane/1/exec', b'Term\n') time.sleep(1) def session_alive(self): @@ -1633,7 +1633,7 @@ def local_session(run, kind): run.nine = None wait_for(f'{name}\'s 9P', run.nine_sock.exists, timeout=30) wait_for(f'{name}\'s first frame', c.ready, timeout=30) - run.nine_write('/pane/1/exec', b'Tty\n') + run.nine_write('/pane/1/exec', b'Term\n') time.sleep(1) run.instant_panes = instant_panes(run) run.nine_write(f'/pane/{run.instant_panes[1]}/body', b'seq 1 3000\n') diff --git a/test/tag_cleanup.py b/test/tag_cleanup.py index ae0a0e66..80bdb4b0 100644 --- a/test/tag_cleanup.py +++ b/test/tag_cleanup.py @@ -30,11 +30,11 @@ def run(args): pdf = next(serial for serial, tag in panes(client).items() if str(source) in tag) pdf_tag = client.read(f'/pane/{pdf}/tag').decode().strip() require(pdf_tag.startswith(str(source) + ' [1/'), 'PDF name/page prefix missing') - require(pdf_tag.endswith('] Tty Del PdfSections PdfTint Collapse'), 'PDF commands missing') + require(pdf_tag.endswith('] Term Del PdfSections PdfTint Collapse'), 'PDF commands missing') require(all(word not in pdf_tag for word in ['PdfFit', 'filtered', 'full', 'disabled']), 'PDF tag contains fit or tint-state clutter') control = new_pane(client, b'') before = set(panes(client)) - execute(client, control, 'Tty') + execute(client, control, 'Term') tty = require(wait_for(lambda: next((s for s in panes(client) if s not in before), None)), 'terminal missing') client.write(f'/pane/{control}/exec', b'Del\n') # owned command-only scratch diff --git a/test/ui_review.py b/test/ui_review.py index a1cdcdeb..3232c519 100644 --- a/test/ui_review.py +++ b/test/ui_review.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Capture a read-only Agave review in an isolated SDL or TTY session. +"""Capture a read-only Agave review in an isolated SDL or TUI session. python3 test/ui_review.py zig-out/bin/pardes-gui /tmp/pardes-review \\ --project /path/to/agave --theme orchard @@ -36,7 +36,7 @@ def command(client, serial, text): """Execute a temporary tag command without changing source contents.""" tag = f'/pane/{serial}/tag' before = client.read(tag).rstrip(b'\n') - tail_start = before.index(b'Save Tty Del') + tail_start = before.index(b'Save Term Del') while tail_start and before[tail_start - 1:tail_start] == b' ': tail_start -= 1 client.write(tag, b' ' + text.encode()) @@ -120,10 +120,10 @@ def run(args): if grep_pane: (root / 'grep-results.txt').write_bytes(client.read(f'/pane/{grep_pane}/body')) capture(client, root, '03-grep', not args.tty) - command(client, source, 'Tty') + command(client, source, 'Term') terminal = require(wait_for(lambda: next((serial for serial in panes(client) if 'pty' in client.list(f'/pane/{serial}')), None)), - 'Tty did not create a terminal') + 'Term did not create a terminal') if terminal: client.write(f'/pane/{terminal}/pty/data', b"printf '\\033[1;36mAgave workspace\\033[0m\\n'; pwd; printf '\\033[32mRead-only UI review ready\\033[0m\\n'\r") require(wait_for(lambda: b'\nRead-only UI review ready\n' in diff --git a/test/window_opacity.py b/test/window_opacity.py index 0253e15c..2664ff8c 100644 --- a/test/window_opacity.py +++ b/test/window_opacity.py @@ -46,7 +46,7 @@ def run(args): source = require(wait_for(lambda: next((serial for serial, tag in panes(client).items() if str(source_path) in tag), None)), 'source missing') before = set(panes(client)) - command(client, source, 'Tty') + command(client, source, 'Term') terminal = require(wait_for(lambda: next((serial for serial in panes(client) if serial not in before), None)), 'terminal missing') client.write(f'/pane/{terminal}/pty/data', diff --git a/test/yazi_preview.py b/test/yazi_preview.py index 7fa02aa6..4c64b2a7 100644 --- a/test/yazi_preview.py +++ b/test/yazi_preview.py @@ -105,7 +105,7 @@ def run(args): with session('/bin/sh', root, name, socket_name=name, tty=True, launch=launch, inherited=inherited) as (client, _): scratch = new_pane(client, b'') before = panes(client) - execute(client, scratch, 'Tty') + execute(client, scratch, 'Term') term = require(wait_for(lambda: next((s for s in panes(client) if s not in before and 'pty' in client.list(f'/pane/{s}')), None)), 'no terminal') client.remove(f'/pane/{scratch}') |
