fixed non-printable character messing up width of text

This commit is contained in:
Daniel Knuettel 2024-04-17 09:54:09 +02:00
parent af84040321
commit c05c7874e3

View File

@ -166,7 +166,7 @@ fn get_editor() -> String
fn shell_color_str<T: std::fmt::Display>(string_in: &T, color: &str) -> String fn shell_color_str<T: std::fmt::Display>(string_in: &T, color: &str) -> String
{ {
format!("\x1b[{color}m{string_in}\x1b[00m") format!("\x01\x1b[{color}m\x02{string_in}\x01\x1b[00m\x02")
} }
fn getenv(varname: &str) -> String fn getenv(varname: &str) -> String