Skip to content

Release v2.2.0#5344

Merged
tig merged 8 commits into
mainfrom
release/v2.2.0
May 19, 2026
Merged

Release v2.2.0#5344
tig merged 8 commits into
mainfrom
release/v2.2.0

Conversation

@tig
Copy link
Copy Markdown
Member

@tig tig commented May 19, 2026

Release v2.2.0

Version: 2.2.0
NuGet Package: Terminal.Gui 2.2.0

What happens when this PR is merged

  1. ✅ The Finalize Release workflow will automatically create tag v2.2.0
  2. ✅ The Publish workflow will build and push to NuGet.org
  3. ✅ A GitHub Release will be created with auto-generated notes
  4. ✅ A back-merge PR from maindevelop will be opened

Checklist

  • CI passes on this PR
  • Version looks correct: 2.2.0
  • Release notes reviewed (will be auto-generated on merge)

tig and others added 8 commits May 18, 2026 13:21
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>
AppTestHelper.AssertAnsiSnapshot + make ToAnsi platform-independent
@tig tig merged commit 2c9c967 into main May 19, 2026
15 checks passed
@tig tig deleted the release/v2.2.0 branch May 19, 2026 12:26
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