diff options
author | Brian Campbell <lambda@continuation.org> | 2016-10-18 23:37:49 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-10-29 21:23:05 -0400 |
commit | 79a8d0ab3f75be2d30a8c55ae97dfd858e583be8 (patch) | |
tree | cc92c3ac9335fe55abfcb41f3ce4bbdaa064c9c5 /Cargo.lock | |
parent | fbf8265cded97bf4743563249181641b1b17188e (diff) |
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
Diffstat (limited to 'Cargo.lock')
-rw-r--r-- | Cargo.lock | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -2,6 +2,7 @@ name = "ripgrep" version = "0.2.3" dependencies = [ + "ctrlc 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.6.86 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -29,6 +30,16 @@ dependencies = [ ] [[package]] +name = "ctrlc" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "deque" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -251,6 +262,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" +"checksum ctrlc 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77f98bb69e3fefadcc5ca80a1368a55251f70295168203e01165bcaecb270891" "checksum deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1614659040e711785ed8ea24219140654da1729f3ec8a47a9719d041112fe7bf" "checksum docopt 0.6.86 (registry+https://github.com/rust-lang/crates.io-index)" = "4a7ef30445607f6fc8720f0a0a2c7442284b629cf0d049286860fae23e71c4d9" "checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" |