Don't show progress when CLI has no TTY#37
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the CLI deploy/update flows to avoid running the Bubble Tea progress UI when the process doesn’t have a TTY, falling back to a non-interactive execution path.
Changes:
- Refactors
deployandupdateto use a sharedrunWithProgress(...)helper instead of constructing/runningcliProgressdirectly. - Adds
runWithProgress(...)with a TTY check to decide between Bubble Tea UI vs. a no-op progress callback execution. - Minor refactor in
cli_progress.go(imports and grouped message types).
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/command/update.go | Switches update to use runWithProgress wrapper. |
| internal/command/deploy.go | Switches deploy to use runWithProgress wrapper. |
| internal/command/cli_progress.go | Introduces runWithProgress and TTY detection helper to skip TUI when non-interactive. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func isTerminal() bool { | ||
| fi, err := os.Stdout.Stat() | ||
| if err != nil { | ||
| return false | ||
| } | ||
| return fi.Mode()&os.ModeCharDevice != 0 |
There was a problem hiding this comment.
isTerminal() only checks whether stdout is a character device. That can return true even when there’s no usable TTY for interactive Bubble Tea input (e.g., stdin is redirected), so progress UI may still be started in non-interactive contexts.
Consider using the existing github.com/charmbracelet/x/term dependency and requiring both stdin and stdout to be terminals (or checking for a controlling TTY via /dev/tty where applicable) before enabling the TUI.
No description provided.