1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-21 11:50:42 +03:00

debug overlay: avoid stair case when printing log messages

Need to normalize \n to \r\n so that `wezterm.log_error("foo\nbar")`
shows up correctly in the overlay.
This commit is contained in:
Wez Furlong 2022-05-25 07:33:47 -07:00
parent e298bb7a11
commit 8cce462780

View File

@ -115,7 +115,10 @@ pub fn show_debug_overlay(mut term: TermWizTerminal, gui_win: GuiWin) -> anyhow:
changes.push(AttributeChange::Intensity(Intensity::Bold).into());
changes.push(Change::Text(format!(" {}", entry.target)));
changes.push(Change::AllAttributes(CellAttributes::default()));
changes.push(Change::Text(format!(" > {}\r\n", entry.msg)));
changes.push(Change::Text(format!(
" > {}\r\n",
entry.msg.replace("\n", "\r\n")
)));
}
term.render(&changes)
}