changeset 41993:cde5827d09a7

crecord: redraw the screen when starting up chunkselector Failure to do this can cause screen corruption like: <headerline> [X] filename.cc <several blank lines> <output from previous iteration of split that happened to be here> I believe this might only happen in some terminals, and maybe only when using the "alternate screen". Regardless of the exact conditions to reproduce, it should be safe to always clear it when starting up and is probably the correct thing to do anyway :) Differential Revision: https://phab.mercurial-scm.org/D6131
author Kyle Lippincott <spectral@google.com>
date Wed, 13 Mar 2019 20:09:56 -0700
parents fa3b0ca9d74f
children 550a172a603b
files mercurial/crecord.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/crecord.py	Wed Mar 13 18:39:45 2019 -0700
+++ b/mercurial/crecord.py	Wed Mar 13 20:09:56 2019 -0700
@@ -1764,6 +1764,12 @@
         except curses.error:
             self.usecolor = False
 
+        # In some situations we may have some cruft left on the "alternate
+        # screen" from another program (or previous iterations of ourself), and
+        # we won't clear it if the scroll region is small enough to comfortably
+        # fit on the terminal.
+        self.stdscr.clear()
+
         # available colors: black, blue, cyan, green, magenta, white, yellow
         # init_pair(color_id, foreground_color, background_color)
         self.initcolorpair(None, None, name="normal")