Skip to content

Commit

Permalink
Use wrap_at_eol when ENABLE_VIRTUAL_TERMINAL_PROCESSING is set
Browse files Browse the repository at this point in the history
Fix #738
  • Loading branch information
gwenn authored Oct 21, 2023
1 parent ebbd5c1 commit f9e1538
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/tty/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down

0 comments on commit f9e1538

Please sign in to comment.