MCPcopy Create free account
hub / github.com/diillson/chatcli / runPrefixSpinner

Method runPrefixSpinner

cli/cli_llm.go:98–110  ·  view source on GitHub ↗

runPrefixSpinner ticks the prefix-spinner counter and forces a prompt redraw at ~4 Hz until spinnerDone closes. Exits cleanly on shutdown.

(spinnerDone <-chan struct{})

Source from the content-addressed store, hash-verified

96// runPrefixSpinner ticks the prefix-spinner counter and forces a prompt
97// redraw at ~4 Hz until spinnerDone closes. Exits cleanly on shutdown.
98func (cli *ChatCLI) runPrefixSpinner(spinnerDone <-chan struct{}) {
99 ticker := time.NewTicker(250 * time.Millisecond)
100 defer ticker.Stop()
101 for {
102 select {
103 case <-spinnerDone:
104 return
105 case <-ticker.C:
106 atomic.AddInt32(&cli.prefixSpinnerIdx, 1)
107 cli.forceRefreshPrompt()
108 }
109 }
110}
111
112// endProcessingLifecycle reverses startProcessingLifecycle, then drains any
113// message the user queued while the prior turn was running. The recursive

Callers 2

chatAskFollowupMethod · 0.95

Calls 2

forceRefreshPromptMethod · 0.95
StopMethod · 0.65

Tested by

no test coverage detected