code: def terminal_size(self):
          
          try:
              _, columns = os.popen('stty size', 'r').read().split()
              return min(int(columns) - 10, 100)
          except ValueError:
              return self.default_terminal_size
docs: Gets the terminal columns size.