An overnight run could sit forever on "Do you want to kill the other
sessions? [y/n]" having done no work. Three things were wrong.
`auto` asked whenever `has_stdin()` was true, and that only checks stdin has a
file descriptor -- true under nohup, under cron with `</dev/null`, behind a
pipe, and inside a detached tmux. So it resolved to 'ask' for precisely the
runs that cannot answer. New `is_interactive()` requires stdin AND stdout to be
terminals. `has_stdin()` is left alone; the textual monitor asks a different
question with it.
The CLI default was `ask`, not `auto`, so the interactivity logic was never
even reached from a config-driven queue. Now `auto`.
And every same-named session counted as a conflict, including the leftovers of
a finished run -- which are the useful ones, since that is where you look to
see what failed without hunting logs. `session_is_busy()` now inspects panes: a
worker that finished is back at its shell prompt and its session is inert, so
it is reclaimed silently. Only a live foreground process prompts, and the
message prints `tmux attach` beside `tmux kill-session` because looking first
is usually the point. Unreadable panes count as busy -- the safe error is to
leave something alone rather than kill something that might be running.
`--non_interactive` lets a caller declare nobody is present: `auto` resolves to
`kill`, no prompt can appear, and the caller accepts that a running conflicting
session dies without being asked.
9 new tests; 86 pass, 6 skipped.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>