Skip to content

Commit bc7fa0c

Browse files
committed
Fit topics table within screen width.
1 parent 5c689c5 commit bc7fa0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd2/cmd2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4148,7 +4148,8 @@ def print_topics(self, header: str, cmds: list[str] | None, cmdlen: int, maxcol:
41484148
self.poutput(header_grid)
41494149

41504150
# Subtract 1 from maxcol to account for a one-space right margin.
4151-
self.columnize(cmds, maxcol - 1)
4151+
maxcol = min(maxcol, ru.console_width()) - 1
4152+
self.columnize(cmds, maxcol)
41524153
self.poutput()
41534154

41544155
def _print_documented_command_topics(self, header: str, cmds: list[str], verbose: bool) -> None:

0 commit comments

Comments
 (0)