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
Support XDG base directory specification for locating curlrc #5829
Comments
curl also reads |
I mean you could always move .ssh out to XDG directories wouldn't you? |
You certainly cannot do any such thing unless ssh decides to support that first. (It does not, and will not -- the openssh developers perspective on this is that root needs to know where the ssh configuration is, and therefore it cannot be configurable via an environment variable.) |
curl currently looks on Linux and othe unixes at the file ~/.curlrc for its default
--config
file. Clutter directly in $HOME is considered by many users to be undesirable. It makes it hard to distinguish between documents, configuration, and caches, complicates e.g. "dotfiles" repositories, and makes it hard to nuke cache data that can be safely deleted at the cost of making the program work to recreate it.Some history on dotfiles as a Unix feature seems appropriate: https://web.archive.org/web/20190320095434/https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp
Windows solves this by using %APPDATA% (and curl respects that). Linux established the XDG Base Directory Specification for this:
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
https://ploum.net/207-modify-your-application-to-use-xdg-folders/
tl;dr
$XDG_CONFIG_HOME
is the preferred location for config data.$XDG_CACHE_HOME
is not relevant to curl, I believe.Use
${XDG_CONFIG_HOME:-$HOME/.config}/curlrc
, if the user created it.(If the variable does not exist, it is assumed to be
$HOME/.config
.)For backwards compat, if the above does not exist but the previous location
~/.curlrc
does exist, use that.For backwards compat, if
$CURL_HOME
exists it should probably override$XDG_CONFIG_HOME
.curl also respects
~/.netrc
which could be similarly looked up in$XDG_CONFIG_HOME
, but I'm not sure how much of a point there is for that, given it itself is intended for compat with other ftp tools.curl/libcurl version
operating system
Linux x86_64
The text was updated successfully, but these errors were encountered: