Kill the mutants of the child-shell reader and the streamed claude, and end a command at its last terminator

This commit is contained in:
2026-11-19 05:02:06 +01:00
parent a7439c2e00
commit cff76d2172
3 changed files with 89 additions and 5 deletions
+2 -2
View File
@@ -78,10 +78,10 @@ def output_written(pid: int, started: float) -> float:
def command_of(shell_argv: list[str]) -> str:
"""What a shell runs: the text of its command line after Claude Code's `eval '`, up to the first ` < /dev/null`, which a call that began in the foreground lacks; the whole line where it holds no `eval`."""
"""What a shell runs: the text of its command line after Claude Code's `eval '`, up to the last ` < /dev/null`, which a call that began in the foreground lacks; the whole line where it holds no `eval`."""
line = " ".join(shell_argv)
_, found, command = line.partition(" && eval ")
return (command.split(" < /dev/null", 1)[0].removeprefix("'").removesuffix("'") if found else line)[:COMMAND_CHARS]
return (command.rsplit(" < /dev/null", 1)[0].removeprefix("'").removesuffix("'") if found else line)[:COMMAND_CHARS]
def holds_slot(pid: int, slots: pathlib.Path) -> bool: