Skip to content

project purge: unhelpful error when stdin is not a terminal #3599

@bug-ops

Description

@bug-ops

Description

zeph project purge without --dry-run or -y crashes with Error: IO error: not a terminal when stdin is not a TTY (pipe, CI, script context). The user receives no guidance on how to proceed.

Reproduction Steps

echo '' | cargo run --features full -- --config .local/config/testing.toml project purge

Expected Behavior

A clear message: e.g. Aborted: stdin is not a terminal. Use --dry-run to preview or -y to confirm non-interactively. with exit code 1.

Actual Behavior

Error: IO error: not a terminal

The error originates from dialoguer::Confirm::interact() which does not handle non-TTY stdin gracefully. The handler in src/commands/project.rs:230 propagates the error via ? with no user-friendly message.

Environment

  • Version: 0.20.1 (a030b2a)
  • Config: .local/config/testing.toml
  • Features: full

Logs / Evidence

printf '' | cargo run --features full -- --config .local/config/testing.toml project purge
Error: IO error: not a terminal

Suggested Fix

Catch the not a terminal error from dialoguer and return a user-facing message explaining that -y or --dry-run must be used in non-interactive contexts.

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexitybugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions