martha start gates on standard input alone, so a start whose output is a pipe starts a member that dies at once on the host print-mode complaint #155
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (fix): a member's start whose standard output is not a terminal is refused before anything is started, naming the stream that is not one, instead of starting the member and having it end at once on the host's print-mode complaint.
What happens.
martha start <member>gates on the owner's terminal withio.terminal.is_terminal, which isisatty(0)alone (run_the_martha_command.ts:1085), and the refusal it can give speaks only of input:martha start runs a member on your own terminal, and its input is not one. Run it yourself, in a terminal.(start_a_member.ts:72). A start whose standard input and standard error are a terminal but whose standard output is a pipe passes that gate. The host answers interactively or not on standard output, so it runs print mode with no input and ends at once:Verified on host00, 2026-11-24 19:44Z: stdin and stderr on the pty, stdout into
cat, no member and no martha in the run.Instance. 2026-11-24 ~19:38Z, restarting the pilot's Neptunus member in its own tmux pane with the start's output piped to
tee(~/work/martha-pilot-ws): the start passed its terminal check, because the pane's stdin was a terminal, and the member ended at once with the line above. Typed again without the pipe into the same pane, the same launcher started the same member andmartha lsread itrunning. The pipe is invisible to martha and costs the member its terminal.Where it is read. Three tests of "is a terminal" disagree, and only the host's matches what makes a member interactive:
terminalOfThisProcess(run_the_martha_command.ts:1085):isatty(0)alone. It is the gate forstart(start_a_member.ts:151),up(run_the_martha_command.ts:429), the kitty open (:376) andattach(:407).isOnTheOwnersTerminal(member_on_the_owners_terminal.ts:146-148):isatty(0) && isatty(2), never fd 1. It decides that the member becomes the terminal's foreground job (end_a_launch.ts:156) instead of a detached child.ownerCanAnswerTheHost(host_runs_the_relay.ts:75):isatty(0).So the start thinks it is on the owner's terminal on every measure martha has, and the member's own host disagrees.
The stand-in cannot catch it as it stands. The recorded-host stand-in writes that print-mode complaint only when
--printis among its arguments (host_stand_in.ts:155), and martha never passes--printto a member. A fix is only proved if the stand-in models the host's own decision (print mode when its standard output is not a terminal), or if the test asserts the refusal directly, before any host is run.What a refusal should say. One line, naming the stream that is not a terminal and what to do instead, e.g.:
An engine member started the same way loses only the pipe today and its engine still runs, so whoever fixes this should say in the issue or the diff whether the refusal covers both hosts or the host that is its own interactive process.
Done when. A start whose standard output is not a terminal starts no member, exits non-zero before any host is run, and says in one line which stream is not a terminal and how to start the member instead; a start whose three streams are the terminal is unchanged. Test plus the mutant that drops the standard-output check and dies.
Refs macula-io/martha#102 (the pilot this was found on), macula-io/martha#147.