diff --git a/powerline/renderers/zsh_prompt.py b/powerline/renderers/zsh_prompt.py new file mode 100644 index 00000000..fe86c1bb --- /dev/null +++ b/powerline/renderers/zsh_prompt.py @@ -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) + '%}'