Update terminal rendering for bash

This commit is contained in:
Kim Silkebækken 2013-01-17 09:42:15 +01:00
parent fd94c7c0ba
commit a091d04a8c
1 changed files with 2 additions and 3 deletions

View File

@ -9,14 +9,13 @@ class TerminalRenderer(Renderer):
'''Powerline terminal segment renderer.'''
_color_templates = {
'default': '[{code}m',
'bash': '\[[{code}m\]',
'zsh': '%{{[{code}m%}}',
}
def __init__(self, *args, **kwargs):
super(TerminalRenderer, self).__init__(*args, **kwargs)
shell = os.path.basename(os.environ.get('SHELL', 'default'))
self.color_template = self._color_templates[shell]
shell = os.path.basename(os.environ.get('SHELL'))
self.color_template = self._color_templates.get(shell, self._color_templates['default'])
def hl(self, fg=None, bg=None, attr=None):
'''Highlight a segment.