Skip to content

CTRL + C: try to quit gracefully#835

Merged
archisman-panigrahi merged 1 commit intoslgobinath:masterfrom
deltragon:sigint-graceful
Feb 19, 2026
Merged

CTRL + C: try to quit gracefully#835
archisman-panigrahi merged 1 commit intoslgobinath:masterfrom
deltragon:sigint-graceful

Conversation

@deltragon
Copy link
Copy Markdown
Collaborator

Description

Make the signal handler go through the normal quit codepath on the first call.
The second call will force-quit like before, if the app completely hangs. (This is a common convention).

@archisman-panigrahi
Copy link
Copy Markdown
Collaborator

archisman-panigrahi commented Jan 27, 2026

Thanks for the PR. I cannot find any change in behavior. What should I look for?

@deltragon
Copy link
Copy Markdown
Collaborator Author

The difference is only visible when running with --debug. Without this, pressing CTRL+C will instantly stop the process, without any logs visible.
With this, Safe Eyes will still shut down properly, logging:

^C2026-02-06 17:54:14,081 [INFO]:[MainThread] Quit Safe Eyes
2026-02-06 17:54:14,081 [INFO]:[MainThread] Close the break screen(s)
2026-02-06 17:54:14,081 [INFO]:[MainThread] Disable Safe Eyes
2026-02-06 17:54:14,082 [DEBUG]:[MainThread] Stop Smart Pause plugin
2026-02-06 17:54:14,082 [INFO]:[MainThread] Stop Safe Eyes core
2026-02-06 17:54:14,083 [INFO]:[MainThread] Pre-break waiting is over
2026-02-06 17:54:14,083 [DEBUG]:[MainThread] Stop Notification plugin

This does have the side-effect that it will e.g. also write to the session file when that is enabled, which I think it should.

@archisman-panigrahi
Copy link
Copy Markdown
Collaborator

LGTM

@archisman-panigrahi archisman-panigrahi merged commit e491b54 into slgobinath:master Feb 19, 2026
6 checks passed
@deltragon deltragon deleted the sigint-graceful branch February 19, 2026 11:30
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