Skip to content

Honor HideOnAbort for external cancellation and enable NuGet packaging - #159

Merged
FRACerqueira merged 5 commits into
mainfrom
develop
Aug 10, 2026
Merged

Honor HideOnAbort for external cancellation and enable NuGet packaging#159
FRACerqueira merged 5 commits into
mainfrom
develop

Conversation

@FRACerqueira

Copy link
Copy Markdown
Owner

This pull request improves how PromptPlus controls handle external cancellations (such as Ctrl+C or a cancelled CancellationToken), ensuring the UI is cleared or left in a consistent state according to the HideOnAbort option. It also updates documentation, adds targeted tests for this behavior, and bumps package versions for both PromptPlus and ConsolePlus.

Behavioral improvements and bug fixes:

  • Interactive controls now honor the HideOnAbort option when cancelled externally (via Ctrl+C or a CancellationToken), clearing the UI frame if enabled, instead of only on Esc aborts. Live controls always clear their frame on external cancellation for terminal usability.
  • Added a critical render scope to ensure that abort cleanup (UI clearing, cursor/color restoration) completes even if Ctrl+C is pressed, preventing the process from exiting mid-cleanup.

Documentation updates:

  • Updated docs/global-behaviors.md to clarify that HideOnAbort applies to both Esc and external cancellations, and that RemoveHandlerCtrlC is now reserved for future use. Expanded explanation of Ctrl+C handling and its effects on process termination and cleanup. [1] [2]

Testing improvements:

  • Added new tests in CancelAbortRenderTests.cs to verify that the control frame is cleared or left intact on external cancellation, depending on the HideOnAbort setting.

Build and dependency updates:

  • Bumped PromptPlus version to 6.0.0-rc2, enabled package generation on build, and updated ConsolePlus.net dependency to 1.0.0-rc2. [1] [2]

FRACerqueira and others added 5 commits August 10, 2026 11:28
BaseControlPrompt.Run()'s external-cancellation branch only cleared the
frame for Live auto-render controls, so Ctrl+C (or a caller-supplied
CancellationToken) never honored HideOnAbort for interactive controls
regardless of how it was configured. Clear now when the control is Live
OR HideOnAbort is set, relying on ConsolePlus's new bounded grace period
to give the render loop a real chance to finish before the process exits.

Also correct global-behaviors.md, which documented Ctrl+C as an internal
abort gated by RemoveHandlerCtrlC -- that was never implemented; Ctrl+C
has always hard-exited the process. RemoveHandlerCtrlC is now noted as
reserved/currently unused.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…0.0-rc2

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Changed GeneratePackageOnBuild in PromptPlus.csproj from false to true, so building the project now automatically creates a NuGet package. This streamlines the packaging process and ensures packages are always up to date with each build.
Only run the test job when the diff touches a .cs file, skipping it for
doc/config-only changes. Also drop the full-history checkout in the
changes job (this repo's .git carries ~800MB of since-removed
docs/images/*.gif) in favor of resolving changed files via the GitHub
API, which was making every CI run needlessly slow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…on push

dorny/paths-filter's API mode only works for pull_request events; on push
events (e.g. a merge commit to main) there's no local checkout to diff
against and the step errors out, failing the whole job and skipping the
build entirely. continue-on-error lets it degrade to "skip tests" instead.
@FRACerqueira
FRACerqueira merged commit 095ed25 into main Aug 10, 2026
1 check passed
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.

1 participant