@@ -1300,8 +1300,14 @@ def print_to(
13001300 :param sep: string to write between printed text. Defaults to " ".
13011301 :param end: string to write at end of printed text. Defaults to a newline.
13021302 :param style: optional style to apply to output
1303- :param soft_wrap: Enable soft wrap mode. If True, lines of text will not be
1304- word-wrapped or cropped to fit the terminal width. Defaults to True.
1303+ :param soft_wrap: Enable soft wrap mode. Defaults to True.
1304+ If True, text that doesn't fit will run on to the following line,
1305+ just like with print(). This is useful for raw text and logs.
1306+ If False, Rich wraps text to fit the terminal width.
1307+ Set this to False when printing structured Renderables like
1308+ Tables, Panels, or Columns to ensure they render as expected.
1309+ For example, when soft_wrap is True Panels truncate text
1310+ which is wider than the terminal.
13051311 :param emoji: If True, Rich will replace emoji codes (e.g., :smiley:) with their
13061312 corresponding Unicode characters. Defaults to False.
13071313 :param markup: If True, Rich will interpret strings with tags (e.g., [bold]hello[/bold])
@@ -4163,7 +4169,7 @@ def print_topics(self, header: str, cmds: list[str] | None, cmdlen: int, maxcol:
41634169 header_grid = Table .grid ()
41644170 header_grid .add_row (Text (header , style = Cmd2Style .HELP_HEADER ))
41654171 header_grid .add_row (Rule (characters = self .ruler , style = Cmd2Style .TABLE_BORDER ))
4166- self .poutput (header_grid )
4172+ self .poutput (header_grid , soft_wrap = False )
41674173
41684174 # Subtract 1 from maxcol to account for a one-space right margin.
41694175 maxcol = min (maxcol , ru .console_width ()) - 1
@@ -4231,7 +4237,7 @@ def _print_documented_command_topics(self, header: str, cmds: list[str], verbose
42314237 topics_table .add_row (command , cmd_desc )
42324238
42334239 category_grid .add_row (topics_table )
4234- self .poutput (category_grid )
4240+ self .poutput (category_grid , soft_wrap = False )
42354241 self .poutput ()
42364242
42374243 def render_columns (self , str_list : list [str ] | None , display_width : int = 80 ) -> str :
@@ -4528,7 +4534,7 @@ def do_set(self, args: argparse.Namespace) -> None:
45284534 self .last_result [param ] = settable .value
45294535
45304536 self .poutput ()
4531- self .poutput (settable_table )
4537+ self .poutput (settable_table , soft_wrap = False )
45324538 self .poutput ()
45334539
45344540 @classmethod
0 commit comments