From 34641e435fcbae0af578189760d5ebb05bc07f9a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 17 Nov 2026 03:56:36 -0300 Subject: Term: a core without a terminal boots to a scratch pane, and a test skips only where it needs a terminal (docs/next-terminal.md, Phase 1, the no-terminal core): Pardes.init's shell boots (.shell, .classic, .tty, .tty_shell) are one scratch pane when Term.ops is null, so a test that booted a shell for convenience runs on it, where every one of them skipped before (Term.open refused with SkipZigTest under a test); Term.open refuses with error.NoTerminal, said by errorWords as Term.none, so Term and an exec no shell can take (a command pane) refuse in words (`Term: no terminal in this build`, `exec: ...`), and takesCommandLine is false with no terminal pane; a +Pager pages the bytes as they are (Term.page, unchanged); no boot message: the no-terminal core is a test build alone, read by no person, and a message at boot put seven core tests (the message log, the notice bands, the Del question's wake, a press on a column's rule) out of core-test; a test that fails for want of a terminal says so on its first line (`if (pardes.Term.ops == null) return error.SkipZigTest; // a shell`: a shell, a command pane, the classic boot's three shells, it reads the emulator, ...), 99 tests in 25 files, and ninep/testing.zig's withTerm, the fixture of 29 that assert a terminal pane, once; each attributed by its failure on the scratch boot (NoTerminal from newShell or newCommand, a shell's pane, prompt, pty bytes or tag asserted, the classic boot's panes indexed) and by reading its body; no assertion changes; test: Term.zig ends with the no-terminal core's three (each boot a scratch pane and no terminal; Term, newShell and an exec refused in words, no line typed at a shell; a program's output paged as plain text); core-test (no terminal) 411 passed / 535 skipped of 946 to 810 passed / 139 skipped of 949, shell-test 992: 989 passed, the three no-terminal tests skipped --- src/host_io.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/host_io.zig') diff --git a/src/host_io.zig b/src/host_io.zig index 206341f9..b086b5fe 100644 --- a/src/host_io.zig +++ b/src/host_io.zig @@ -868,6 +868,7 @@ pub const Lsp = struct { } test "a snapshot owns every byte the backend will read" { + if (pardes.Term.ops == null) return error.SkipZigTest; // a terminal pane's snapshot const gpa = std.testing.allocator; const core = try pardes.Pardes.init(gpa, .{ .tty_only = true }); defer core.deinit(); @@ -3563,6 +3564,7 @@ test "Kill stops the foreground job, never the shell, and finds none with job co } test "a command pane's child is its shell running the one line, and its exit status is read at the end" { + if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane if (comptime !tty_probe_platform) return error.SkipZigTest; const core = try pardes.Pardes.init(std.testing.allocator, .{ .tty_only = true }); defer core.deinit(); @@ -3585,6 +3587,7 @@ test "a command pane's child is its shell running the one line, and its exit sta } test "a command's exit is its process's, told by its watcher, whether or not its pty has ended" { + if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane if (comptime !tty_probe_platform) return error.SkipZigTest; const core = try pardes.Pardes.init(std.testing.allocator, .{ .tty_only = true }); defer core.deinit(); @@ -3618,6 +3621,7 @@ test "a command's exit is its process's, told by its watcher, whether or not its } test "a command's background job outlives it and its pty, and Kill stops its whole line, its & jobs too" { + if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane if (comptime !tty_probe_platform) return error.SkipZigTest; if (!haveFile("/bin/sh")) return error.SkipZigTest; const core = try pardes.Pardes.init(std.testing.allocator, .{ .tty_only = true }); -- cgit v1.3