Skip to content

Commit 69a2706

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. (cherry picked from commit e618eb8)
1 parent 4ee8da7 commit 69a2706

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
@@ -1839,9 +1839,13 @@ void Debugger::HandleProgressEvent(const lldb::EventSP &event_sp) {
18391839
if (!output.GetIsInteractive() || !output.GetIsTerminalWithColors())
18401840
return;
18411841

1842+
// Print over previous line, if any.
1843+
output.Printf("\r");
1844+
18421845
if (data->GetCompleted()) {
18431846
// Clear the current line.
1844-
output.Printf("\33[2K\r");
1847+
output.Printf("\x1B[2K");
1848+
output.Flush();
18451849
return;
18461850
}
18471851

@@ -1851,9 +1855,6 @@ void Debugger::HandleProgressEvent(const lldb::EventSP &event_sp) {
18511855
output.Printf(
18521856
"%s", ansi::FormatAnsiTerminalCodes(ansi_prefix, use_color).c_str());
18531857

1854-
// Print over previous line, if any.
1855-
output.Printf("\r");
1856-
18571858
// Print the progress message.
18581859
std::string message = data->GetMessage();
18591860
if (data->GetTotal() != UINT64_MAX) {

0 commit comments

Comments
 (0)