def main_cli(self, stdscr):
        # Block each getch() for 10 tenths of a second
        curses.halfdelay(10)
        # Visibility 0 is invisible
        curses.curs_set(0)

        try:
            while True:
                ps_str = self.get_ps_str()
                lines = ps_str.split('\n')

                max_y, max_x = stdscr.getmaxyx()
                stdscr.erase()
                for i, line in enumerate(lines):
                    # We don't want to draw on the last line because the
                    # Press q to exit message goes there
                    if i >= max_y - 1:
                        break
                    stdscr.addstr(i, 0, line[:max_x])
                # Assumes that terminal size is greater than 15 character
                # Will crash otherwise...but who uses terminals 15 characters wide?
                stdscr.addstr(max_y - 1, 0, 'Press q to exit', curses.A_REVERSE)
                stdscr.refresh()

                if stdscr.getch() == ord('q'):
                    break
        except __HOLE__:
            pass
dataset/ETHPy150Open memsql/memsql-loader/memsql_loader/cli/ps.py/Processes.main_cli