runPrefixSpinner ticks the prefix-spinner counter and forces a prompt redraw at ~4 Hz until spinnerDone closes. Exits cleanly on shutdown.
(spinnerDone <-chan struct{})
| 96 | // runPrefixSpinner ticks the prefix-spinner counter and forces a prompt |
| 97 | // redraw at ~4 Hz until spinnerDone closes. Exits cleanly on shutdown. |
| 98 | func (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 |
no test coverage detected