fix(ui): open the test 7 settings screen only on a real terminal

The screen was gated on raw-mode availability alone, so `-t 7` with stdout
redirected (`> out.txt`, `| tee`) still painted it and then waited forever for a
keypress nobody could send. It now requires a terminal on both ends — stdin to
answer it and stdout to draw it — and falls back to the CLI flags otherwise,
which is what `--burst`/`--burst-timeout`/`--burst-profiles` are for.

Found by the release smoke test: the piped run hung until the harness deadline.
This commit is contained in:
Kirill Minovsky 2026-09-13 20:02:56 +03:00
parent 91ee980ee8
commit 24512b9731
3 changed files with 12 additions and 7 deletions

4
Cargo.lock generated
View file

@ -516,7 +516,7 @@ dependencies = [
[[package]]
name = "dpi-core"
version = "5.0.0-alpha.9"
version = "5.0.0-alpha.10"
dependencies = [
"base64",
"bytes",
@ -543,7 +543,7 @@ dependencies = [
[[package]]
name = "dpi-detector"
version = "5.0.0-alpha.9"
version = "5.0.0-alpha.10"
dependencies = [
"clap",
"comfy-table",

View file

@ -15,7 +15,7 @@ exclude = ["vendor/rustls"]
rustls = { path = "vendor/rustls" }
[workspace.package]
version = "5.0.0-alpha.9"
version = "5.0.0-alpha.10"
edition = "2021"
authors = ["runnin"]
license = "MIT"

View file

@ -652,10 +652,15 @@ async fn main() {
// Test 7 is destructive for its targets, so it asks for its own settings
// screen before it runs instead of starting with guesses: cancelling the
// screen drops test 7 from the selection and runs the rest. The screen
// belongs to the test itself, so an explicit `-t 7` on a terminal gets it
// too, not only the menu path; where raw mode is unavailable (pipes,
// legacy consoles) the CLI flags stand in for it and the test still runs.
if !args.json && selection.contains('7') && tui_available() {
// belongs to the test itself, so an explicit `-t 7` gets it too — but
// only on a terminal at both ends: with stdin or stdout redirected there
// is nobody to answer the screen, and the CLI flags stand in for it.
let settings_screen = !args.json
&& selection.contains('7')
&& std::io::stdin().is_terminal()
&& std::io::stdout().is_terminal()
&& tui_available();
if settings_screen {
// The screen always opens with an empty field: prefilling the last
// target made a fresh run append to it, so an edited domain looked
// ignored. Empty means "the CLI/config list", and the count of that