on main help sign in
feat: allow to disable indeterminate progress bar (#2048)

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

commitc0a8c7e8219b39d47ab6400438b61ff2dd357164 authorCarlos Alexandro Becker <caarlos0@users.noreply.github.com> dateThu 29 Jan 2026, 15:33 (9 months ago) parent7643d6a
3 files changed+13−5
internal/app/app.go+5−2 internal/config/config.go+2−1 internal/ui/model/ui.go+6−2
internal/app/app.go+5−2
@@ -152,6 +152,7 @@ func (app *App) RunNonInteractive(ctx context.Context, output io.Writer, prompt,
152152 stdoutTTY bool
153153 stderrTTY bool
154154 stdinTTY bool
155+ progress bool
155156 )
156157
157158 if f, ok := output.(*os.File); ok {
@@ -160,6 +161,8 @@ func (app *App) RunNonInteractive(ctx context.Context, output io.Writer, prompt,
160161 stderrTTY = term.IsTerminal(os.Stderr.Fd())
161162 stdinTTY = term.IsTerminal(os.Stdin.Fd())
162163
164+ progress = app.config.Options.Progress == nil || *app.config.Options.Progress
165+
163166 if !quiet && stderrTTY {
164167 t := styles.CurrentTheme()
165168
@@ -244,7 +247,7 @@ func (app *App) RunNonInteractive(ctx context.Context, output io.Writer, prompt,
244247 messageReadBytes := make(map[string]int)
245248
246249 defer func() {
247− if stderrTTY {
250+ if progress && stderrTTY {
248251 _, _ = fmt.Fprintf(os.Stderr, ansi.ResetProgressBar)
249252 }
250253
@@ -254,7 +257,7 @@ func (app *App) RunNonInteractive(ctx context.Context, output io.Writer, prompt,
254257 }()
255258
256259 for {
257− if stderrTTY {
260+ if progress && stderrTTY {
258261 // HACK: Reinitialize the terminal progress bar on every iteration
259262 // so it doesn't get hidden by the terminal due to inactivity.
260263 _, _ = fmt.Fprintf(os.Stderr, ansi.SetIndeterminateProgressBar)
internal/config/config.go+2−1
@@ -257,7 +257,8 @@ type Options struct {
257257 Attribution *Attribution `json:"attribution,omitempty" jsonschema:"description=Attribution settings for generated content"`
258258 DisableMetrics bool `json:"disable_metrics,omitempty" jsonschema:"description=Disable sending metrics,default=false"`
259259 InitializeAs string `json:"initialize_as,omitempty" jsonschema:"description=Name of the context file to create/update during project initialization,default=AGENTS.md,example=AGENTS.md,example=CRUSH.md,example=CLAUDE.md,example=docs/LLMs.md"`
260− AutoLSP *bool `json:"auto_lsp,omitempty" jsonschema:"description=Automatically setup LSPs based on root markers"`
260+ AutoLSP *bool `json:"auto_lsp,omitempty" jsonschema:"description=Automatically setup LSPs based on root markers,default=true"`
261+ Progress *bool `json:"progress,omitempty" jsonschema:"description=Show indeterminate progress updates during long operations,default=true"`
261262}
262263
263264type MCPs map[string]MCPConfig
internal/ui/model/ui.go+6−2
@@ -144,7 +144,8 @@ type UI struct {
144144
145145 // sendProgressBar instructs the TUI to send progress bar updates to the
146146 // terminal.
147− sendProgressBar bool
147+ sendProgressBar bool
148+ progressBarEnabled bool
148149
149150 // caps hold different terminal capabilities that we query for.
150151 caps common.Capabilities
@@ -295,6 +296,9 @@ func New(com *common.Common) *UI {
295296 // set initial state
296297 ui.setState(desiredState, desiredFocus)
297298
299+ // disable indeterminate progress bar
300+ ui.progressBarEnabled = com.Config().Options.Progress == nil || *com.Config().Options.Progress
301+
298302 return ui
299303}
300304
@@ -1854,7 +1858,7 @@ func (m *UI) View() tea.View {
18541858 content = strings.Join(contentLines, "\n")
18551859
18561860 v.Content = content
1857− if m.sendProgressBar && m.isAgentBusy() {
1861+ if m.progressBarEnabled && m.sendProgressBar && m.isAgentBusy() {
18581862 // HACK: use a random percentage to prevent ghostty from hiding it
18591863 // after a timeout.
18601864 v.ProgressBar = tea.NewProgressBar(tea.ProgressBarIndeterminate, rand.Intn(100))