Skip to content

Could we still output --stats when the process is interrupted? #2155

Answered by BurntSushi
tomwadeson asked this question in General
Discussion options

You must be logged in to vote

AIUI, the way to do this is to install a signal handler. A while back, we had a signal handler installed that would "clear the terminal" to avoid scenarios where ripgrep was killed in the middle of writing colored text to the terminal. When that happens, the coloring styling stays enabled for the terminal even though ripgrep has stopped. So the signal handler would ensure that terminal coloring was "reset." That was done in this PR: #187

However, the way it was implemented seemed to not work in certain situations on Windows, and basically had the effect of making ^C do nothing. That can never be acceptable. Above all else, users need the ability to kill ripgrep reliably if they want it to…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants