Skip to content

Commit e618eb8

Browse files
committed
[lldb] A few small changes to HandleProgressEvent
Of course I only noticed these things *after* landing the original patch... - Flush the output after clearing the line. - Move up the printing the carriage return to avoid duplication. - Use hexadecimal instead of octal for escape codes.
1 parent 43374be commit e618eb8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lldb/source/Core/Debugger.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,9 +1783,13 @@ void Debugger::HandleProgressEvent(const lldb::EventSP &event_sp) {
17831783
if (!output.GetIsInteractive() || !output.GetIsTerminalWithColors())
17841784
return;
17851785

1786+
// Print over previous line, if any.
1787+
output.Printf("\r");
1788+
17861789
if (data->GetCompleted()) {
17871790
// Clear the current line.
1788-
output.Printf("\33[2K\r");
1791+
output.Printf("\x1B[2K");
1792+
output.Flush();
17891793
return;
17901794
}
17911795

@@ -1795,9 +1799,6 @@ void Debugger::HandleProgressEvent(const lldb::EventSP &event_sp) {
17951799
output.Printf(
17961800
"%s", ansi::FormatAnsiTerminalCodes(ansi_prefix, use_color).c_str());
17971801

1798-
// Print over previous line, if any.
1799-
output.Printf("\r");
1800-
18011802
// Print the progress message.
18021803
std::string message = data->GetMessage();
18031804
if (data->GetTotal() != UINT64_MAX) {

0 commit comments

Comments
 (0)