Add ANSI.replay to collapse captured repaints - #623
Merged
Conversation
GoodForOneFare
force-pushed
the
gordo-ansi-replay
branch
3 times, most recently
from
August 12, 2026 17:34
31d9039 to
3189348
Compare
GoodForOneFare
changed the base branch from
main
to
gordo-expand-csi-stripping
August 12, 2026 17:40
GoodForOneFare
force-pushed
the
gordo-ansi-replay
branch
from
August 12, 2026 18:34
dbb5a0f to
e8f219e
Compare
GoodForOneFare
force-pushed
the
gordo-expand-csi-stripping
branch
from
August 12, 2026 19:00
1cb093c to
a833fef
Compare
GoodForOneFare
force-pushed
the
gordo-ansi-replay
branch
from
August 12, 2026 19:01
e8f219e to
0bad26e
Compare
GoodForOneFare
force-pushed
the
gordo-expand-csi-stripping
branch
from
August 12, 2026 19:08
a833fef to
7760ee3
Compare
GoodForOneFare
force-pushed
the
gordo-ansi-replay
branch
from
August 12, 2026 19:09
0bad26e to
771ad1e
Compare
GoodForOneFare
force-pushed
the
gordo-expand-csi-stripping
branch
from
August 12, 2026 19:30
7760ee3 to
d92d828
Compare
GoodForOneFare
force-pushed
the
gordo-ansi-replay
branch
from
August 12, 2026 19:31
771ad1e to
ac89611
Compare
GoodForOneFare
force-pushed
the
gordo-expand-csi-stripping
branch
from
August 12, 2026 20:58
d92d828 to
5ce45be
Compare
GoodForOneFare
force-pushed
the
gordo-ansi-replay
branch
2 times, most recently
from
August 13, 2026 11:19
01198dc to
965643e
Compare
GoodForOneFare
force-pushed
the
gordo-expand-csi-stripping
branch
from
August 13, 2026 11:19
5ce45be to
5cc704f
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tl;dr - add
ANSI.replaythat removes noise from log files piped fromcli-uioutput.Spinners and progress bars repaint by moving the cursor, so a capture of the stream (a log file, StdoutRouter's duplicate output, test output) holds one frame per tick. ANSI.strip_codes deletes those control sequences instead of applying them, which leaves every frame side by side rather than overwriting: \r disappears, and CSI_SEQUENCE matches neither the parameterless (\e[K) nor the private (\e[?25l) forms, so those survive as text.
ANSI.replay applies the stream's viewport-independent controls -- CR/LF/BS, relative cursor moves, erase-line, insert/delete-line, cursor save/restore -- to a line grid and returns the text the repaints settled on. Presentation sequences and control-string payloads (OSC, DCS) are dropped, as a terminal drops them, and so are operations that assume a viewport (absolute positioning, display erasure): a capture does not record scrolling, so a screen coordinate has no buffer row to map onto. Shopify's dev CLI attaches its
dev uplog to error reports, where a 450KB capture replays to 41KB of what the developer actually saw.There is no viewport: a capture has no scrollback to lose, so height is unbounded and cursor moves, gap padding and insert-line are capped instead. Only rows a control sequence conjures count against that cap, so an ordinary long capture never exhausts it.