Skip to content

fix: skip spinner in non-interactive terminals - #1059

Merged
cdalar merged 2 commits into
mainfrom
fix/spinner-non-interactive-tty
Aug 27, 2026
Merged

cdalar merged 2 commits into
mainfrom
fix/spinner-non-interactive-tty

Conversation

@cdalar

@cdalar cdalar commented Aug 27, 2026

Copy link
Copy Markdown
Owner

This PR fixes an issue where the spinner would attempt to open a TTY even in non-interactive environments (like CI), leading to the error: Error running spinner: could not open a new TTY: open /dev/tty: no such device or address. It now checks if the output is a terminal before starting the Bubble Tea program.

@cdalar
cdalar merged commit 7cdfce0 into main Aug 27, 2026
13 checks passed
@cdalar
cdalar requested a lite review from Copilot August 27, 2026 21:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

It adds an unrelated, likely-to-stale docs file and the non-terminal spinner path introduces an avoidable race by closing done asynchronously.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the internal/ui spinner wrapper to avoid starting a Bubble Tea spinner in non-interactive environments (e.g., CI) where opening a TTY can fail, and also adds a new documentation file.

Changes:

  • Skip starting the Bubble Tea spinner when os.Stderr is not a terminal.
  • Add docs/branches_report.md containing a snapshot-style inventory of remote branches.
File summaries
File Description
internal/ui/spinner.go Adds a terminal check to avoid starting Bubble Tea in non-interactive contexts.
docs/branches_report.md Adds a branch inventory document (not directly related to spinner behavior).
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/ui/spinner.go
Comment on lines +86 to +93
if !term.IsTerminal(int(os.Stderr.Fd())) {
s.isRunning = true
s.done = make(chan struct{})
go func() {
close(s.done)
}()
return
}
Comment thread docs/branches_report.md
Comment on lines +1 to +5
# Branch Report for origin

## Base
- `origin/main`: The primary stable branch containing the production-ready codebase.

cdalar pushed a commit that referenced this pull request Aug 27, 2026
It was added independently in commit 11ec412 ("docs: update branches
report (#1045)"), not by PR #1059 as this PR's earlier commit assumed —
deleting it here was based on mistaken provenance. Flagged by Codex
review.
cdalar added a commit that referenced this pull request Aug 27, 2026
fix: address PR #1059 review feedback on spinner
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

⌂ 换网址