Respect $NO_COLOR environment variable

Close #1762
This commit is contained in:
Junegunn Choi committed 2024-05-20 10:50:00 +09:00
1 parent 04db44067d
commit aee417c46a
2 files changed
+9 -2

No files matched your search

+8 -1
View File
@@ -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,