Skip to content

Release v2.4.7#5501

Merged
tig merged 79 commits into
mainfrom
release/v2.4.7
Jun 19, 2026
Merged

Release v2.4.7#5501
tig merged 79 commits into
mainfrom
release/v2.4.7

Conversation

@tig

@tig tig commented Jun 19, 2026

Copy link
Copy Markdown
Member

Release v2.4.7

Version: 2.4.7
NuGet Package: Terminal.Gui 2.4.7

What happens when this PR is merged

  1. ✅ The Finalize Release workflow will automatically create tag v2.4.7
  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.4.7
  • Release notes reviewed (will be auto-generated on merge)

tig and others added 30 commits April 8, 2026 13:37
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix indentation of the Margin.ThicknessChanged handler body and factor
the duplicated viewport-size formula out of
GetViewportForAdornmentThickness and GetViewportFrameForAdornmentThickness
into a shared GetViewportSizeForThickness helper.

No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Back-merge v2.4.4 from main into develop
Bumps TextMateSharp from 2.0.3 to 2.0.4
Bumps TextMateSharp.Grammars from 2.0.3 to 2.0.4

---
updated-dependencies:
- dependency-name: TextMateSharp
  dependency-version: 2.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: TextMateSharp.Grammars
  dependency-version: 2.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
---
updated-dependencies:
- dependency-name: Spectre.Console
  dependency-version: 0.56.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…out-deltas

Fixes #5434. Track adornment thickness deltas so LayoutAndDraw can stop force-drawing
DrawSubViews() now skips drawing an Overlapped sibling when it is entirely
covered by the higher-Z opaque peers already drawn. Such a sibling produces
no visible output — every cell it would draw, including its own
RenderLineCanvas, is clipped away by the clip "holes" those peers punched in
DoDrawComplete — so skipping its Draw is output-neutral. The culled view's
NeedsDraw is cleared (mirroring a drawn-but-fully-clipped pass) so it does not
keep the SuperView perpetually dirty.

Culling is intentionally conservative — it only applies to a candidate that
is itself Overlapped, opaque (content/Border/Padding not Transparent), without
a Margin shadow, and NOT SuperViewRendersLineCanvas. The last guard is what
keeps Tabs correct: tab pages render their borders (and headers) through the
SuperView's LineCanvas painters'-algorithm composition, so they must never be
culled or their header line art would be dropped. The whole check is gated on
the presence of an Overlapped sibling, keeping the common non-overlapping draw
path zero-overhead.

Opaque coverage is the region inside a view's (transparent-by-default) Margin —
the Border frame — which matches the area DoDrawComplete excludes from the clip.

Adds OcclusionCullingTests covering: fully-occluded cull, NeedsDraw clearing,
partial coverage, transparent occluder, transparent candidate, shadowed
candidate, SuperViewRendersLineCanvas candidate, non-Overlapped candidate, the
no-Overlapped-siblings gate, output-neutrality, and a Tabs regression that
inactive pages are never culled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The cull path skips Draw()/DoDrawComplete(), which repopulates a view's
CachedDrawnRegion for ViewportSettingsFlags.TransparentMouse layers. That
region is invalidated by SetNeedsDraw(), so culling an opaque TransparentMouse
view left it with a null cache and dropped it from mouse hit-testing
(GetViewsUnderLocation blanket-removes TransparentMouse views with a null
cache) — a state divergence from the drawn-but-clipped path the cull is meant
to mirror.

