Skip to content

fix: replace std::process::exit() with error returns in Windows paths - #1456

Merged
max-sixty merged 1 commit into
mainfrom
fix-windows-exit
Mar 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix-windows-exit

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The two Windows-only code paths (handle_select_command and handle_switch_command) called std::process::exit() directly, bypassing destructors, cleanup, and the centralized error handling in main(). Replace with WorktrunkError::AlreadyDisplayed returns — the established pattern for "message already printed, just exit with this code". Exit codes (1 and 2) are preserved.

This was written by Claude Code on behalf of @max-sixty

The two Windows-only code paths (`handle_select_command` and
`handle_switch_command`) called `std::process::exit()` directly, bypassing
destructors, cleanup, and the centralized error handling in `main()`.

Replace with `WorktrunkError::AlreadyDisplayed` returns, which is the
established pattern for "message already printed, just exit with this code".
Exit codes (1 and 2) are preserved.

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 8a63a05 into main Mar 12, 2026
23 checks passed
@max-sixty
max-sixty deleted the fix-windows-exit branch March 12, 2026 04:31
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