-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
History in XDG_DATA_HOME, configurable via Environment variable #1421
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! I assume you're want this because you don't want the history file in Is XDG_DATA_HOME sufficient for your use case? If so then I would prefer to limit it to that (e.g. because more features means more things to document, and this isn't documented yet) |
Exactly - I prefer to keep any history files in one directory (specifically |
OK sounds good, please remove the other env var and just use XDG_DATA_HOME And revert the Thank you |
Hm actually it sounds like XDG_DATA_HOME isn't enough if you want Setting that would mean a lot of other non-history data is stored there too |
Using this patch, set the |
I noticed, once I installed my patched version on a bare-bones Linux From Scratch system I'd made, that if the directory of the history file is missing, regardless of what it is, it silently fails to save history, so I think my patch needs a bit more work anyway - will close for now, and reopen once I've finished my college finals and had a chance to fix that. |
Hm what shell do you normally use, and how do you point it at your Hm looks like bash and zsh BOTH support the https://linuxhint.com/check-zsh-history/ But does that mean bash and zsh overlap? I don't think they can actually read from the same file I think there is something to do here, but I'm not sure what the right behavior is |
I usually use bash with |
I think one thing we could do is have OSH support plain |
Hi, I'm thinking about this again. I'm thinking of doing it like this:
We can do XDG_DATA_HOME later, but I wonder if that is enough for your use case ? (Project was slightly renamed - https://www.oilshell.org/blog/2023/03/rename.html ) |
Although I guess bash and zsh put it in Fish follows that style, so I think we can do that
|
I created a modified version of 0.12.8, then ported my changes to 0.12.9, that changes the history file path to have the following behavior:
If
$HISTFILE_OIL
/$HISTFILE_OSH
environment variable for the current language is set, use that.Otherwise, if
$XDG_DATA_HOME
is set, save to"$XDG_DATA_HOME"/oil/history_oil
or"$XDG_DATA_HOME"/oil/history_osh
.If neither option is set, fall back to
~/.local/share/oil/history_oil
or~/.local/share/oil/history_osh
.