comparison mercurial/crecord.py @ 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 66fc05ff0ea3
comparison
equal deleted inserted replaced
41992:fa3b0ca9d74f 41993:cde5827d09a7
1762 try: 1762 try:
1763 curses.use_default_colors() 1763 curses.use_default_colors()
1764 except curses.error: 1764 except curses.error:
1765 self.usecolor = False 1765 self.usecolor = False
1766 1766
1767 # In some situations we may have some cruft left on the "alternate
1768 # screen" from another program (or previous iterations of ourself), and
1769 # we won't clear it if the scroll region is small enough to comfortably
1770 # fit on the terminal.
1771 self.stdscr.clear()
1772
1767 # available colors: black, blue, cyan, green, magenta, white, yellow 1773 # available colors: black, blue, cyan, green, magenta, white, yellow
1768 # init_pair(color_id, foreground_color, background_color) 1774 # init_pair(color_id, foreground_color, background_color)
1769 self.initcolorpair(None, None, name="normal") 1775 self.initcolorpair(None, None, name="normal")
1770 self.initcolorpair(curses.COLOR_WHITE, curses.COLOR_MAGENTA, 1776 self.initcolorpair(curses.COLOR_WHITE, curses.COLOR_MAGENTA,
1771 name="selected") 1777 name="selected")