A CLI that stops reading its keys blocks the crew screen: Keys() writes to the pty inside Update #13
Loading…
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 (defect): the crew screen keeps drawing and answering the owner when a Claude Code member's CLI has stopped reading its terminal.
crewScreen.Updatehands one member's keys to its CLI withlive.Keys→terminal.Write→tty.Write, on the program's own loop (cmd/lazymartha/crew.go). A pty write blocks when the pty's input buffer is full and the child is not reading it, so a CLI that is busy, hung, or waiting on anything but its terminal holdsUpdate— and the whole screen with it — until it reads again, if it ever does. Nothing drains or drops those keys.This is the one path left of the shape #11 r=2 removed everywhere else (
caa38f1): work done from insideUpdatethat waits for the program's own loop. There it froze the screen on ctrl+a, on Enter for a turn and on any terminal resize with a CLI pane; the keys were left synchronous becauseKeysonly writes.Suggested fix: give each terminal one writer of its own — the keys go to a command or a small queue the writer drains — so the loop never waits on a pty write, and a CLI that stops reading cannot stop the screen.
Not blocking anything: no evidence run hit it, because every stand-in CLI in the tests and the pty driver reads every line it is given. Noted by Mars on the #11 r=2 pass, optional then.
Refs #11
Folded into #14, which has landed: main is
876f0fb9(PR 15, run 7020 green).What this issue asked for — a CLI that stops reading its keys must not block the crew screen — is in that commit: internal/terminal's
Keysenqueues into a bounded queue (64 batches) drained by one writer goroutine, and a full queue answers "the CLI is not reading its keys", named by member on screen;Writeis gone and the tests useKeys.Closing here, with #14.