diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-09 18:44:58 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-09 18:44:58 -0500 |
commit | 321549c05e47c322998edba05a52d16a722f17a7 (patch) | |
tree | f5a856c2fada9591f5b13645f4c9e001b3a15a62 /src/readline.rs | |
parent | f1878e73c2892da9b929a11c2ee805d9b46f7e6b (diff) | |
download | nbsh-321549c05e47c322998edba05a52d16a722f17a7.tar.gz nbsh-321549c05e47c322998edba05a52d16a722f17a7.zip |
tweak colors a bit
Diffstat (limited to 'src/readline.rs')
-rw-r--r-- | src/readline.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/readline.rs b/src/readline.rs index 911c927..0bb304c 100644 --- a/src/readline.rs +++ b/src/readline.rs @@ -63,7 +63,11 @@ impl Readline { let timelen: u16 = time.len().try_into().unwrap(); out.move_to(self.size.0 - 2, 0); - out.set_bgcolor(textmode::Color::Rgb(32, 32, 64)); + if focus { + out.set_bgcolor(textmode::Color::Rgb(32, 32, 64)); + } else { + out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); + } out.write(b"\x1b[K"); out.write_str(" ("); out.write_str(&pwd); @@ -75,16 +79,10 @@ impl Readline { out.write_str("]"); out.move_to(self.size.0 - 1, 0); - if focus { - out.set_fgcolor(textmode::color::BLACK); - out.set_bgcolor(textmode::color::CYAN); - } else { - out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); - } + out.reset_attributes(); out.write_str(&prompt_char); out.write_str(" "); out.reset_attributes(); - out.set_bgcolor(textmode::Color::Rgb(32, 32, 32)); out.write(b"\x1b[K"); out.write_str(&self.input_line); out.reset_attributes(); |