Add support for italic and underline attributes in shell renderer

This commit is contained in:
ZyX 2013-02-11 07:50:23 +04:00 committed by Kim Silkebækken
parent e18665c5fe
commit 52635d05ae
1 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,12 @@ class ShellRenderer(Renderer):
else:
if attr & ATTR_BOLD:
ansi += [1]
elif attr & ATTR_ITALIC:
# Note: is likely not to work or even be inverse in place of
# italic. Omit using this in colorschemes.
ansi += [3]
elif attr & ATTR_UNDERLINE:
ansi += [4]
return self.escape_hl_start + '[{0}m'.format(';'.join(str(attr) for attr in ansi)) + self.escape_hl_end
@staticmethod