Skip to content

Fixes UICatalog --version, adds release workflows and maintainer docs#5009

Merged
tig merged 35 commits intodevelopfrom
fix/uicatalog-cmdline
Apr 20, 2026
Merged

Fixes UICatalog --version, adds release workflows and maintainer docs#5009
tig merged 35 commits intodevelopfrom
fix/uicatalog-cmdline

Conversation

@tig
Copy link
Copy Markdown
Collaborator

@tig tig commented Apr 20, 2026

Summary

Fixes the --version crash in UICatalog and modernizes the release infrastructure.

UICatalog Command-Line Fixes

  • Fix --version crash: ArgumentNullException in CreateLogger() when --version exited early before config was set up
  • Show library version: --version and About box now display the Terminal.Gui library version (terse SemVer, truncated at +)
  • Markdown-based --help: Embedded README.md rendered as help text (same pattern as mdv)
  • Updated Examples/UICatalog/README.md: Accurate command-line docs
  • Added Examples/README.md: Terse overview pointing to individual example READMEs

Versioning & GitVersion

  • Feature branch versioning: Added feature branch config to GitVersion.yml matching fix/*, feature/*, issue/*, dependabot/*, copilot/* branches with {BranchName} label from named capture groups
  • Centralized GitVersion.MsBuild: Package version now in Directory.Packages.props
  • Version display: Library version stripped of build metadata (2.0.0-fix-name.1 not 2.0.0-fix-name.1+5337.Branch...)

Automated Release Workflows (new)

Replaces the manual "checkout main, merge develop, push" flow with a PR-based process that respects branch protections:

  • prepare-release.yml (manual dispatch): Creates a release/vX.Y.Z branch from develop, updates the GitVersion label in GitVersion.yml, and opens a PR into main
  • finalize-release.yml (auto on PR merge): When the release PR is merged, creates an annotated tag, GitHub Release with auto-generated notes, and a back-merge PR (maindevelop)
  • Existing publish.yml fires on the tag push to handle NuGet publishing
  • Old release.yml kept as legacy fallback

Maintainer Guide

  • Rewrote Terminal.Gui/README.md as a comprehensive maintainer guide covering:
    • How GitVersion computes versions per branch type
    • Pre-release label progression (betarc → stable)
    • Automated and manual release steps
    • CI/CD workflow table (all 8+ workflows documented)
    • V1 legacy branch documentation (v1_release/v1_develop)
    • Local NuGet package development
    • Documentation generation

tig and others added 27 commits April 8, 2026 13:34
- Fix ArgumentNullException in CreateLogger() when --version exits early
- Add Markdown-based --help using embedded README.md (like mdv)
- Show Terminal.Gui library version (terse SemVer) in --version and About box
- Truncate version at '+' to strip build metadata
- Add feature branch config to GitVersion.yml with named capture groups
- Configure versioning for fix/, feature/, issue/, dependabot/, copilot/ branches
- Centralize GitVersion.MsBuild package version in Directory.Packages.props
- Update Examples/UICatalog/README.md and Examples/README.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add prepare-release.yml: creates release PR from develop → main
- Add finalize-release.yml: auto-tags, creates GitHub Release, back-merges
- Rewrite Terminal.Gui/README.md as comprehensive maintainer guide
- Document versioning, GitVersion config, CI/CD workflows, V1 legacy branches

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tig tig changed the title Fix/uicatalog cmdline Fixes UICatalog --version, adds release workflows and maintainer docs Apr 20, 2026
tig and others added 2 commits April 20, 2026 20:03
GitVersion.MsBuild requires full git history to compute versions.
All workflows that build Terminal.Gui now use fetch-depth: 0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…et version

The previous label 'pr.{BranchName}' produced literal '{BranchName}' in the
version string because the regex lacked a named capture group. Curly braces
are invalid in NuGet package versions. Use the standard GitVersion pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Windows path already had --skip-duplicate, but the non-Windows path
was missing it. This caused CI failures when the package already existed
in the local NuGet cache.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes UICatalog’s early-exit command paths (--version/--help) and shifts the repo toward GitVersion-driven versioning, while also adding a PR-based automated release process and updating maintainer/release documentation.

Changes:

  • Switch versioning to GitVersion.MsBuild (centralized via Directory.Packages.props) and remove hard-coded versions from projects.
  • Update UICatalog to (a) display the Terminal.Gui library version and (b) render --help via embedded markdown.
  • Add/adjust GitHub Actions workflows for release preparation/finalization and ensure CI workflows fetch full git history for GitVersion.

Reviewed changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Tests/UnitTestsParallelizable/UnitTests.Parallelizable.csproj Removes hard-coded version properties; adds note about GitVersion.MsBuild.
Tests/UnitTests.NonParallelizable/UnitTests.NonParallelizable.csproj Removes hard-coded version properties; adds note about GitVersion.MsBuild.
Tests/UnitTests.Legacy/UnitTests.Legacy.csproj Removes hard-coded version properties; adds note about GitVersion.MsBuild.
Terminal.Gui/Terminal.Gui.csproj Adds GitVersion.MsBuild reference; removes manual <Version>/VersionSuffix; tweaks local push command.
Terminal.Gui/README.md Rewritten as a maintainer/release guide documenting GitVersion + workflows.
GitVersion.yml Updates PR versioning pattern and adds a feature branch configuration for topic branches.
Examples/mdv/mdv.csproj Removes hard-coded version properties from the example project.
Examples/UICatalog/UICatalogRunnable.cs About dialog now displays the Terminal.Gui library version.
Examples/UICatalog/UICatalog.csproj Removes hard-coded version properties and embeds README.md for --help.
Examples/UICatalog/UICatalog.cs Overrides --help and --version, renders markdown help, and adds library version extraction.
Examples/UICatalog/README.md Updates scenario and CLI documentation; aligns with new --help behavior.
Examples/ScenarioRunner/ScenarioRunner.csproj Removes hard-coded version properties from the example project.
Examples/ReactiveExample/ReactiveExample.csproj Removes hard-coded version properties from the example project.
Examples/README.md Adds a top-level examples directory README.
Examples/InlineSelect/InlineSelect.csproj Removes hard-coded version properties from the example project.
Examples/InlineColorPicker/InlineColorPicker.csproj Removes hard-coded version properties from the example project.
Examples/InlineCLI/InlineCLI.csproj Removes hard-coded version properties from the example project.
Examples/Example/Example.csproj Removes hard-coded version properties from the example project.
Examples/AI/AI.csproj Removes hard-coded version properties from the example project.
Directory.Packages.props Centralizes GitVersion.MsBuild package version.
.github/workflows/unit-tests.yml Ensures full git history is fetched for GitVersion.MsBuild.
.github/workflows/stress-tests.yml Ensures full git history is fetched for GitVersion.MsBuild.
.github/workflows/publish.yml Stops updating assembly info via GitVersion action; relies on GitVersion.MsBuild and adjusts pack step.
.github/workflows/prepare-release.yml Adds workflow to create a release branch + PR and update GitVersion label.
.github/workflows/integration-tests.yml Ensures full git history is fetched for GitVersion.MsBuild.
.github/workflows/finalize-release.yml Adds workflow to tag + create GitHub Release and open a back-merge PR after merging release PR.
.github/workflows/codeql-analysis.yml Ensures full git history is fetched for GitVersion.MsBuild.
.github/workflows/build-validation.yml Ensures full git history is fetched for GitVersion.MsBuild.

Comment thread Tests/UnitTestsParallelizable/UnitTests.Parallelizable.csproj Outdated
Comment thread Tests/UnitTests.NonParallelizable/UnitTests.NonParallelizable.csproj Outdated
Comment thread Tests/UnitTests.Legacy/UnitTests.Legacy.csproj Outdated
Comment thread Examples/UICatalog/UICatalog.cs
Comment thread .github/workflows/prepare-release.yml Outdated
tig and others added 5 commits April 21, 2026 02:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tig tig merged commit a79b1a2 into develop Apr 20, 2026
11 checks passed
@tig tig deleted the fix/uicatalog-cmdline branch April 20, 2026 15:03
tig added a commit that referenced this pull request Apr 20, 2026
* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tig added a commit that referenced this pull request Apr 20, 2026
* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tig added a commit that referenced this pull request Apr 20, 2026
* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes #4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Set release label to 'rc' for v2.0.0-rc.1

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
BDisp added a commit to BDisp/Terminal.Gui that referenced this pull request Apr 20, 2026
* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes gui-cs#4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (gui-cs#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes gui-cs#4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (gui-cs#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (gui-cs#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (gui-cs#5021)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Set release label to 'rc' for v2.0.0-rc.1

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
tig added a commit that referenced this pull request Apr 21, 2026
* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes #4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes #4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes #5008. Fix Markdown codeblock background attribute (#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
tig added a commit that referenced this pull request Apr 21, 2026
* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs



* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------




* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs



* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs



* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs



* Update LayoutAndDrawComplete event summary and remarks

---------



* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



---------



* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



---------



* Fixes #4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes #4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367



* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs



* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs



* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs



* Update Terminal.Gui/Views/Button.cs



* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9



* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------






* Bump Markdig from 1.1.2 to 1.1.3 (#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...




* Back-merge v2.0.0-beta.218 from main into develop (#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs



* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------




* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs



* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs



* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs



* Update LayoutAndDrawComplete event summary and remarks

---------



* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



---------



* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



---------



---------





---------





* Adds `TreeView.GetSize` (#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes #4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b



* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b



* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee



* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4



---------




* Fixes #5008. Fix Markdown codeblock background attribute (#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7



* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)



* Default UseThemeBackground to true



* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).



---------






---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
tig added a commit that referenced this pull request Apr 21, 2026
* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes #4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes #4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes #5008. Fix Markdown codeblock background attribute (#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #5028. TextView still has remaining's bugs (#5029)

* Fix click set insertion point row greater than lines count

* Fix autocomplete popup on close not flag host control to redraw

---------

Co-authored-by: Tig <tig@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
tig added a commit that referenced this pull request Apr 21, 2026
* Release v2.0.0-rc.2 (#5030)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes #4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes #4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes #5008. Fix Markdown codeblock background attribute (#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Release v2.0.0-rc.3 (#5032)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes #4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes #4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes #5008. Fix Markdown codeblock background attribute (#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #5028. TextView still has remaining's bugs (#5029)

* Fix click set insertion point row greater than lines count

* Fix autocomplete popup on close not flag host control to redraw

---------

Co-authored-by: Tig <tig@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
BDisp added a commit to BDisp/Terminal.Gui that referenced this pull request Apr 21, 2026
* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs



* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------




* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs



* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs



* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs



* Update LayoutAndDrawComplete event summary and remarks

---------



* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



---------



* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



---------



* Fixes gui-cs#4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (gui-cs#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes gui-cs#4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367



* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs



* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs



* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs



* Update Terminal.Gui/Views/Button.cs



* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9



* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------






* Bump Markdig from 1.1.2 to 1.1.3 (gui-cs#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...




* Back-merge v2.0.0-beta.218 from main into develop (gui-cs#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (gui-cs#5021)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs



* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------




* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs



* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs



* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs



* Update LayoutAndDrawComplete event summary and remarks

---------



* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



---------



* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



---------



---------





---------





* Adds `TreeView.GetSize` (gui-cs#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (gui-cs#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes gui-cs#4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (gui-cs#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b



* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b



* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee



* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4



---------




* Fixes gui-cs#5008. Fix Markdown codeblock background attribute (gui-cs#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7



* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)



* Default UseThemeBackground to true



* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).



---------






---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
BDisp added a commit to BDisp/Terminal.Gui that referenced this pull request Apr 21, 2026
* Release v2.0.0-rc.2 (gui-cs#5030)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes gui-cs#4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (gui-cs#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes gui-cs#4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (gui-cs#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (gui-cs#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (gui-cs#5021)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (gui-cs#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (gui-cs#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes gui-cs#4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (gui-cs#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes gui-cs#5008. Fix Markdown codeblock background attribute (gui-cs#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Release v2.0.0-rc.3 (gui-cs#5032)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes gui-cs#4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (gui-cs#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes gui-cs#4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (gui-cs#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (gui-cs#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (gui-cs#5021)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (gui-cs#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (gui-cs#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes gui-cs#4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (gui-cs#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes gui-cs#5008. Fix Markdown codeblock background attribute (gui-cs#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes gui-cs#5028. TextView still has remaining's bugs (gui-cs#5029)

* Fix click set insertion point row greater than lines count

* Fix autocomplete popup on close not flag host control to redraw

---------

Co-authored-by: Tig <tig@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
BDisp added a commit to BDisp/Terminal.Gui that referenced this pull request Apr 21, 2026
* Release v2.0.0-rc.2 (gui-cs#5030)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes gui-cs#4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (gui-cs#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes gui-cs#4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (gui-cs#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (gui-cs#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (gui-cs#5021)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (gui-cs#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (gui-cs#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes gui-cs#4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (gui-cs#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes gui-cs#5008. Fix Markdown codeblock background attribute (gui-cs#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Release v2.0.0-rc.3 (gui-cs#5032)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes gui-cs#4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (gui-cs#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes gui-cs#4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (gui-cs#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (gui-cs#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (gui-cs#5021)

* Release new `main` build (gui-cs#5005)

* Updates the sample.gif (gui-cs#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (gui-cs#4987)

* Fixes gui-cs#4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes gui-cs#4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes gui-cs#4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes gui-cs#4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes gui-cs#4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes gui-cs#4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (gui-cs#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (gui-cs#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (gui-cs#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (gui-cs#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (gui-cs#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (gui-cs#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (gui-cs#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes gui-cs#4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (gui-cs#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes gui-cs#5008. Fix Markdown codeblock background attribute (gui-cs#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes gui-cs#5028. TextView still has remaining's bugs (gui-cs#5029)

* Fix click set insertion point row greater than lines count

* Fix autocomplete popup on close not flag host control to redraw

---------

Co-authored-by: Tig <tig@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
tig added a commit that referenced this pull request Apr 22, 2026
* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes #4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1df2cb22e25c4cdf6ea63649ddde9e881c.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* fixed gitversion yml bug

* Fixes #4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes #5008. Fix Markdown codeblock background attribute (#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #5028. TextView still has remaining's bugs (#5029)

* Fix click set insertion point row greater than lines count

* Fix autocomplete popup on close not flag host control to redraw

---------

Co-authored-by: Tig <tig@users.noreply.github.com>

* Fix/prepare release versioning (#5034)

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix api-docs workflow: add fetch-depth 0 for GitVersion

GitVersion.MsBuild requires full git history during dotnet build.
The api-docs workflow was using a shallow clone, causing the build to fail.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Release v2.0.0-rc.2 (#5030) (#5031)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs



* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------




* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs



* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs



* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs



* Update LayoutAndDrawComplete event summary and remarks

---------



* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



---------



* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



---------



* Fixes #4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes #4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367



* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs



* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs



* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs



* Update Terminal.Gui/Views/Button.cs



* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9



* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------






* Bump Markdig from 1.1.2 to 1.1.3 (#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...




* Back-merge v2.0.0-beta.218 from main into develop (#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs



* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------




* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs



* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs



* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs



* Update LayoutAndDrawComplete event summary and remarks

---------



* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



---------



* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.



* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic



---------



---------





---------





* Adds `TreeView.GetSize` (#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1df2cb22e25c4cdf6ea63649ddde9e881c.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes #4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b



* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b



* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee



* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4



---------




* Fixes #5008. Fix Markdown codeblock background attribute (#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7



* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)



* Default UseThemeBackground to true



* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).



---------






---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* back merge from Main (#5037)

* Release v2.0.0-rc.2 (#5030)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fixes #4843. Button: avoid create-then-destroy shadow allocation via CWP InitializingShadowStyle event (#5012)

* Cleans up examples.

* updated docs

* Initial plan

* Fixes #4885. Button: avoid create-then-destroy shadow allocation via GetDefaultShadowStyle()

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/4c164de3-c266-4539-996f-a3b941b0a367

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update Terminal.Gui/Views/ScrollBar/ScrollButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/ViewBase/Adornment/ArrangerButton.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Tests/UnitTestsParallelizable/Views/ButtonTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Views/Button.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Redesign shadow initialization to use CWP event (OnInitializingShadowStyle + InitializingShadowStyle)

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/14508ce0-b4f0-4534-8270-4c61d75880c9

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Darken shadow effect in ShadowView for non-opaque style

Increased the dimming factor for shadow colors in ShadowView by updating GetDimmerColor parameters from 0.05/0.25 to 0.9. This results in a much darker shadow appearance when ShadowStyle is not Opaque.

* Refactor docs and style in Button and ArrangerButton

Reformat XML docs for readability and line wrapping. Convert OnHotKeyCommand to an expression-bodied member. Apply minor whitespace and style fixes to align with project conventions. No functional changes.

* Update ShadowTests expected ANSI output for background

Changed the expected ANSI color code in ShadowTests.cs from bright white (\x1b[107m) to black (\x1b[40m) for the second cell in the driver output assertion, aligning the test with the updated rendering behavior.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Bump Markdig from 1.1.2 to 1.1.3 (#5017)

---
updated-dependencies:
- dependency-name: Markdig
  dependency-version: 1.1.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Back-merge v2.0.0-beta.218 from main into develop (#5022)

* Cleans up examples.

* updated docs

* Release v2.0.0-beta.218 (#5021)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix/prepare release (#5019)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and increments to produce
the next version (e.g., 2.0.0-beta.218).

Also adds:
- Concurrency group to prevent race conditions between runs
- Remote branch conflict detection before creating release branch
- Simplified GitVersion.yml label update logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Adds `TreeView.GetSize` (#5025)

* Refactor driver param, MinUI, and Terminal.Gui integration

- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text
- Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev
- Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified
- Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow
- Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView
- Ensure explicit disposal of windows and apps in all entry points
- Expose TreeView<T>.GetSize() for accurate sizing
- Update launchSettings.json and tests for new Driver param and MinUI usage
- Improve null-safety, event handling, and consistency throughout UI code

* Revert "Refactor driver param, MinUI, and Terminal.Gui integration"

This reverts commit 10821a1df2cb22e25c4cdf6ea63649ddde9e881c.

* Refactor tree size calculation into GetSize() method

Extracted content size logic to a new public GetSize() method in TreeView<T>. This method computes the logical size based on expanded branches and is now used for content size updates. Added XML documentation for GetSize().

* Ensures `CollectionNavigator` does not repond to alt or ctrl keys (#5014)

* Cleans up examples.

* updated docs

* Update IsCompatibleKey to reject Alt/Ctrl; improve tests

IsCompatibleKey now rejects keys with Alt or Ctrl modifiers, ensuring only plain character keys are accepted for search. Added tests to verify this behavior, including scenarios with AssociatedText. Refactored and reformatted tests for clarity, style compliance, and improved thread safety test code.

* Fixes #4865. Add v1→v2 corrections table and expand agent-facing files for all AI tools (#5027)

* Initial plan

* Add v1→v2 corrections table and expand agent-facing files for all AI tools

- Create ai-v2-primer.md: canonical v1→v2 reference for all agents
- Expand llms.txt from 115 to ~330 lines with corrections table, snippets, gotchas
- Flesh out .cursorrules from 5-line stub to full agent config
- Create .windsurfrules for Windsurf AI support
- Create .aider.md for Aider AI support
- Update AGENTS.md with v1→v2 corrections table
- Update CLAUDE.md to reference v2 primer
- Update .github/copilot-instructions.md with v1→v2 corrections and updated lifecycle

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Address review feedback: clarify Pos.At docs, improve copilot-instructions readability

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/ac004541-cd96-4c44-b6e7-ac21c60aad0b

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix C# version to 14/net10.0 and clarify style rules are for library contributors only

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/e034da10-7544-4fa9-8186-53d7e5011eee

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Use Accepted (post-event) instead of Accepting as the v1 Clicked replacement

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/15e8840e-cec8-4098-8272-fb78a1516eb4

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fixes #5008. Fix Markdown codeblock background attribute (#5011)

* Initial plan

* Fix MarkdownCodeBlock rendering codeblocks with incorrect background attribute

- Remove ThemeBackground assignment on embedded code blocks in SyncCodeBlockViews()
  so code blocks always use the distinct Code role background instead of blending
  with the main content background when UseThemeBackground=true.
- Pass resolved code block background to GetAttributeForSegment in
  MarkdownCodeBlock.OnDrawingContent() so text segments use the same background
  as the fill, fixing the mismatch when UseThemeBackground=false.
- Add two tests verifying both scenarios.

Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/fd4d1cad-1f64-4890-b1a7-74df3f9a2ab7

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix Markdown code block background and highlighter logic

Markdown code blocks now use the SyntaxHighlighter's DefaultBackground for their ThemeBackground, ensuring correct theming for both light and dark themes. The SyntaxHighlighter is passed to MarkdownCodeBlock SubViews. The "Theme BG" CheckBox in Deepdives and MarkdownTester reflects the current UseThemeBackground state. Added and updated tests to verify code block background and highlighter assignment. Minor formatting and style improvements included.

* fixed gitversion yml bug

* Fix SyntaxHighlighter/UseThemeBackground setters to invalidate layout

SyntaxHighlighter and UseThemeBackground were auto-properties, so changing
them after Text was set had no effect until Text was re-assigned. This
required a hack (Text=""; Text=text) in Deepdives, MarkdownTester, and mdv.

- Make both setters call InvalidateParsedAndLayout() on change
- Fix GetAttributeForSegment to override bg on explicit-attribute segments
  when themeBackground is provided (covers real TextMate tokenization)
- Remove Text re-assignment hacks from Deepdives, MarkdownTester, and mdv
- Add tests: explicit-attribute fill/text bg match, SyntaxHighlighter
  invalidation, UseThemeBackground invalidation (all verified to fail
  when their corresponding fixes are reverted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Default UseThemeBackground to true

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add ThemeName property to ISyntaxHighlighter interface

Replaces CurrentThemeName with ThemeName in TextMateSyntaxHighlighter and updates all usages. Adapts scenario constructors, theme selection logic, and test/mocks to use the new property. Updates unit tests to check ThemeName and renames test methods accordingly.

* Auto-select syntax theme based on terminal background

Add DefaultAttributeChanged event to IDriver and DriverImpl, allowing detection of terminal background color changes. Update Markdown views in Deepdives, MarkdownTester, and Program to auto-switch syntax highlighting themes (light/dark) based on the terminal's background, ensuring better visual consistency and accessibility.

* Fix code block dimmer direction for light themes

Invert isDark when calling GetDimmerColor so code block bg shifts
*away* from the body bg: dark themes get slightly lighter code blocks,
light themes get slightly darker ones. The intuitive direction caused
light-theme code blocks to wash out to medium gray (L>=90 fallback).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Release v2.0.0-rc.3 (#5032)

* Release new `main` build (#5005)

* Updates the sample.gif (#5007)

* Cleans up examples.

* updated docs

* new sample.gif

* reverted

* Fix remaining TextView issues (#4987)

* Fixes #4986. Navigating with Viewport.Y greater than zero will cause scrolling to increase, even if the current line fits within the available height.

* Fixes #4990. Navigating with Viewport.X greater than zero will cause scrolling left, even if the current column isn't at the right of the viewport

* Fixes #4994 - Navigating left and right while holding down the Ctrl key does not cause edge scrolling.

* Fixes #4998. TextView.UpdateContentSize isn't working correctly on insert and delete text

* Fixes #4999. TextView with hidden cursor due scrolling pressing any CursorRight/Left/Down/Up keys doesn't adjust to make the cursor visible

* Update Tests/UnitTestsParallelizable/Views/TextView.NavigationTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes #4891. DoDrawComplete should ignore scrolled Viewport.Location when excluding opaque view area

* Clarify comment related to deleted

* Fix MoveUp() and add more unit tests

* Test that proves despite does not change viewport position but does set NeedsDraw.

* Fix MoveLeft method and add a test

* Fix MoveWordLeft and add unit test

* Fix MoveWordRight and add unit test

* Simplify MoveRight code

* Fix DeleteCharLeft invoke ContentChanged twice

* Fix ShouldInvalidateMaxWidthCache to use full size

* Remove unnecessary LINQ in _cachedMaxWidthPerLine

* Move ShouldInvalidateMaxWidthCache tests

* Fix ArgumentOutOfRangeException on DeleteTextLeft

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes UICatalog --version, adds release workflows and maintainer docs (#5009)

* Fixes `AppModel.Inline` issues needed for `Output-ConsoleGridView` to work well (#5010)

* Cleans up examples.

* updated docs

* Add LayoutAndDrawComplete event, improve shutdown/reset

- Adds LayoutAndDrawComplete event to IApplication and ApplicationImpl, raised after layout/draw completes
- Refactors ApplicationMainLoop to track first layout/draw with _firstLayoutAndDrawComplete
- Removes UnsubscribeDriverEvents and inlines DeviceAttributesStartupQueryTimeout
- Uses Lock for _sessionStackLock for better thread safety
- Ensures terminal attributes are reset (ESC[0m) and cursor shown on shutdown in AnsiOutput
- Adds CSI_ResetAttributes to EscSeqUtils
- Skips IterationImpl_Inline_FullTimeline_TraceDump test (tracing not for test results)

* Update Tests/UnitTestsParallelizable/Drivers/Output/InlineDrawTimingTests.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/Drivers/AnsiHandling/EscSeqUtils/EscSeqUtils.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Terminal.Gui/App/MainLoop/ApplicationMainLoop.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update LayoutAndDrawComplete event summary and remarks

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fixes prepare release workflow (#5015)

* Cleans up examples.

* updated docs

* Use RELEASE_PAT for release workflows to allow PR creation

GITHUB_TOKEN is not permitted to create pull requests in this repo.
Switch prepare-release and finalize-release workflows to use the
RELEASE_PAT secret for checkout, PR creation, and release creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix version numbering: auto-increment pre-release from existing tags (#5018)

The workflow was manually constructing versions like '2.0.0-beta' without
the incrementing number suffix. Now it scans existing git tags to find the
latest matching tag (e.g., v2.0.0-beta.217) and incremen…
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