Add ParticipatesInTransparentMouseHitTesting() and exclude such candidates:
the view's own ViewportSettings, plus any adornment that is TransparentMouse
with non-empty Thickness (adornment caches survive SetNeedsDraw(), but the
first draw must still populate a thick transparent-mouse adornment's cache).
Margin is TransparentMouse by default, so this only excludes views with an
actual Margin thickness — the common empty-margin overlapped view is still
culled.

Adds regression tests: TransparentMouseCandidate_IsNotCulled_AndKeepsHitRegion
(fails without the guard — CachedDrawnRegion is null) and
TransparentMouseMarginCandidate_IsNotCulled.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… and tuirec verification guidance (#5478)

* Fix inconsistencies in AI agent instruction files

- Local function naming: camelCase -> PascalCase in REFRESH.md and
  copilot-instructions.md (matches .editorconfig local_functions_rule,
  AGENTS.md, and event-patterns.md)
- Replace stale Tests/UnitTests references with current project names
  (UnitTestsParallelizable / UnitTests.NonParallelizable) across
  AGENTS.md, CONTRIBUTING.md, .aider.md, .cursorrules, .windsurfrules,
  copilot-instructions.md, and .claude workflows/tasks
- Replace deprecated --filter "FullyQualifiedName~" syntax with xUnit v3
  MTP --filter-method/--filter-class in copilot-instructions.md
- Remove machine-local path (D:\s\...) from AGENTS.md planning section
- build-app.md: use Accepted (post-event) for fire-and-forget handlers
  per event-patterns.md; show Accepting only for cancellation; fix
  v1-style new Button ("OK") to v2 object initializer
- build-test-workflow.md: .NET SDK 8.0 -> 10.0.100 per global.json

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Add agent docs lint, tuirec verification guidance, promote local memories

- Add Scripts/lint-agent-docs.ps1 + lint-agent-docs.yml CI workflow: fails
  when known rot patterns reappear in agent instruction files (stale test
  project names, machine-local paths, camelCase local-function guidance,
  deprecated FullyQualifiedName~ filter syntax, SDK version drift vs
  global.json). The lint immediately caught a stale .NET SDK 8.0 claim in
  CONTRIBUTING.md, now fixed.
- Wire tuirec into agent entry points (CLAUDE.md, AGENTS.md, build-app.md):
  agents can verify TUI behavior by recording with tuirec and reading the
  asciinema .cast output back as text, per Scripts/tuirec/README.md.
- Promote durable guidance from machine-specific .claude/projects/ memory
  files into shared rules (.claude/rules/logging-tracing.md and
  fragile-areas.md); untrack .claude/projects/ and gitignore it (the
  directory name encoded a local user path).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Document Windows ConPTY sixel limitation in tuirec README

Discovered while verifying the About Box fire animation: ConPTY strips
sixel DCS and the DA1 sixel handshake, so sixel content cannot be
captured in tuirec recordings on Windows (apps detect Sixel support:
False). Added to the troubleshooting table and validation checklist so
the next agent does not burn recordings rediscovering it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* tuirec README: require measuring grid-anchored sixels, not eyeballing

Agents (including me) recurrently verify the wrong invariant when checking
sixel recordings: confirming the sixel appears, or that agg rendered it
faithfully at the requested cursor cell, and calling it done. That misses
size/position errors — notably the ~4% undersize from tuirec advertising a
cell resolution that does not match agg's rendered font cell (tuirec #84).

Adds a "Verifying Placement and Size (measure - don't eyeball)" section with
the cell-calibration recipe (measure agg's real cell from a known grid
reference; reconcile against the resolution the app used; confirm the
rendered bbox covers the target region), a checklist item, a troubleshooting
row for #84, and rewrites the workflow's "visual confirm" step to require
measurement for grid-anchored content. Also states the general principle:
verify the invariant the change was meant to satisfy, not a proxy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Sync CONTRIBUTING.md TFM to net10.0; lint stale TFMs

Codex review on #5478 flagged that build-test-workflow.md cites
CONTRIBUTING.md as its source of truth, but CONTRIBUTING.md still
described the project as net8.0 (line 28) even though the Required Tools
section was updated to .NET 10 — so the declared source could revert the
fix and mislead readers onto the wrong toolchain.

Test-first: added Rule 6 to lint-agent-docs.ps1 that derives the expected
target-framework moniker from global.json's SDK major and fails on any
mismatched `net<major>.0` reference. It flagged CONTRIBUTING.md:28
(net8.0); fixed that to `C# 14 (net10.0)`. Lint now passes (32 files).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
…5480)

* Add doc snippet compile validation with obsolete-API rejection

Roslyn-based validator that compiles every fenced C# block in the agent
docs (ai-v2-primer.md, build-app.md, common-patterns.md) against the built
Terminal.Gui assembly, so example rot fails CI instead of misleading
readers. Statement fragments are wrapped in a Runnable<string?> harness;
blocks marked WRONG / `snippet: ignore` are skipped.

Obsolete-API use (CS0618/CS0612) is treated as a failure, not a warning,
so v1 rot like the legacy static Application.Init cannot pass as
"compiled". testdata/obsolete-api.md + a CI negative-test step assert the
validator rejects obsolete APIs. The check caught real rot fixed here:
two cookbook snippets used the obsolete TextView (now a plain content
View, pointing at gui-cs/Editor's EditorView).

Result: 29 compiled, 1 skipped, 0 failed; negative test green.

Rebased onto develop after #5478 merged (squash), keeping only this PR's
files; no overlap with the merged agent-docs lint changes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix Validate Doc Snippets CI: full history for GitVersion

The workflow built Terminal.Gui without fetch-depth:0, so GitVersion.MsBuild
failed on the shallow clone ("Repository is a shallow clone"). Match the
build-validation workflow's checkout (fetch-depth: 0).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Fixes #5360. Cull fully occluded overlapped opaque subviews during draw
Dispatches `terminal-gui-published` (payload: the published SemVer) to
gui-cs/Editor after each publish. Editor's bump-terminal-gui.yml picks it
up, pins the new version, validates with its full test suites, and
republishes Editor against it - making Editor a continuous canary for TG
API churn (see Editor specs/decisions.md DEC-010).

No-op until an EDITOR_DISPATCH_TOKEN secret (PAT with repo scope on
gui-cs/Editor) is configured; Editor also polls NuGet on a 6h schedule as
a fallback, so nothing breaks without it.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
The Editor-notify guard from #5483 used `if: secrets.X != ''`, which is
not an available context for step ifs and invalidated the whole workflow
(publish run 27422643812). Mirror the secret into job-level env and gate
on that, same pattern as the TEMPLATE/clet dispatches in gui-cs/Editor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---
updated-dependencies:
- dependency-name: Spectre.Console
  dependency-version: 0.57.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The Progress scenario crashed on exit when the System.Timer ("threads")
demo was running. The timer callback runs on a thread-pool thread and
calls IApplication.Invoke; once the application is disposed, Invoke throws
NotInitializedException, which is unhandled on a thread-pool thread and
terminates the process.

The timer was only stopped in Scenario.Dispose, which runs after Main()
returns - i.e. after the `using` application and window have already been
disposed. Because View.Dispose empties SubViews, the Dispose-time
`_win.SubViews.OfType<ProgressDemo>()` cleanup loop iterated nothing, so
the timer was never stopped and kept firing on the disposed application.

Fix:
- Stop the timers in win.IsRunningChanged (fired during the stop sequence,
  while the application is still initialized), matching the pattern used by
  ProgressBarStyles.
- Guard the timer callback so it only calls Invoke while the application is
  initialized (defense-in-depth; honors the existing "must be defensive"
  comment).
- Replace the broken Dispose cleanup (which reached into the already-disposed
  window) with a direct timer-disposal backstop.

Adds an integration regression test that runs the scenario, starts the
threaded timer, and quits, asserting a clean shutdown with no post-shutdown
NotInitializedException.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tig and others added 15 commits June 17, 2026 11:25
…Terminal.Gui into tig/add-kitty-graphics-protocol-support
…Terminal.Gui into tig/add-kitty-graphics-protocol-support
…Terminal.Gui into tig/add-kitty-graphics-protocol-support
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Terminal.Gui into tig/add-kitty-graphics-protocol-support
Added JetBrains logo and attribution to README.
Add JetBrains logo to README
Replace the static frame with an animated capture: resize the image
view so its top-left corner fills the top-left of the display, then
keyboard-zoom into the left antenna (mini-Mandelbrot satellite), pan
around at depth, and zoom back out. Recorded via tuirec with the Sixel
raster protocol forced (Auto prefers Kitty, which agg cannot render).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…support

Fixes #5489. Add Kitty graphics protocol support (Kitty, Ghostty) with Kitty-first priority

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a123fbe1d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +398 to +400
Contents [row, col].Grapheme = " ";
Contents [row, col].Attribute = transparent;
Contents [row, col].IsDirty = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear URL metadata under raster images

When a raster image is placed over cells that were drawn with CurrentUrl (for example a Link or other OSC 8 content), this path replaces the grapheme/attribute but leaves _explicitUrlMap intact. After the image is removed, or if those covered blank cells become dirty, OutputBase still sees the stale URL and emits an invisible hyperlink over blank cells. Please clear the per-cell explicit URL mapping while clearing cells under the raster image.

Useful? React with 👍 / 👎.

Comment on lines +110 to +113
if (!IsLegacyConsole && UseKittyGraphics)
{
EmitVanishedKittyDeletes (buffer);
ClearKittyRasterBlankCells (buffer);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Delete Kitty placements when Kitty output is turned off

If an app switches UseKittyGraphics from true to false after a Kitty image has been rendered (the new Images/Mandelbrot protocol selectors and docs support forcing Sixel), this guard prevents EmitVanishedKittyDeletes from running even though _placedKittyImageIds still tracks persistent Kitty placements. Subsequent Sixel/cell frames won't remove the old Kitty image from the terminal, so stale graphics can remain on screen; the delete path needs to run whenever tracked Kitty placements exist, even if new raster output is no longer using Kitty.

Useful? React with 👍 / 👎.

@tig tig temporarily deployed to github-pages June 19, 2026 13:43 — with GitHub Actions Inactive
tig and others added 5 commits June 19, 2026 06:43
Blank cells carrying an opaque background (e.g. a View's shadow) drawn
over a raster image were suppressed along with the image's own
transparent cells, so shadows vanished over Sixel/Kitty images.

OutputBase now treats only transparent (alpha-0) blank cells as
raster-owned; opaque blanks are emitted so they paint over the image
(Sixel) or appear above the z=-1 placement (Kitty). ImageView marks its
raster-covered cells transparent so image-owned cells stay suppressed
while later opaque overlays show through.

Adds failing-first OutputBase tests for the Sixel and Kitty paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes #5502 - Shadows now overlay raster ImageView (Sixel & Kitty)
# Conflicts:
#	Directory.Packages.props
#	docfx/images/Mandelbrot.gif
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.

3 participants