aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-01-01 19:09:27 -0800
committerJoe Wilm <joe@jwilm.com>2017-01-01 19:09:27 -0800
commitd4e20a4741a4966fbb0b8162ed7cdf47007ca7b8 (patch)
treed5afd5e61de6eb229fa2383b4dce8b3ada7edf62 /src/main.rs
parent82bfc41af7d6eff384bdf95cedaf0d62b5450979 (diff)
downloadalacritty-d4e20a4741a4966fbb0b8162ed7cdf47007ca7b8.tar.gz
alacritty-d4e20a4741a4966fbb0b8162ed7cdf47007ca7b8.zip
Improve error handling for clipboard actions
Previously, these could have crashed alacritty. Now, they simply print an error message in Red to stderr. The Red format wrapper was moved to a central location where both main.rs and the alacritty lib can access it.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index a1c8e77c..3328ab59 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -30,6 +30,7 @@ use alacritty::event_loop::{self, EventLoop};
use alacritty::sync::FairMutex;
use alacritty::term::{Term};
use alacritty::tty::{self, process_should_exit};
+use alacritty::util::fmt::Red;
fn main() {
// Load configuration
@@ -58,13 +59,6 @@ fn main() {
println!("Goodbye");
}
-use std::fmt;
-struct Red<T>(T);
-impl<T: fmt::Display> fmt::Display for Red<T> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "\x1b[31m{}\x1b[0m", self.0)
- }
-}
/// Run Alacritty
///