From aee417c46a2f6d2aa87ea3fcc799fdc7bc830dfe Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 20 May 2024 10:50:00 +0900 Subject: Respect $NO_COLOR environment variable Close #1762 --- src/options.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/options.go b/src/options.go index 1f81b9de..669feef4 100644 --- a/src/options.go +++ b/src/options.go @@ -481,6 +481,13 @@ func defaultPreviewOpts(command string) previewOpts { } func defaultOptions() *Options { + var theme *tui.ColorTheme + if os.Getenv("NO_COLOR") != "" { + theme = tui.NoColorTheme() + } else { + theme = tui.EmptyTheme() + } + return &Options{ Bash: false, Zsh: false, @@ -502,7 +509,7 @@ func defaultOptions() *Options { Multi: 0, Ansi: false, Mouse: true, - Theme: tui.EmptyTheme(), + Theme: theme, Black: false, Bold: true, MinHeight: 10, -- cgit v1.2.3