Run updates the screen. It should be run in a separate goroutine. When ctx is cancelled, the status lines are cleanly removed.
(ctx context.Context)
| 195 | // Run updates the screen. It should be run in a separate goroutine. When |
| 196 | // ctx is cancelled, the status lines are cleanly removed. |
| 197 | func (t *Terminal) Run(ctx context.Context) { |
| 198 | defer close(t.closed) |
| 199 | if t.canUpdateStatus { |
| 200 | t.run(ctx) |
| 201 | return |
| 202 | } |
| 203 | |
| 204 | t.runWithoutStatus(ctx) |
| 205 | } |
| 206 | |
| 207 | // run listens on the channels and updates the terminal screen. |
| 208 | func (t *Terminal) run(ctx context.Context) { |