interactive mode has no escape hatch, hangs pty-based automation #607

Closed
opened 2026-08-08 11:40:51 +00:00 by the.auditor · 2 comments
Owner

interactive.Enabled gates on stdin AND stdout both being terminals (internal/tpagectl/interactive/interactive.go). Pty-based automation (script, expect, CI executors that allocate a pty, tmux, ssh -t) satisfies both, so a command invoked without a required value now blocks on an interactive prompt where it previously failed fast.

Before: tpagectl site get with no site arg under a pty → instant site name is required (exit 5). After: the fuzzy picker renders and waits for input — scripts hang or consume garbage.

Add an explicit override: e.g. TPAGECTL_INTERACTIVE=0 / --no-interactive, or disable interactive when CI/TERM=dumb is set.

See #606

`interactive.Enabled` gates on stdin AND stdout both being terminals (`internal/tpagectl/interactive/interactive.go`). Pty-based automation (`script`, `expect`, CI executors that allocate a pty, tmux, `ssh -t`) satisfies both, so a command invoked without a required value now blocks on an interactive prompt where it previously failed fast. Before: `tpagectl site get` with no site arg under a pty → instant `site name is required` (exit 5). After: the fuzzy picker renders and waits for input — scripts hang or consume garbage. Add an explicit override: e.g. `TPAGECTL_INTERACTIVE=0` / `--no-interactive`, or disable interactive when `CI`/`TERM=dumb` is set. See https://git.lan.thwap.org/thwap/thwap-pagesd/pulls/606
Owner

why would you be using interactive mode for pty based automation?

why would you be using interactive mode for pty based automation?
Author
Owner

Resolved by discussion. Properly written scripts pass required values via CLI args and never enter interactive mode; the gate only activates for genuine interactive terminal use. The pty + missing-arg combination only affects already-broken scripts, which previously failed fast (exit 5) and now would block — a failure-mode change for a broken-script edge, not a real automation path. Not worth an escape hatch. Closing as not-actionable.

Resolved by discussion. Properly written scripts pass required values via CLI args and never enter interactive mode; the gate only activates for genuine interactive terminal use. The pty + missing-arg combination only affects already-broken scripts, which previously failed fast (exit 5) and now would block — a failure-mode change for a broken-script edge, not a real automation path. Not worth an escape hatch. Closing as not-actionable.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd#607
No description provided.