diff options
author | Joe Wilm <joe@jwilm.com> | 2017-01-08 16:35:59 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2017-01-08 16:35:59 -0800 |
commit | b7f43ac0236d5dcaa1e6c7d3a22189faa4342932 (patch) | |
tree | 383cb66e93578178d12c2896c9804445b80b6f8a | |
parent | 9e713189cc6dc83f97e87fa18b66b39d2c7222cc (diff) | |
download | alacritty-b7f43ac0236d5dcaa1e6c7d3a22189faa4342932.tar.gz alacritty-b7f43ac0236d5dcaa1e6c7d3a22189faa4342932.zip |
Fix parsing of coalesced SGR attributes
cc #116
-rw-r--r-- | src/ansi.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ansi.rs b/src/ansi.rs index f24708bd..4c7ce5b7 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -627,7 +627,9 @@ impl<'a, H, W> vte::Perform for Performer<'a, H, W> 36 => Attr::Foreground(Color::Named(NamedColor::Cyan)), 37 => Attr::Foreground(Color::Named(NamedColor::White)), 38 => { - if let Some(color) = parse_color(&args[i..], &mut i) { + let mut start = 0; + if let Some(color) = parse_color(&args[i..], &mut start) { + i += start; Attr::Foreground(color) } else { break; @@ -643,7 +645,9 @@ impl<'a, H, W> vte::Perform for Performer<'a, H, W> 46 => Attr::Background(Color::Named(NamedColor::Cyan)), 47 => Attr::Background(Color::Named(NamedColor::White)), 48 => { - if let Some(color) = parse_color(&args[i..], &mut i) { + let mut start = 0; + if let Some(color) = parse_color(&args[i..], &mut start) { + i += start; Attr::Background(color) } else { break; |