#343 added attribute to hold rxvt-unicode-256color variable instead of calling os.environ every time the screen is cleared. Also changed 'is not' to != in if statement

This commit is contained in:
Ryan Reno
2017-06-22 19:06:04 -07:00
parent 370cfa0642
commit 7739d31b11

View File

@@ -59,6 +59,7 @@ class Terminal(object):
self.loader = LoadScreen(self) self.loader = LoadScreen(self)
self._display = None self._display = None
self._mailcap_dict = mailcap.getcaps() self._mailcap_dict = mailcap.getcaps()
self._term = os.environ['TERM']
@property @property
def up_arrow(self): def up_arrow(self):
@@ -772,8 +773,8 @@ class Terminal(object):
# Resolves tmux touchwin() bug and urxvt clearok() flashing bug # Resolves tmux touchwin() bug and urxvt clearok() flashing bug
def clear_screen(self): def clear_screen(self):
if os.environ['TERM'] is not 'xterm-256color': if self._term != 'xterm-256color':
self.stdscr.touchwin() self.stdscr.touchwin()
else: else:
self.stdscr.clearok(True) self.stdscr.clearok(True)