-
Notifications
You must be signed in to change notification settings - Fork 127
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
Respect XDG basedir spec #1031
Comments
We need to make migration plan. On the vim/vim#4275, it was closed because of duplication of vim/vim#2034 which has huge comments and not accepted (I can't read all of comments) but
For rdbgrc, making searching order as
is one idea. For
Could you survey another software migration plan? BTW my Ubuntu 24.04 machines only have the following XDG envvals:
Who set config dir and state dir? |
BTW (2) I found |
Some thoughts on this issue based on @ko1's comments above:
I'd expect to create a config file in
I think |
Thank you. Next we need to define the search order. |
I took a quick glance at the entries in sections 2.2 and 2.3 on the Arch wiki and, where noted, it looks like most apps prefer the "legacy" file (e.g. So, a restated version of @ko1's proposal above:
For the history file:
¹ There'd need to be a check for this file path. If it exists, great! If not, create the path |
Thank you. I'll make it (or PR is welecome) |
This commit implements XDG directory support for this gem's history file in accordance with the rules outlined in ruby#1031: > For the history file: > > 1. prefer `~/.rdbg_history` if present, > 2. else, `$XDG_DATA_HOME/rdbg/history` if `$XDG_DATA_HOME` is set¹ > > ¹ There'd need to be a check for this file path. If it exists, great! > If not, create the path `$XDG_DATA_HOME/rdbg` and touch > `$XDG_DATA_HOME/rdbg/history`. See: ruby#1031 (comment)
This commit implements XDG directory support for this gem's `.rdbgrc` configuration file in accordance with the rules outlined in ruby#1031: > 1. prefer `~/.rdbgrc` if present, > 2. else, `$XDG_CONFIG_HOME/rdbg/config` if `$XDG_CONFIG_HOME` is set > and `$XDG_CONFIG_HOME/rdbg/config` is present, > 3. else, no customized user configuration See: ruby#1031 (comment)
Your proposal
I propose that debug respect the XDG Base Directory Specification such that files are written to locations controlled by user environment variables.
There are at least three relevant files:
Presently, the history file may be forced into a different location with the
RUBY_DEBUG_HISTORY_FILE
env var. While helpful, this does not adhere to the desire for single-configuration (setting XDG_* vars once and not needing to configure each of hundreds of different utilities). It should default to a file or directory inXDG_STATE_HOME
(which itself defaults to$HOME/.local/state
)The unix_domain_socket_dir is already very nearly adhering to Xdg, as its first implicit location (after checking explicit config setting) uses
XDG_RUNTIME_DIR
.The rdbgrc (and .rb variant) have no env var equivalents and so cannot even be set explicitly. However, they should be using files within
XDG_CONFIG_HOME
(which defaults to$HOME/.config
). Perhaps$XDG_CONFIG_HOME/rdbg/config
or$XDG_CONFIG_HOME/rdbg/config.rb
?Additional context
The Xdg basedir spec is here: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Rationale
The text was updated successfully, but these errors were encountered: