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

Directories on macOS #151

Closed
ahti opened this issue May 23, 2018 · 3 comments
Closed

Directories on macOS #151

ahti opened this issue May 23, 2018 · 3 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@ahti
Copy link

ahti commented May 23, 2018

On macOS, config files (themes, syntaxes) currently need to be placed in ~/Library/Preferences/bat. While this is where macOS GUI applications store their preferences, I have not seen many (or any? I'm not sure) command line tools that use ~/Library/Preferences. Looking at my home folder, cli tools seem to, generally, use either dotfiles in home or ~/.config.

I'd prefer if bat searched for config files in ~/.config/bat on macOS just like on Linux. While it may not be the "correct" way to choose directories on macOS, it seems to be convention and would make things like sharing a dotfiles repo between Linux and macOS much more convenient.

@sharkdp
Copy link
Owner

sharkdp commented May 24, 2018

bat currently uses the directories library to determine where to store configuration files and cached files. On macOS, it seems to follow the Standard Directories guidelines (which advocates ~/Library).

If using .config is indeed a quasi-standard for command-line tools on macOS, I'd be happy to change this. On the other hand, it would be a shame if we would have to create a special-case for macOS (instead of using the directories crate).

Related discussion: https://github.com/rust-lang-nursery/cli-wg/issues/7

@sharkdp sharkdp added help wanted Extra attention is needed question Further information is requested labels May 24, 2018
@ghuls
Copy link

ghuls commented May 25, 2018

@ahti
Probably the reason why most CLI tools store there settings in ~/.config is because they are ported from Linux/BSD and follow XDG Base Directory Specification: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

I don't know if directories supports it or not, but it theoretically could support XDG paths when you set all those XDG variables on MacOS.

For now, just make a symlink:

ln -s ../Library/Preferences/bat ~/.config/bat

@sharkdp
Copy link
Owner

sharkdp commented Aug 19, 2018

I'm going to close this ticket for now, as it seems to me that (1) we are actually following the standard guidelines for macOS and (2) there is an easy workaround.

I'm happy to re-open this ticket if there is a strong support to change this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants