Unnamed repository; edit this file 'description' to name the repository.
Override crossterm's support for NO_COLOR. (#10514)
Since helix isn't usable without color support, honoring this does nobody any good.
Kevin Vigor 2024-04-20
parent 94405f3 · commit 18d5cac
-rw-r--r--helix-tui/src/backend/crossterm.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs
index 37721e89..c5c95bff 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<W> {
+ // 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),