dotfiles/config/powerline-shell/segments/exit_code.py

11 lines
343 B
Python
Raw Normal View History

2021-04-20 11:12:35 +00:00
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)