Skip to content

fix: reset terminal on early quit (Esc/Ctrl+C) in tmux#62

Merged
Pazl27 merged 1 commit into
Pazl27:masterfrom
fuleinist:fix-terminal-reset-on-quit
May 20, 2026
Merged

fix: reset terminal on early quit (Esc/Ctrl+C) in tmux#62
Pazl27 merged 1 commit into
Pazl27:masterfrom
fuleinist:fix-terminal-reset-on-quit

Conversation

@fuleinist
Copy link
Copy Markdown
Contributor

Bug: Terminal left in raw mode on early quit

Issue: #1 Bug: Terminal output

When quitting via Esc or Ctrl+C (before timer expires), reset_terminal() was not being called, leaving the terminal in raw mode with hidden cursor. This manifests in tmux where terminal state is managed more strictly.

Root cause: In the run() function, reset_terminal() was only called after the normal completion path. The early-quit path (setting game.quit = true) broke out of the loop without resetting terminal state.

Fix: Move reset_terminal() into an else block so it runs on early quit as well.

When quitting via Esc or Ctrl+C, reset_terminal() was not being called,
leaving the terminal in raw mode with hidden cursor. This only manifested
in tmux where terminal state is more strictly managed.

Now calls reset_terminal() when game.quit is true (early exit path),
not just when the game runs to completion.
Copy link
Copy Markdown
Owner

@Pazl27 Pazl27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your contribution <3

@Pazl27 Pazl27 merged commit e46055f into Pazl27:master May 20, 2026
1 check passed
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