From f3deea5abc06f7b22830a313f90929cbd8eac0b0 Mon Sep 17 00:00:00 2001 From: Michael Lazar Date: Tue, 10 Jan 2017 18:36:44 -0800 Subject: [PATCH] Fix bug in tmux when TERM is set to xterm-256color --- rtv/page.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rtv/page.py b/rtv/page.py index d0cef8d..f3dd17a 100644 --- a/rtv/page.py +++ b/rtv/page.py @@ -341,7 +341,14 @@ class Page(object): self._draw_content() self._draw_footer() self._add_cursor() - self.term.stdscr.touchwin() + # Note: There used to be a call to stdscr.touchwin() here. However, a + # bug was discovered in tmux when $TERM was set to `xterm-256color`, + # where only part of the screen got redrawn when scrolling. The correct + # solution is to use `screen-256color` (which gets set automatically by + # tmux) but many people override ther $TERM in their tmux.conf or + # .bashrc file. Using clearok() instead seems to fix the problem, at + # the expense of slightly more expensive screen refreshes. + self.term.stdscr.clearok(True) self.term.stdscr.refresh() def _draw_header(self):