Skip to content

fix(terminal): preserve semantic coloring across wraps and scrolling - #809

Merged
AnalyseDeCircuit merged 2 commits into
AnalyseDeCircuit:mainfrom
BilityLeu:lz/fix-semantic-coloring-wrap-scroll
Nov 17, 2026
Merged

AnalyseDeCircuit merged 2 commits into
AnalyseDeCircuit:mainfrom
BilityLeu:lz/fix-semantic-coloring-wrap-scroll

Conversation

@BilityLeu

@BilityLeu BilityLeu commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Soft-wrapped output could change semantic colors as the viewport moved because classification lost off-screen logical-line context. This change captures complete wrapped-line context and maps classifications back to visible cells, including wide and combining characters, smooth-scroll overscan, and folded views.

Unchanged contexts reuse snapshot-owned, zeroizing text after validating row identities, content revisions, and wrap boundaries. Layout cache hits skip classification; oversized classifications remain transient without clearing ordinary cached entries. Span eviction is incremental, and candidate overlap checks avoid quadratic scans on long output.

Validation:

  • Grid: 156 unit tests, 45 reference tests, and 1 doctest passed.
  • Terminal core: 253 passed; 4 existing ignored tests.
  • GPUI terminal: 258 passed in the full serial run. An initial parallel run had a resize timing failure; its focused rerun and the full serial run passed.
  • The final smooth-scroll source-generation regression test passed after keeping the request dimensions unchanged across the content edit.
  • Application compile check passed using gpui-pre-apple/runtime_shaders; workspace-wide cargo fmt --check and git diff --check passed. Includes formatting-only fixes in four oxideterm-ai files to unblock the CI formatting gate.
  • Native terminal manual acceptance passed, as reported by the tester.

Local performance measurements: an unchanged 2.4 MB wrapped-line snapshot dropped from approximately 8–9 ms to 0.09 ms; scrolling snapshots measured approximately 0.23 ms. Input parsing and end-to-end write benchmarks remained broadly stable in quick samples.

A trial merge against the current upstream main completed without conflicts.

@AnalyseDeCircuit
AnalyseDeCircuit merged commit 531bfc7 into AnalyseDeCircuit:main Nov 17, 2026
5 checks passed
@BilityLeu
BilityLeu deleted the lz/fix-semantic-coloring-wrap-scroll branch November 17, 2026 12:19
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