m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-15 23:03:47 -05:00

Respect $NO_COLOR environment variable

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

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,