Skip to content
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

Adopt XDG spec or add option to overwrite histfile location (.drgn_history) #469

Open
septatrix opened this issue Mar 5, 2025 · 2 comments
Labels
good first issue Good for newcomers help wanted Seeking volunteers

Comments

@septatrix
Copy link
Contributor

It would be great if drgn could follow the XDG spec and place its history file somewhere under ~/.local/ or at least offer an option to overwrite the default location, e.g. like $HISTFILE for bash

@osandov
Copy link
Owner

osandov commented Mar 5, 2025

This sounds reasonable.

Apparently the XDG spec didn't have a standard place to put history files when I added ~/.drgn_history back in 2018 (0a089e6). But the May 2021 revision added XDG_STATE_HOME for that purpose.

Let's change it to $XDG_STATE_HOME/drgn/history, where $XDG_STATE_HOME defaults to ~/.local/state per the spec. In terms of migration, if we don't find $XDG_STATE_HOME/drgn/history but we do find ~/.drgn_history, we can move it to the new location, at least for a few releases.

@osandov osandov added help wanted Seeking volunteers good first issue Good for newcomers labels Mar 5, 2025
@brenns10
Copy link
Contributor

brenns10 commented Mar 5, 2025

As a note, I believe the contrib/ptdrgn.py script has its own history file which should probably get the same treatment. If it's not part of this I can follow up with it too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Seeking volunteers
Projects
None yet
Development

No branches or pull requests

3 participants