Changed backgrounnd ANSI flag from - to [

This commit is contained in:
Kelketek Rritaa 2014-01-26 08:07:58 -06:00
parent 09ee3c3f2c
commit d69f4dc674
2 changed files with 6 additions and 6 deletions

View file

@ -95,7 +95,7 @@ class ANSIParser(object):
return ""
rgbtag = rgbmatch.groups()[0]
background = rgbtag[0] == '-'
background = rgbtag[0] == '['
if background:
red, green, blue = int(rgbtag[1]), int(rgbtag[2]), int(rgbtag[3])
else:
@ -254,9 +254,9 @@ class ANSIParser(object):
xterm256_map = [
(r'%([0-5]{3})', parse_rgb), # %123 - foreground colour
(r'%(-[0-5]{3})', parse_rgb), # %-123 - background colour
(r'%(\[[0-5]{3})', parse_rgb), # %-123 - background colour
(r'{([0-5]{3})', parse_rgb), # {123 - foreground colour
(r'{(-[0-5]{3})', parse_rgb) # {-123 - background colour
(r'{(\[[0-5]{3})', parse_rgb) # {-123 - background colour
]
# obs - order matters here, we want to do the xterms first since