GithubHelp home page GithubHelp logo

Respect XDG basedir spec about debug HOT 7 OPEN

jasonkarns avatar jasonkarns commented on May 29, 2024 1
Respect XDG basedir spec

from debug.

Comments (7)

ko1 avatar ko1 commented on May 29, 2024

We need to make migration plan.
~/.rdbgrc (and so on) are already there so we need to respect current files.

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 #4275 proposes:

~/.vimrc
~/.vim/vimrc
$XDG_CONFIG_DIR/vim/vimrc (if the env var is unset, its default is ~/.config)

For rdbgrc, making searching order as

~/.rdbgrc
$XDG_RUNTIME_DIR/rdbg/config if `XDG_RUNTIME_DIR` is available

is one idea.

For ~/.rdbg_histroy there are two options:

  1. search ~/.rdbg_history and $XDG_STATE_HOME/rdbg/history if $XDG_STATE_HOME is available
  2. use $XDG_STATE_HOME/rdbg/history and ignore existing ~/.rdbg_history if $XDG_STATE_HOME is available
    2.1. with warning

Could you survey another software migration plan?

BTW my Ubuntu 24.04 machines only have the following XDG envvals:

XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_RUNTIME_DIR=/run/user/1000

Who set config dir and state dir?

from debug.

ko1 avatar ko1 commented on May 29, 2024

BTW (2) I found NVIM_APPNAME to change the app name (and we can switch configurations at once). Should we support it with RUBY_DEBUG_APPNAME or something similar?

from debug.

jgarber623 avatar jgarber623 commented on May 29, 2024

Some thoughts on this issue based on @ko1's comments above:

For rdbgrc, making searching order as

~/.rdbgrc
$XDG_RUNTIME_DIR/rdbg/config if `XDG_RUNTIME_DIR` is available

is one idea.

I'd expect to create a config file in $XDG_CONFIG_HOME (e.g. ~/.config) at a path like $XDG_CONFIG_HOME/rdbg/config. I believe that more closely follows patterns details on the XDG page on the Arch wiki.

For ~/.rdbg_histroy there are two options:

  1. search ~/.rdbg_history and $XDG_STATE_HOME/rdbg/history if $XDG_STATE_HOME is available
  2. use $XDG_STATE_HOME/rdbg/history and ignore existing ~/.rdbg_history if $XDG_STATE_HOME is available
    2.1. with warning

I think $XDG_DATA_HOME (e.g. ~/.local/share) is the more appropriate place for history files. Similar to my note above, the XDG page on the Arch wiki cites a number of examples using $XDG_DATA_HOME for history files.

from debug.

ko1 avatar ko1 commented on May 29, 2024

Thank you.

Next we need to define the search order.

from debug.

jgarber623 avatar jgarber623 commented on May 29, 2024

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. ~/.rdbg_history) if present. Otherwise, search for the $XDG_*-prefixed file path.

So, a restated version of @ko1's proposal above:

  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

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.

from debug.

ko1 avatar ko1 commented on May 29, 2024

Thank you. I'll make it (or PR is welecome)

from debug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.