Skip to content

fix(engine): don't classify CR-terminated documents as terminal output - #1303

Closed
daniexit wants to merge 2 commits into
JuliusBrussee:mainfrom
daniexit:fix-cr-terminated-terminal-detect
Closed

daniexit wants to merge 2 commits into
JuliusBrussee:mainfrom
daniexit:fix-cr-terminated-terminal-detect

Conversation

@daniexit

Copy link
Copy Markdown
Contributor

A payload with no ANSI escape, no LF, and multiple bare CRs is a classic-Mac text document, not a progress redraw. It was classified as terminal, and collapseCarriageReturns then kept only the last line. Require an ANSI escape or at least one LF for the bare-CR heuristic.

Refs #1294

daniexit and others added 2 commits October 16, 2026 13:25
A payload with no ANSI escape, no LF, and multiple bare CRs is a
classic-Mac text document, not a progress redraw. It was classified as
terminal, and collapseCarriageReturns then kept only the last line.
Require an ANSI escape or at least one LF for the bare-CR heuristic.

Refs JuliusBrussee#1294

Signed-off-by: daniexit <daniexit@users.noreply.github.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: daniexit <daniexit@users.noreply.github.com>
@JuliusBrussee

Copy link
Copy Markdown
Owner

Thanks @daniexit, verified: TestDetectTerminal/cr-only_3+_lines_classic_mac_not_terminal fails on main and passes here. Adopted into #1309 with your authorship. One follow-up test commit there: the pipeline test now checks that every CR-terminated line survives, not only the content type. Your empty ci: re-run perf gate commit was left out. Landed in #1309; closing.

The same document with one trailing \n still collapses, because it has exactly the shape of a progress-bar redraw. That needs a terminal-compressor change (option 3 in #1294), so #1294 stays open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants