diff options
Diffstat (limited to 'tcvt.py')
-rwxr-xr-x | tcvt.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -90,6 +90,9 @@ class Simple: def attron(self, attr): self.screen.attron(attr) + def attroff(self, attr): + self.screen.attroff(attr) + def clrtoeol(self): self.screen.clrtoeol() @@ -223,6 +226,9 @@ class Columns: def attron(self, attr): self.attrs |= attr + def attroff(self, attr): + self.attrs &= ~attr + def clrtoeol(self): self.curwin.clrtoeol() @@ -603,15 +609,19 @@ class Terminal: self.screen.attrset(0) elif 30 <= code <= 37: self.fg = code - 30 + self.screen.attroff(curses.A_COLOR) self.screen.attron(get_color(self.fg, self.bg)) elif code == 39: self.fg = 7 + self.screen.attroff(curses.A_COLOR) self.screen.attron(get_color(self.fg, self.bg)) elif 40 <= code <= 47: self.bg = code - 40 + self.screen.attroff(curses.A_COLOR) self.screen.attron(get_color(self.fg, self.bg)) elif code == 49: self.bg = 0 + self.screen.attroff(curses.A_COLOR) self.screen.attron(get_color(self.fg, self.bg)) else: raise ValueError("feed esc [ %r m" % code) |