Skip to content

Don't show progress when CLI has no TTY#37

Merged
kevinmcconnell merged 1 commit intomainfrom
dont-show-progress-when-no-tty
Apr 2, 2026
Merged

Don't show progress when CLI has no TTY#37
kevinmcconnell merged 1 commit intomainfrom
dont-show-progress-when-no-tty

Conversation

@kevinmcconnell
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings April 2, 2026 16:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 deploy and update to use a shared runWithProgress(...) helper instead of constructing/running cliProgress directly.
  • 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.

Comment on lines +133 to +138
func isTerminal() bool {
fi, err := os.Stdout.Stat()
if err != nil {
return false
}
return fi.Mode()&os.ModeCharDevice != 0
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@kevinmcconnell kevinmcconnell merged commit 8ef0877 into main Apr 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants