code: def preferred_width(self, cli, max_available_width):
          
          text = token_list_to_text(self._get_tokens_cached(cli))
          line_lengths = [get_cwidth(l) for l in text.split('\n')]
          return max(line_lengths)
docs: Return the preferred width for this control.
          That is the width of the longest line.