Repository navigation
Fix BCU-console hanging on Console.ReadKey() after showing help - #966
Conversation
|
This is done deliberately since the target audience are Windows users that are likely to double click the exe and wonder what happened. As far as I could see there was no way to detect if the app was ran in a shell or standalone. What exactly is the use of running the help command in a script? |
I can update the PR to skip the pause when input is redirected and only pause when the app owns the console ( |
This would work, yeah. |
Replace the unconditional Console.ReadKey() after showing help with a guarded pause: skip it when input is redirected (pipe, file, Task Scheduler, CI - where ReadKey throws InvalidOperationException) and only pause when this process owns its console (a double-click), so shell users don't get an unwanted prompt while double-click users still get the window held open. Fixes BCUninstaller#956
Fixes #956
BCU-console help//?calledConsole.ReadKey()after printing help, which blocked interactive shells and threwInvalidOperationExceptionwhen console input was redirected (pipes, CI, Task Scheduler).This removes the
Console.ReadKey()call so help prints and exits 0 immediately.