aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-02-20 03:43:59 -0500
committerJesse Luehrs <doy@tozt.net>2018-02-20 03:43:59 -0500
commit988afdfd2f5cd11b612a78bf626537b58f35f798 (patch)
treec14cf717121dd63bd7ac97818628000e5ace06bf
parent3336ca4b117b3348bb539cf993f57138e34334d7 (diff)
downloadfancy-prompt-988afdfd2f5cd11b612a78bf626537b58f35f798.tar.gz
fancy-prompt-988afdfd2f5cd11b612a78bf626537b58f35f798.zip
also need to wrap the reset code in prompt escapes
-rw-r--r--src/colors.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/colors.rs b/src/colors.rs
index bb8ea4b..ddb3418 100644
--- a/src/colors.rs
+++ b/src/colors.rs
@@ -127,7 +127,9 @@ impl Colors {
let mut t = term::stdout().unwrap();
self.print_color(&mut *t, color);
write!(t, "{}", text).unwrap();
- t.reset().unwrap();
+ self.print_wrapped(|| {
+ t.reset().unwrap();
+ })
}
fn print_color(&self, t: &mut term::StdoutTerminal, color: Option<&term::color::Color>) {