TabViewer/tabview

Should redraw on Ctrl+L

wavexx opened this issue · 3 comments

Pretty much a standard for console programs.

Does this do what you'd expect? I'm having a hard time mucking up the display to see if it works!

diff --git a/tabview/tabview.py b/tabview/tabview.py
index 7585e93..43972db 100644
--- a/tabview/tabview.py
+++ b/tabview/tabview.py
@@ -662,6 +662,7 @@ class Viewer:
                      curses.KEY_ENTER:  self.show_cell,
                      KEY_CTRL('a'):  self.line_home,
                      KEY_CTRL('e'):  self.line_end,
+                     KEY_CTRL('l'):     self.display,
                      }

     def run(self):

Hi, I ran a shell script that echoes a string every second in the background to "disturb" the screen, and find that calling self.display() (which ultimately calls self.scr.refresh()) didn't work – I assume it's because curses didn't think the in-memory buffer was changed, and so it didn't update the physical screen? Calling self.scr.erase() first then self.scr.refresh() for Ctrl-L works, though.

I think redrawwin() is what's needed here.