aboutsummaryrefslogtreecommitdiff
path: root/src/ansi.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-10-23 15:37:06 -0700
committerJoe Wilm <joe@jwilm.com>2016-10-23 15:37:06 -0700
commit5876b4bf7a88a59482aefcc85e04a9ef6ecfed74 (patch)
tree8e55fbf061383569fca610418e02368b05a29fc2 /src/ansi.rs
parentea07f03ac901c366ed31da540711b84ca9e75602 (diff)
downloadalacritty-5876b4bf7a88a59482aefcc85e04a9ef6ecfed74.tar.gz
alacritty-5876b4bf7a88a59482aefcc85e04a9ef6ecfed74.zip
Proof of concept live reloading for colors
The architecture here is really poor. Need to move file watching into a dedicated location and probably have an spmc broadcast queue. other modules besides rendering will care about config reloading in the future.
Diffstat (limited to 'src/ansi.rs')
-rw-r--r--src/ansi.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ansi.rs b/src/ansi.rs
index 45cc66f9..c419d7e5 100644
--- a/src/ansi.rs
+++ b/src/ansi.rs
@@ -337,6 +337,10 @@ pub enum Color {
BrightCyan,
/// Bright white
BrightWhite,
+ /// The foreground color
+ Foreground,
+ /// The background color
+ Background,
}
/// Terminal character attributes
@@ -384,10 +388,6 @@ pub enum Attr {
Background(Color),
/// Set specific background color
BackgroundSpec(Rgb),
- /// Set default foreground
- DefaultForeground,
- /// Set default background
- DefaultBackground,
}
impl<'a, H: Handler + TermInfo + 'a> vte::Perform for Performer<'a, H> {
@@ -584,7 +584,7 @@ impl<'a, H: Handler + TermInfo + 'a> vte::Perform for Performer<'a, H> {
break;
}
},
- 39 => Attr::DefaultForeground,
+ 39 => Attr::Foreground(Color::Foreground),
40 => Attr::Background(Color::Black),
41 => Attr::Background(Color::Red),
42 => Attr::Background(Color::Green),
@@ -600,7 +600,7 @@ impl<'a, H: Handler + TermInfo + 'a> vte::Perform for Performer<'a, H> {
break;
}
},
- 49 => Attr::DefaultBackground,
+ 49 => Attr::Background(Color::Background),
90 => Attr::Foreground(Color::BrightBlack),
91 => Attr::Foreground(Color::BrightRed),
92 => Attr::Foreground(Color::BrightGreen),