← Back to issue list

cli: do not prompt when there is no tty available on stdin

View original Github issue

Metadata

Project
snapcraft
Number
#2570
Type
pull request
State
merged
Author
mvo5
Labels
Created
Updated
Closed

Current evaluation

Merged PR #2570 prevents interactive prompts when stdin lacks a TTY, fixing CI hangs. Scripts now fail early instead of blocking on LXD setup. Approved by two reviewers and merged into master.

Suggested action:

No scores available.

Issue body

This is a bit of a drive-by. I noticed that inside travis snapcraft 3 hangs with the following message: ``` Support for 'LXD' needs to be set up. Would you like to do that it now? [y/N]: ``` It seems like we should only prompt here if stdin is attached to a tty and otherwise just fail early. This should fix hangs in e.g. scripts.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged PR #2570 prevents interactive prompts when stdin lacks a TTY, fixing CI hangs. Scripts now fail early instead of blocking on LXD setup. Approved by two reviewers and merged into master.
qwen3.6-35b-a3b-mtp-q6 Merged. Prevents CLI hangs in non-interactive environments by skipping prompts when stdin lacks a TTY. Author granted maintainer permission to centralize the change. Resolves Travis CI hangs during LXD setup prompts.
qwen3.6-35b-a3b-mtp-q6 Merged into master. Prevents CLI hangs in CI by skipping interactive prompts when stdin lacks a TTY. The maintainer accepted the change and suggested centralizing the TTY check logic in indicators.py.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#424 providers: prompt user to install LXD if not installed (CRAFT-335) charmcraft merged Merged after two approvals and passing CI. Adds logic to prompt users to install LXD when missing, skipping non-interactive TTYs. Resolves CRAFT-335 with 88 additions and 24 deletions across two files.
71%