Repository navigation
Show a numbered menu on Linux and macOS instead of crashing - #175
Merged
Merged
Conversation
Running with no arguments opened a DustInTheWind ScrollMenu, which reads Console.CursorVisible. That getter throws PlatformNotSupportedException on every platform but Windows, so the documented default entry point crashed with exit code 134 on Linux and macOS. The scrolling menu is now kept for an interactive Windows console, and everywhere else the menu is a numbered prompt read a line at a time. Both have an Exit item, and the numbered prompt also exits at the end of input. Fixes #161 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMKbHPuiquQwvUr7NBWPvL
Only the loop that displays the menu needs an interactive Windows console. Building the menu and its Exit command does not, so a test now covers both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMKbHPuiquQwvUr7NBWPvL
|
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 #161
What changed
Menu.Runstill uses the DustInTheWindScrollMenu, but only in an interactive Windows console (OperatingSystem.IsWindows() && !Console.IsInputRedirected). Everywhere else, the menu is a numbered prompt that reads one line at a time:0, or reaching the end of input, exits with code 0Not an option: <input>ControlRepeater.RequestClose(), so leaving no longer needs Ctrl+C.Verification
MenuTestsdrive the numbered prompt through redirected stdin:0Menu.csreverted, all four tests fail with thePlatformNotSupportedExceptionfrom the issue. With the fix, the full suite passes locally on Linux: 83 passed, 3 skipped. The 3 skips already existed and need a non-root user.0piped in now prints the numbered menu and exits 0. Before the fix it aborted with exit code 134.🤖 Generated with Claude Code
https://claude.ai/code/session_01EMKbHPuiquQwvUr7NBWPvL
Generated by Claude Code