dotfiles/config/powerline-shell/segments/exit_code.py
2021-04-20 13:12:35 +02:00

10 lines
343 B
Python

from ..utils import BasicSegment
class Segment(BasicSegment):
def add_to_powerline(self):
if self.powerline.args.prev_error == 0:
return
fg = self.powerline.theme.CMD_FAILED_FG
bg = self.powerline.theme.CMD_FAILED_BG
self.powerline.append(' %s ' % str(self.powerline.args.prev_error), fg, bg)