macOS dotfiles should not go in –/Library/Application Support

https://news.ycombinator.com/rss Hits: 6
Summary

#macOS dotfiles should not go in ~/Library/Application Support One of my pet peeves is when command-line tools look for user configuration files in ~/Library/Application Support when running on macOS. In addition to offering poor ergonomics for users, I believe this behavior is incorrect according to the documentation which is cited to justify it. Instead, command-line tools should implement the XDG Base Directory Specification and look for configuration files in $XDG_CONFIG_HOME, which defaults to ~/.config. Usually, when a program looks for configuration files in ~/Library/Application Support, it’s not because of an intentional design decision. Instead, the author delegated that decision to a library, and several popular libraries for determining platform-specific configuration directories use ~/Library/Application Support as the default configuration directory on macOS, including Python’s platformdirs package (242 million downloads / month), JavaScript’s env-paths (95 million downloads / month), Rust’s dirs crate (4.8 million downloads / month), and Go’s adrg/xdg package (used in 913 packages). While ~/Library/Application Support may be the correct configuration directory for GUI apps which manage their configuration files for the user automatically, the vast majority of applications using these libraries are command-line utilities whose configuration belongs in ~/.config. The main reason I dislike programs looking for dotfiles in ~/Library/Application Support is that it’s unexpected. As Ashlin Eldridge explained on GitHub: As a new user, it’s extremely surprising to me to that a modern tool like nu would put config files under Application Support on macOS. It’s even more surprising to see that some people are actively against adopting the XDG standard. The origins of XDG no longer matter at this point. No one really cares what the X, D, and G stand for. The fact is that hundreds of tools support it (including Git, Emacs, Neovim, Tmux) and users have come to expe...

First seen: 2025-08-26 05:16

Last seen: 2025-08-26 10:17