Commit efecf4b
committed
ui: erase spinner line before redraw, hide cursor during animation
Two more sources of primary-bar flicker:
1. The spinner library writes \r+content without erasing the line
first. When the label shrinks (e.g. [10/10] -> [1/1]), leftover
characters from the previous longer frame remain visible for one
tick. Fix: replace the leading \r in Write with \r\033[2K so
the line is always cleared before the new frame is painted.
2. The cursor is visible during animation and its per-tick
repositioning creates visual noise, especially in terminals with
slower cursor rendering. Fix: hide the cursor in startAnimator
(\033[?25l) and restore it unconditionally in stopAnimator
(\033[?25h), so it stays hidden for exactly the duration of the
animation and can't be left permanently invisible if the process
exits early.1 parent 4d63793 commit efecf4b
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
393 | 397 | | |
394 | 398 | | |
395 | 399 | | |
| |||
502 | 506 | | |
503 | 507 | | |
504 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
505 | 515 | | |
506 | 516 | | |
507 | 517 | | |
| |||
542 | 552 | | |
543 | 553 | | |
544 | 554 | | |
| 555 | + | |
| 556 | + | |
545 | 557 | | |
546 | 558 | | |
547 | 559 | | |
| |||
0 commit comments