Index: packages/Python/lldbsuite/test/help/TestHelp.py =================================================================== --- packages/Python/lldbsuite/test/help/TestHelp.py +++ packages/Python/lldbsuite/test/help/TestHelp.py @@ -230,3 +230,12 @@ 'command alias --long-help "I am a very friendly alias" -- averyfriendlyalias help') self.expect("help averyfriendlyalias", matching=True, substrs=['I am a very friendly alias']) + @no_debug_info_test + def test_help_format_output(self): + """Test that help output reaches TerminalWidth.""" + self.runCmd( + 'settings set term-width 108') + self.expect( + "help format", + matching=True, + substrs=[' -- One of the format names']) Index: source/Interpreter/CommandInterpreter.cpp =================================================================== --- source/Interpreter/CommandInterpreter.cpp +++ source/Interpreter/CommandInterpreter.cpp @@ -2569,7 +2569,7 @@ while (!text.empty()) { if (text.front() == '\n' || - (text.front() == ' ' && nextWordLength(text.ltrim(' ')) < chars_left)) { + (text.front() == ' ' && nextWordLength(text.ltrim(' ')) > chars_left)) { strm.EOL(); strm.Indent(); chars_left = max_columns - indent_size;