diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -534,8 +534,6 @@ if util.safehasattr(signal, 'SIGTSTP'): origsigtstp = signal.getsignal(signal.SIGTSTP) try: - import pdb - pdb.set_trace() curses.wrapper(chunkselector.main) if chunkselector.initexc is not None: raise chunkselector.initexc @@ -1765,6 +1763,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")