TestShimWaitsPastSavedUsage/refreshed went red on macOS CI at 7583ed65c
(run 43313397426): the shim told the figures of the "Refreshing…"
screen, the ones Claude Code saved, as today's.
The look of the panel kept while "Refreshing…" was on screen stayed
kept after Claude Code cleared the screen to draw the refreshed panel.
When that redraw stalled a second after its clear, as on a loaded
runner or a busy machine, the screen no longer said "Refreshing…", the
kept look counted as figures, the screen had stood still for
commandSettle, and the saved figures were told.
Now a look saying "Refreshing…" is not kept, the looks kept before it
are dropped once it is drawn, and after it only the screen as it is now
(or a look kept since) counts as figures or as the panel drawn.
Run on mote:
- the new subtest "refreshed after a stall" (the fake clears the screen,
then waits 2s before the figures) on the old tui.go: red with CI's
exact output (8% / Nov 8 told as today's)
- with the fix: go test -count=3 -run 'TestShimWaitsPastSavedUsage|
TestShim.*Usage' ./internal/claudetui ok; go test ./internal/claudetui
ok; go vet for darwin, windows and linux ok; gofmt -l clean
Not tried: a real Claude Code /usage that refreshes; Windows' pseudo
console run of the package.
Fixes#6376