Add zsh prompt renderer
Zsh can use regular escape sequences in the prompt, but they must be wrapped in %{...%} to work correctly. Refs #84.
This commit is contained in:
parent
0b385a11e0
commit
2eb07e894e
|
@ -0,0 +1,14 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from powerline.renderers.shell import ShellRenderer
|
||||
|
||||
|
||||
class ZshPromptRenderer(ShellRenderer):
|
||||
'''Powerline zsh prompt segment renderer.'''
|
||||
def hl(self, fg=None, bg=None, attr=None):
|
||||
'''Highlight a segment.
|
||||
|
||||
Returns the default ShellRenderer escape sequence with %{...%} wrapped
|
||||
around it (required in zsh prompts).
|
||||
'''
|
||||
return '%{' + super(ZshPromptRenderer, self).hl(fg, bg, attr) + '%}'
|
Loading…
Reference in New Issue