summaryrefslogtreecommitdiff
path: root/tcvt.py
diff options
context:
space:
mode:
Diffstat (limited to 'tcvt.py')
-rwxr-xr-xtcvt.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tcvt.py b/tcvt.py
index f1af84e..3cdb957 100755
--- a/tcvt.py
+++ b/tcvt.py
@@ -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)