-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rg doesn't reset terminal color when interrupted #119
Comments
Agreed. Looks like we might be able to get away with the |
Or simply go into raw mode and handle
|
In any case, it seems strictly better to handle |
@BurntSushi it's starting to exist on Windows with the additional support of ASCII color codes in new versions of ConHost shipped in Windows 10. (Oh god why do I know that?) |
Yeah I know, but that's too new to rely on IMO. On Oct 18, 2016 14:47, "Andrew Schwartzmeyer" notifications@github.com @BurntSushi https://github.com/BurntSushi it's starting to exist on — Reply to this email directly, view it on GitHub |
Yeah I know, but that's too new to rely on IMO. On Oct 18, 2016 14:47, "Andrew Schwartzmeyer" notifications@github.com
|
If a user hits Ctrl-C to exit out of a search in the middle of printing a line, we don't want to leave the terminal colors screwed up for them. Catch Ctrl-C using the ctrlc crate, obtain a stdout lock to ensure that other threads don't continue writing after we do so, reset the terminal, and exit the program. Closes BurntSushi#119
I was grepping a large log file, and accidentally wrote a regex that matched a very large number of lines. After waiting for a minute of it just printing out lines to stdout, I killed
rg
with Ctrl-C. However, that left thetime
output and my shell prompt blue since apparently I'd interrupted it in the process of printing out a line number.rg
should probably catch SIGINT and reset the terminal color (or any other terminal changes) before exiting.The text was updated successfully, but these errors were encountered: