docs: def _N_lines():
          ''' Determine how many lines to print, such that the number of items
              displayed will fit on the terminal (i.e one 'screen-ful' of items)
  
              This looks at the environmental prompt variable, and tries to determine
              how many lines it takes up.
  
              On Windows, it does this by looking for the '$_' sequence, which indicates
              a new line, in the environmental variable PROMPT.
  
              Otherwise, it looks for a newline ('\n') in the environmental variable
              PS1.
          '''
          lines_in_prompt = 1     # prompt is assumed to take up one line, even
                                  #   without any newlines in it
          if "win32" in sys.platform:
              lines_in_prompt += 1  # Windows will typically print a free line after
                                    #   the program output
              a = re.findall(r'\$_', os.getenv('PROMPT', ''))
              lines_in_prompt += len(a)
          else:
              a = re.findall('\\n', os.getenv('PS1', ''))
              lines_in_prompt += len(a)
          n_lines = get_terminal_size().lines - lines_in_prompt
  
          # print a minimum of one item
          n_lines = max(n_lines, 1)
  
          return n_lines