Repository navigation
Let a repeated Ctrl+C, SIGTERM or SIGHUP end a run whose shutdown hangs [patch] - #66
Merged
Merged
Conversation
…gs [patch] ShutdownSignals cancelled every signal once a tray existed, and ConsoleRunner cancelled every Ctrl+C and SIGTERM, including one sent while OnStop ran. A blocked UI thread or a hung OnStop then left nothing short of SIGKILL to end the process. Only the signal that starts the shutdown is taken now; a repeated one, one after Quit, or one during a console run's OnStop gets its default handling. Fixes #63 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW4brDwN4YAzA6oCKV6
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #63
What changed
Tray mode.
ShutdownSignals.RequestShutdownnow returns whatTrayApplication.RequestShutdownreturned, so only the signal that posts the shutdown is cancelled. A repeated Ctrl+C / SIGTERM / SIGHUP, or one after the Quit item already posted the shutdown, gets its default handling and ends the process. A blocked UI thread or a hungOnStopcan be interrupted again without SIGKILL.Console mode.
ConsoleRunneruses a small internalStopRequest. Only the first Ctrl+C / SIGTERM is cancelled. The request is closed beforeOnStopruns, whatever ended the wait (signal or--forexpiry), so a SIGTERM during a hungOnStopends the process.A single signal still ends the run through
OnStopand the preference flush, as #21 / #52 / #55 intended.Tests
ARepeatedSignal_IsStillTakenButPostsNoSecondShutdownis renamed toARepeatedSignal_IsLeftToEndTheProcessAndPostsNoSecondShutdown. The second request is now expected to returnfalse.ARepeatedTermination_IsNotCancelledandASignalAfterQuit_IsNotCancelled.StopRequest_TakesOnlyTheFirstRequestandStopRequest_AfterTheRunStopsOnItsOwn_TakesNoRequest.With the old behavior restored, all five fail. With the fix, the full suite passes (164 passed, 1 skipped), and the Release build is clean.
scripts/check-tray-signals.shcould not be run in the container I used. The demo fails before the change too, with "Unable to load bitmap from provided data" under Xvfb, so the result says nothing about this change. Please run it on a desktop before merging.Generated by Claude Code