diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2024-05-20 10:50:00 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-05-20 10:50:00 +0900 |
| commit | aee417c46a2f6d2aa87ea3fcc799fdc7bc830dfe (patch) | |
| tree | a9400be9c02b13a3c97046e6bbc8a2d23ab172a0 /src/options.go | |
| parent | 04db44067dd4d9bf7f85ae4d704e740d7420f957 (diff) | |
| download | fzf-aee417c46a2f6d2aa87ea3fcc799fdc7bc830dfe.tar.gz | |
Respect $NO_COLOR environment variable
Close #1762
Diffstat (limited to 'src/options.go')
| -rw-r--r-- | src/options.go | 9 |
1 files changed, 8 insertions, 1 deletions
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, |
