From 8e0c15a453079a46b7f3bf9b29ef591d68b90173 Mon Sep 17 00:00:00 2001 From: Kevin Vigor Date: Fri, 19 Apr 2024 17:43:15 -0600 Subject: [PATCH] Override crossterm's support for NO_COLOR. Since helix isn't usable without color support, honoring this does nobody any good. --- helix-tui/src/backend/crossterm.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs index 37721e896533..c5c95bff0b83 100644 --- a/helix-tui/src/backend/crossterm.rs +++ b/helix-tui/src/backend/crossterm.rs @@ -91,6 +91,10 @@ where W: Write, { pub fn new(buffer: W, config: &EditorConfig) -> CrosstermBackend { + // helix is not usable without colors, but crossterm will disable + // them by default if NO_COLOR is set in the environment. Override + // this behaviour. + crossterm::style::force_color_output(true); CrosstermBackend { buffer, capabilities: Capabilities::from_env_or_default(config),