-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Description
openfang init panics when run in a non-TTY environment (e.g., CI pipelines, IDE integrated terminals, or agent automation contexts). The panic originates from ratatui's terminal initialization.
Environment
- OS: macOS (Darwin arm64, Apple Silicon)
- OpenFang version: 0.3.26
- Installation method:
curl -fsSL https://openfang.sh/install | sh
Steps to Reproduce
- Install OpenFang
- Run
openfang initin a non-TTY context (e.g., piped stdin, or a subprocess without a real terminal):
echo "" | openfang initError Output
thread 'main' (4583951) panicked at /Users/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ratatui-0.29.0/src/terminal/init.rs:52:16:
failed to initialize terminal: Os { code: 6, kind: Uncategorized, message: "Device not configured" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expected Behavior
openfang init should either:
- Detect the non-TTY environment and fall back to non-interactive mode automatically, or
- Print a helpful error message suggesting the user run
openfang setup --quickinstead
Actual Behavior
Hard panic with a Rust stack trace. Exit code 101.
Workaround
Use openfang setup --quick which works correctly in non-TTY environments.
Suggestion
A simple isatty(stdin) / isatty(stdout) check before initializing ratatui would prevent the panic and improve the experience for headless/automated deployments.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels