What's wrong
SpectreConsoleProvider.ReadInputAsync() has a branch that special-cases ConsoleKey.C + ConsoleModifiers.Control as if it will come back as ordinary input from Console.ReadKey(true). By default it won't: .NET's Console treats Ctrl+C as a process interrupt (SIGINT / CancelKeyPress) and terminates the process before Console.ReadKey ever sees it, unless Console.TreatControlCAsInput has been set to true.
Neither Console.TreatControlCAsInput = true nor a Console.CancelKeyPress handler exists anywhere in TUI.Core, TUI.App, or TUI.CLI.
Failure scenario
UIApplication.RunAsync() hides the cursor on startup and only restores it (ConsoleProvider.SetCursorVisibility(true)) in its finally block on normal shutdown. Pressing Ctrl+C — the near-universal terminal "quit" convention — terminates the process at the runtime/OS level, skipping RunAsync's finally entirely. The user is left with an invisible cursor in their terminal after the process exits, until they run another program that resets terminal state or manually reset it.
Suggested fix
Either:
- Set
Console.TreatControlCAsInput = true while the app runs (so the existing Ctrl+C branch in ReadInputAsync becomes reachable) and restore the previous value in finally, or
- Register a
Console.CancelKeyPress handler that sets e.Cancel = true, restores terminal state (cursor visibility, etc.), and triggers Shutdown().
Acceptance criteria
Pressing Ctrl+C while the app is running exits cleanly through the normal shutdown path, and the terminal cursor is visible again after the process ends.
What's wrong
SpectreConsoleProvider.ReadInputAsync()has a branch that special-casesConsoleKey.C+ConsoleModifiers.Controlas if it will come back as ordinary input fromConsole.ReadKey(true). By default it won't: .NET'sConsoletreats Ctrl+C as a process interrupt (SIGINT /CancelKeyPress) and terminates the process beforeConsole.ReadKeyever sees it, unlessConsole.TreatControlCAsInputhas been set totrue.Neither
Console.TreatControlCAsInput = truenor aConsole.CancelKeyPresshandler exists anywhere inTUI.Core,TUI.App, orTUI.CLI.Failure scenario
UIApplication.RunAsync()hides the cursor on startup and only restores it (ConsoleProvider.SetCursorVisibility(true)) in itsfinallyblock on normal shutdown. Pressing Ctrl+C — the near-universal terminal "quit" convention — terminates the process at the runtime/OS level, skippingRunAsync'sfinallyentirely. The user is left with an invisible cursor in their terminal after the process exits, until they run another program that resets terminal state or manually reset it.Suggested fix
Either:
Console.TreatControlCAsInput = truewhile the app runs (so the existing Ctrl+C branch inReadInputAsyncbecomes reachable) and restore the previous value infinally, orConsole.CancelKeyPresshandler that setse.Cancel = true, restores terminal state (cursor visibility, etc.), and triggersShutdown().Acceptance criteria
Pressing Ctrl+C while the app is running exits cleanly through the normal shutdown path, and the terminal cursor is visible again after the process ends.