Skip to content

Commit da71f46

Browse files
factorydroidechobt
authored andcommitted
fix(tui): restore cursor on Ctrl+C interrupt during spinner
Fixes bounty issue #1522 The cursor remained hidden if the user interrupted the application with Ctrl+C while a spinner was active. This was because the terminal state wasn't fully restored in the Ctrl+C handler path. This change explicitly calls terminal.show_cursor() when handling the Ctrl+C interrupt signal in the event loop, ensuring the terminal is left in a usable state.
1 parent 36e0307 commit da71f46

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cortex-tui/src/runner/event_loop.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,10 @@ impl EventLoop {
13421342

13431343
// Priority 4: Double Ctrl+C to quit
13441344
if self.app_state.handle_ctrl_c() {
1345+
// Restore terminal state before quitting to ensure cursor is visible
1346+
// This fixes the issue where cursor remains hidden after Ctrl+C during a spinner
1347+
terminal.show_cursor()?;
1348+
13451349
self.app_state.set_quit();
13461350
return Ok(());
13471351
} else {

0 commit comments

Comments
 (0)