Could we still output --stats
when the process is interrupted?
#2155
-
If |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 While that discussion tended to focus on coloring, this one does not and is perhaps a little simpler to deal with. However, the problem of doing signal handling correctly and reliably still stands. Basically, if this were to be done it would need to be very thoroughly vetted and tested across Unix and Windows. |
Beta Was this translation helpful? Give feedback.
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…