diff --git a/Cargo.lock b/Cargo.lock index de685cc..408a25d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,7 +35,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "fast-git-prompt" -version = "0.2.1" +version = "0.2.2" dependencies = [ "git2", "regex", diff --git a/Cargo.toml b/Cargo.toml index 85ff288..1a2373c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fast-git-prompt" -version = "0.2.1" +version = "0.2.2" description = "A fast git prompt for zsh and bash." license = "MIT" repository = "https://github.com/MasterGordon/fast-git-prompt" diff --git a/src/colors.rs b/src/colors.rs index f2b3db7..2767aa9 100644 --- a/src/colors.rs +++ b/src/colors.rs @@ -20,6 +20,7 @@ pub enum Color { BrightMagenta, BrightCyan, BrightWhite, + Reset, } const ESC: &str = "\x1b"; @@ -54,6 +55,7 @@ impl Ansi for Color { Color::BrightMagenta => format!("{}[95m", ESC), Color::BrightCyan => format!("{}[96m", ESC), Color::BrightWhite => format!("{}[97m", ESC), + Color::Reset => format!("{}[0m", ESC), } } } diff --git a/src/main.rs b/src/main.rs index d7efa54..6a2a622 100644 --- a/src/main.rs +++ b/src/main.rs @@ -136,8 +136,9 @@ fn main() { prompt = prompt.drain(..).filter(|s| !s.is_empty()).collect(); print!( - "{}{}", + "{}{}{}", color(config.base_color), - prompt.join(format!("{} ", color(config.base_color)).as_str()) + prompt.join(format!("{} ", color(config.base_color)).as_str()), + color(Some(Color::Reset)) ); }