From 2ae2f2ea9d0656894b6d1beca58fc759728a26dc Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Fri, 4 Sep 2020 14:24:46 -0500 Subject: [PATCH] Ensure ansi mode windows (#2494) * WIP - compiling but not working * semi-working * making progress * working except for table lines * fmt + clippy * cleaned up some comments * working line colors * fmt, clippy, updated sample config.toml * merges * ensure ansi mode is enabled on windows ansi mode sometimes gets out of sync in Windows. I'm not sure why but this appears to fix it. --- crates/nu-table/src/table.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/nu-table/src/table.rs b/crates/nu-table/src/table.rs index 55815f2959..78fdd5211e 100644 --- a/crates/nu-table/src/table.rs +++ b/crates/nu-table/src/table.rs @@ -750,6 +750,11 @@ impl WrappedTable { } fn new_print_table(&self, color_hm: &HashMap) { + #[cfg(windows)] + { + let _ = ansi_term::enable_ansi_support(); + } + if self.data.is_empty() { return; }