Release v2.2.0#5344
Merged
Merged
Conversation
Back-merge v2.2.0-rc.3 from main into develop
Back-merge v2.2.0-rc.4 from main into develop
AppTestHelper already had AnsiScreenShot (dump ToAnsi() to a writer) but no way to *assert* the look. AssertAnsiSnapshot records the screen as pure ANSI (IDriver.ToAnsi() — truecolor/bold/reverse/blink/layout, excluding the non-deterministic terminal cursor) into a __snapshots__/<name>.ans golden on first run, then compares byte-for-byte. The .ans file IS the look: `cat <name>.ans` reproduces the screen in any truecolor terminal. On mismatch it writes a sibling .ans.actual and throws with the plain-text render inline plus the `cat` commands, so a CI log or an agent can verify the look without an interactive run. UPDATE_SNAPSHOTS=1 accepts an intended change; SNAPSHOT_DIR overrides the golden root. The exception type is framework-agnostic (no xunit dependency in AppTestHelpers). *.ans is marked binary in .gitattributes — they are CRLF escape blobs and core.autocrlf would corrupt the compare and `cat`. Prototyped in gui-cs/Editor's integration suite (used there to verify multi-caret/column-selection rendering); upstreaming the reusable core. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/d81858b1-5067-4b78-8173-6aeebfab7243 Co-authored-by: tig <585482+tig@users.noreply.github.com>
OutputBase.ToAnsi / BuildAnsiForRegion separated rows with StringBuilder.AppendLine () == Environment.NewLine, so the "recreate the screen" ANSI stream was CRLF on Windows and LF on Linux/macOS. That makes ToAnsi output non-portable: golden snapshots or cross-platform diffs recorded on one OS never match another (the failure that surfaced this). ToAnsi is a portable representation, not the live render path (real output goes through Write/WriteToConsole, untouched here). Emit a fixed '\n' for row breaks in both the ANSI and legacy-console paths. Terminals map LF->CRLF via the ONLCR tty discipline, so `cat`/recreate fidelity is unchanged. Two OutputBaseTests assertions hard-coded "<g>" + Environment.NewLine — they encoded the bug; updated to "<g>\n". Audited every other ToAnsi consumer (ToAnsiTests splits on ['\r','\n']; OutputBase/Transparent/ Subview/Link/MenuBar tests use Contains on text/escapes) — none depended on the platform newline; all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/83b38eb7-83e4-4424-bc70-0d1413287f9c Co-authored-by: tig <585482+tig@users.noreply.github.com>
AppTestHelper.AssertAnsiSnapshot + make ToAnsi platform-independent
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.
Release v2.2.0
Version:
2.2.0NuGet Package:
Terminal.Gui 2.2.0What happens when this PR is merged
v2.2.0main→developwill be openedChecklist
2.2.0