Update terminal rendering for bash
This commit is contained in:
parent
fd94c7c0ba
commit
a091d04a8c
|
@ -9,14 +9,13 @@ class TerminalRenderer(Renderer):
|
||||||
'''Powerline terminal segment renderer.'''
|
'''Powerline terminal segment renderer.'''
|
||||||
_color_templates = {
|
_color_templates = {
|
||||||
'default': '[{code}m',
|
'default': '[{code}m',
|
||||||
'bash': '\[[{code}m\]',
|
|
||||||
'zsh': '%{{[{code}m%}}',
|
'zsh': '%{{[{code}m%}}',
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(TerminalRenderer, self).__init__(*args, **kwargs)
|
super(TerminalRenderer, self).__init__(*args, **kwargs)
|
||||||
shell = os.path.basename(os.environ.get('SHELL', 'default'))
|
shell = os.path.basename(os.environ.get('SHELL'))
|
||||||
self.color_template = self._color_templates[shell]
|
self.color_template = self._color_templates.get(shell, self._color_templates['default'])
|
||||||
|
|
||||||
def hl(self, fg=None, bg=None, attr=None):
|
def hl(self, fg=None, bg=None, attr=None):
|
||||||
'''Highlight a segment.
|
'''Highlight a segment.
|
||||||
|
|
Loading…
Reference in New Issue