mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-31 04:02:00 -07:00
Reset the terminal when Ctrl-C is pressed
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 #119
This commit is contained in:
committed by
Andrew Gallant
parent
fbf8265cde
commit
79a8d0ab3f
@@ -24,6 +24,7 @@ name = "integration"
|
||||
path = "tests/tests.rs"
|
||||
|
||||
[dependencies]
|
||||
ctrlc = "2.0"
|
||||
deque = "0.3"
|
||||
docopt = "0.6"
|
||||
env_logger = "0.3"
|
||||
|
Reference in New Issue
Block a user