-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
This shouldn't use ~/Library/Preferences on macOS #103
Comments
I filed the upstream issue as dirs-dev/directories-rs#62 |
I'm not sure I understand whether there's progress on the soc/directories side. Should I implement the change in broot directly ? |
If soc/directories isn't going to update then it would be a good idea to do it here. I hope they're willing to make the change in the library though. |
Seconding this issue. I've never seen a CLI tool place prefs in that directory. While I appreciate that there is a standard for placement of these kind of files, and that you adhered to that standard, It appears to me that the XDG standard does itself does not take correct MacOS conventions into account. Most tools create a hidden directory directly in the user's home folder. I just did a quick look through my
You get the idea. This is just where CLI apps store configs, despite Apple's documentation, which I believe is focused on GUI apps. To make this more confusing, the standard is a little different when using homebrew, but you might be interested in looking into this method as it may make your life much easier. Homebrew generally keeps all app-related files in a singular app directory ( Obviously this is where your |
soc recently made it clear he wasn't favorable to change his library. If somebody has a clean crate to suggest to handle this, I'd prefer not to code it myself |
Changes were made in the library I use. The right solution for broot seems to be to look first for the new location, then for the second one, and only if both are empty write a new config in the new location. This involves one more lookup at every startup so this would probably be removed at some point between 2050 and 2060. |
I don't have a mac for testing. I really need people to confirm it's OK, or tell me it's not, before I can deploy a new release. You can test the master branch before the release. Don't hesitate to contact me on Miaou if needed. |
I know this was already closed, and I have nothing new to say. Just confirming that IMO there shouldn't be a config file for a CLI tool in |
Just want to document the current behavior. |
Describe the bug
After running broot, it wrote out data to a folder
~/Library/Preferences/org.dystroy.broot/
. This is very surprising. The~/Library/Preferences/
folder contains cfprefsd plists, and it's not somewhere that tools should be writing to directly. I'm also surprised to see it doing this at all since this is a command-line application, not a GUI application, and so it should just use the XDG Base Directory Specification locations instead.If you really want to write to a Mac-like directory, then
~/Library/Application Support/org.dystroy.broot
would be the place to use. But I'd really prefer it to just use the XDG dirs instead, e.g.~/.config/broot/
.To Reproduce
Steps to reproduce the behavior:
broot
Expected behavior
Any configuration it writes out should go to a sane location.
Configuration (please complete the following information):
Additional context
It looks like this directory is coming from the
directories
library. Apple's documentation on ~/Library/Preferences very explicitly says you should not be creating your own files in that directory but only usingNSUserDefaults
orCFPreferences
, and that ~/Library/Application Support is the right place to put configuration files. I will be filing an issue againstdirectories
as well, but in the meantime broot should switch to usingdata_dir()
instead ofconfig_dir()
on macOS.I'm not sure what the migration path for existing configuration will end up being if
directories
fixes their code, since you'll need a way to find the old path in order to migrate stuff. Hopefully thedirectories
library can figure this out.The text was updated successfully, but these errors were encountered: