From f9e15385387881ad36fc89472916a7d25208ce07 Mon Sep 17 00:00:00 2001 From: gwenn <45554+gwenn@users.noreply.github.com> Date: Sat, 21 Oct 2023 09:28:57 +0200 Subject: [PATCH] Use wrap_at_eol when ENABLE_VIRTUAL_TERMINAL_PROCESSING is set Fix #738 --- src/tty/windows.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tty/windows.rs b/src/tty/windows.rs index 296e83df3..caba851a5 100644 --- a/src/tty/windows.rs +++ b/src/tty/windows.rs @@ -427,6 +427,11 @@ impl Renderer for ConsoleRenderer { col = self.wrap_at_eol(&highlighter.highlight_prompt(prompt, default_prompt), col); // append the input line col = self.wrap_at_eol(&highlighter.highlight(line, line.pos()), col); + } else if self.colors_enabled { + // append the prompt + col = self.wrap_at_eol(prompt, col); + // append the input line + col = self.wrap_at_eol(line, col); } else { // append the prompt self.buffer.push_str(prompt); @@ -437,6 +442,8 @@ impl Renderer for ConsoleRenderer { if let Some(hint) = hint { if let Some(highlighter) = highlighter { self.wrap_at_eol(&highlighter.highlight_hint(hint), col); + } else if self.colors_enabled { + self.wrap_at_eol(hint, col); } else { self.buffer.push_str(hint); }