Skip to content

Commit 53fa465

Browse files
aknyshclaude
andcommitted
fix: prevent Bubble Tea spinner hang in non-TTY environments
Add TTY check before starting the Bubble Tea spinner to prevent potential hangs in CI environments where no terminal is available. The issue was that tea.Program.Run() could block indefinitely when trying to initialize the terminal in non-TTY environments like CI runners. This fix adds isTTY() check at the start of the spinner, similar to how info.go already handles TTY detection for its version fetch spinner. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 56a46ca commit 53fa465

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

toolchain/install_helpers.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,18 @@ type installResult struct {
2727
}
2828

2929
// startSpinner starts a spinner with the given message.
30+
// Spinner is only started if we're in a TTY environment.
3031
func (sc *spinnerControl) start(message string) {
3132
if !sc.showingSpinner {
3233
return
3334
}
3435

36+
// Don't start Bubble Tea spinner in non-TTY environments (CI, piped output).
37+
// This prevents potential hangs when tea.Program.Run() blocks on terminal init.
38+
if !isTTY() {
39+
return
40+
}
41+
3542
sc.program = runBubbleTeaSpinner(message)
3643
go func() {
3744
// Run spinner in background, ignore error since program is managed by quit channel.

0 commit comments

Comments
 (0)