Remove x1b, update prompt (#3291)

* add term size command

* remove \x1b and use nu_ansi_term, make prompt with no config prettier
This commit is contained in:
Darren Schroeder
2021-04-09 11:38:56 -05:00
committed by GitHub
parent 556596bce8
commit 0b5e131410
5 changed files with 29 additions and 6 deletions

View File

@ -252,13 +252,17 @@ pub fn wrap<'a>(
};
if let Some(leading_match) = re_leading.find(&current_line.clone()) {
String::insert_str(&mut current_line, leading_match.end(), "\x1b[0m");
String::insert_str(
&mut current_line,
leading_match.end(),
nu_ansi_term::ansi::RESET,
);
String::insert_str(&mut current_line, leading_match.start(), &bg_color_string);
}
if let Some(trailing_match) = re_trailing.find(&current_line.clone()) {
String::insert_str(&mut current_line, trailing_match.start(), &bg_color_string);
current_line += "\x1b[0m";
current_line += nu_ansi_term::ansi::RESET;
}
output.push(WrappedLine {