Using XDG_CONFIG_HOME or .config isn't right on mac #2567
Replies: 2 comments 6 replies
-
Thanks for opening a discussion on this @nico. I'm in agreement that we should support the application support directory. I'm not 100% sure how yet (as in the semantics of it). So if we can figure that out in this discussion thread I'd be happy to convert to an issue and tag it appropriately. Plenty of macOS software supports XDG directories too (usually cross-platform tools and not GUI tools). I think it'd be good for Ghostty to continue supporting it. So I think my main question is: what do we do if the user has a config file in both XDG and Application Support? Ghostty supports config merging so we can load both, but then what order? Any thoughts? |
Beta Was this translation helpful? Give feedback.
-
Created #2634 to track this. |
Beta Was this translation helpful? Give feedback.
-
XDG_CONFIG_HOME and .config are Linux-isms, or at least not-native-mac-app-isms.
https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW1
The path to that can be accessed with
FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask)
, it'll get a subdirectory based on the app bundle's CFBundleIdentifier (in Info.plist –com.mitchellh.ghostty
for Ghostty.)(https://developer.apple.com/documentation/foundation/nssearchpathdirectory/nsapplicationsupportdirectory?language=objc is the constant for "Application Support", https://developer.apple.com/documentation/foundation/nsfilemanager/1407693-urlfordirectory?language=objc has a code snippet.)
Beta Was this translation helpful? Give feedback.
All reactions