Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAT_CONFIG_DIR not being honored on macOS? #419

Closed
mcmillion opened this issue Nov 16, 2018 · 6 comments
Closed

BAT_CONFIG_DIR not being honored on macOS? #419

mcmillion opened this issue Nov 16, 2018 · 6 comments
Labels
good first issue Good for newcomers question Further information is requested

Comments

@mcmillion
Copy link

I'm try to get a custom theme set up and I'd like to use ~/.config/bat as the location for these files. Here's what I'm seeing:

➜ echo $BAT_CONFIG_DIR
/Users/mcmillion/.config/bat

➜ bat cache --init
No themes were found in '/Users/mcmillion/Library/Preferences/bat/themes', using the default set
No syntaxes were found in '/Users/mcmillion/Library/Preferences/bat/syntaxes', using the default set.
Writing theme set to /Users/mcmillion/Library/Caches/bat/themes.bin ... okay
Writing syntax set to /Users/mcmillion/Library/Caches/bat/syntaxes.bin ... okay

➜ bat cache --config-dir
/Users/mcmillion/Library/Preferences/bat

BAT_CONFIG_PATH does seem to be working just fine, however. Am I just misunderstanding how this configuration option is supposed to work? I'd definitely like to keep things under ~/.config as that's the convention and having to symlink things to ~/Library on various machines feels wrong.

@sharkdp
Copy link
Owner

sharkdp commented Nov 19, 2018

Thank you very much for the feedback.

BAT_CONFIG_DIR is a variable that I have used in the README to make the use of bat cache --config-dir clear. It is not actually a configuration option for bat (i.e. bat will never read this environment variable).

Currently, there is no way to control the directory where user-customized themes and syntaxes are found (Note that - perhaps confusingly - there is a BAT_CONFIG_PATH environment variable that can be used to control where bats configuration file is stored).

The discussion about ~/Library being used on macOS came up a few times in past tickets. I think we should simply change the default for macOS to be ~/.config/bat. Opinions?

@sharkdp sharkdp added help wanted Extra attention is needed question Further information is requested labels Nov 19, 2018
@lavifb
Copy link
Contributor

lavifb commented Nov 30, 2018

As far as I can tell, ~/Library is mostly used for regular GUI Mac apps. For command line applications like bat, usually you use ~/.config/bat or ~/.bat. I tend to prefer ~/.config/bat because otherwise your home directory gets very littered with config files.

@sharkdp
Copy link
Owner

sharkdp commented Dec 2, 2018

Ok, let's change this to ~/.config/bat for all non-Windows OSes.

@sharkdp sharkdp added good first issue Good for newcomers and removed help wanted Extra attention is needed labels Dec 2, 2018
@lavifb
Copy link
Contributor

lavifb commented Dec 2, 2018

To reply to the original question, would you consider either changing the variable name in the README or excluding it entirely (using maybe "$(bat cache --config-dir)/themes")? The current name in the example, BAT_CONFIG_DIR, is formatted like a configuration option which probably leads to the above confusion.

@sharkdp
Copy link
Owner

sharkdp commented Dec 2, 2018

Sounds like a good idea. Let's remove it completely and "inline" $(bat cache --config-dir).

@sharkdp
Copy link
Owner

sharkdp commented Dec 7, 2018

This issue has been resolved in #435. I'll open a second ticket for changing the config path to ~/.config/bat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants