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
Smarter handling of path for storing .omp.cache #1017
Comments
Wow, unbelievably fast turnaround! Lgtm, with the only comment being that storing the cache in its own directory is I think slightly preferable, as it makes it unambiguous which application owns the file (i.e. |
@ralish it creates that folder, so it should be OK |
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. |
Code of Conduct
What would you like to see changed/added?
PR #982 was merged recently (nice addition!) and as a result a
.omp.cache
file is stored in the user's home directory. That's fine on Unix-like systems, where it's not unusual for configuration files to be stored directly in$HOME
(and they're hidden anyway). On Windows, configuration files are typically not stored directly under the user's home directory, nor are files or folders with a dot prefix hidden by default.For those among us who like to keep their home directory tidy, the current behaviour of storing the cache file directly under the home directory isn't ideal. I'd suggest selecting the path to store the cache file a bit more intelligently based on the platform.
Windows
The "conventional" path would be something like
$env:LOCALAPPDATA\oh-my-posh\.omp.cache
, which expands to something like:C:\Users\user\AppData\Local\oh-my-posh\.omp.cache
. The$env:LOCALAPPDATA
path is intended for application data which is local to the system (i.e. does not roam with the user profile). Cache files are a perfect example of such data.Unix-like
Less annoying perhaps, but it would be nice to conform to the XDG Base Directory Specification. This is pretty simple with the relevant part being:
So the ideal case would be something like
$env:XDG_CACHE_HOME/oh-my-posh/.omp.cache
, where$env:XDG_CACHE_HOME
is$HOME/.cache
if not set.Anything else and/or failure cases
Fallback to the current approach :-)
The text was updated successfully, but these errors were encountered: