-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
XDG support on windows #6747
Comments
I'd suggest opening an issue to the upstream library: https://github.com/lunacookies/etcetera |
The |
Hi. Any updates on this? IMO, the config locations should be consistent across OS, when the XDG_ environment variables are set. |
The XDG and Windows strategies can't co-exist using the types in the crate. XDG would probably have to be implemented manually for Windows so it can fall back to the Windows strategy when the environment variables aren't set. |
The existence of the XDG variables isn't supposed to determine whether or not the XDG spec is followed i.e. So the flow can be like this:
|
The Windows spec should be the default since it's what most users will expect (i.e #7084). According to the spec, I don't think I'm wrong either. It says that if the environment variables aren't defined, it should fall back to the system default, which would be defined by the Windows spec.
|
I think if XDG variables are set, that should be the default. Otherwise,
there is no way to change it. If XDG variables aren't set, revert to
windows spec and it doesn't affect normal windows users
…On Sat, Jun 3, 2023 at 9:53 AM Kirawi ***@***.***> wrote:
The Windows spec should be the default since it's what most users will
expect (i.e #7084 <#7084>).
According to the spec, I don't think I'm wrong either. It says that if the
environment variables aren't defined, it should fall back to the system
default, which would be defined by the Windows spec.
—
Reply to this email directly, view it on GitHub
<#6747 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABQRMXIFOLKIQPDUCLXITXJNMXBANCNFSM6AAAAAAW5PTFSU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Yes, that is what I mean. |
If you want Windows to be the primary/recommended location, then flow should be:
It shouldn't just be use the location provided by
The defaults are defined by the XDG spec itself, as you quoted yourself:
It doesn't say that the OS should specify the default. |
It is a little ambiguous as it could also mean "equivalent," and most implementations interpret it as such (i.e. Racket or GTK glib). A hard-coded default would be pretty useless and not user-friendly (what benefit is there to forcing users to use these unix paths instead of the Windows paths that they already know?). The flow should be this:
|
Hmmm. I don't use CLI on Windows, so I don't have strong opinions. I assumed it worked similarly to macOS because CLIs/TUIs on macOS follow "proper" XDG spec i.e. they default to |
I like how WezTerm handles this problem, and it also sounds more intuitive to me -- working from more specific to more general in terms of priority:
IMO hard-coded paths such as $HOME or %APPDATA% should only be used as a last priority. |
#2135 for that. This issue is specifically about supporting XDG on Windows. |
I'm on windows. The standard, in my opinion, should be to support them for consistency across platforms. The issue for me is that the config directory on windows is hard-coded or must be specified by way of a CLI argument (or a symlink, but that is supported anyway). |
Yes, the linked PR covers that. Even so, that PR does not support XDG on Windows. So this issue can be seen as an extension of that. To rephrase, this issue is specifically about using the XDG environment variables to find the config folders within the scope of the current system. What you're talking about falls outside of this. |
This seems to most obvious solution. It's what I expect. I pull my |
What is the status on this? How can I change my config in runtime directories on windows without using a command line switch? |
The behavior for Mac is also a bit weird. Usually if configuration uses system-native config paths then it is It is kind of unusual that Helix uses AppData on WIndows but Or, since deprecating config locations is unlikely, allow either native locations or |
According to the upstream library We could probably check if other editors like Vim/Kakoune do the same. |
I think the current config is consistent with neovim (On Mac it uses ~/.config, and it looks like WIndows is AppData https://jdhao.github.io/2018/11/15/neovim_configuration_windows/). Vim is stubborn and always I think many CLI apps that predate Rust usually use What a mess... In any case, I feel that it isn't a bad idea to check ~/.config on Windows too and at least warn the user that config isn't read from that location. |
Again, etcetera only contains a helper function for this pattern, since it seems to be a common pattern. If you want, you can use |
As long as the option is there to change it without a command line switch and so it is not hardcoded. Just pick APPDATA or HOME/.config as fallback but give the ability to use XDG if that is set. I think it should fall back to os convention but not as long a we can change it with ENV variable it doesn't matter too much |
Any update on this? |
Would love this as I also have XDG environment variables set on Windows. For now I'm just aliasing |
Function Start-Helix ([string[]]$arguments) { hx -c "$env:XDG_CONFIG_HOME\helix\config.toml" (-join $arguments) }
Set-Alias -Name hlx -Value Start-Helix |
I think there is enough agreement to use XDG_CONFIG_HOME if it is set -
should I open a pull request?
…On Fri, Dec 6, 2024 at 6:27 AM James ***@***.***> wrote:
Function Start-Helix ([string[]]$arguments) { hx -c "$env:XDG_CONFIG_HOME\helix\config.toml" (-join $arguments) }Set-Alias -Name hlx -Value Start-Helix
—
Reply to this email directly, view it on GitHub
<#6747 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABQRKBWJJEIUPD5VU776D2EGQ2XAVCNFSM6AAAAAAW5PTFSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRTGI2TKOBQGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
To clarify, will the proposed change allow all configuration files including languages & themes to use XDG? or just the |
It would make sense, and indeed be very nice to allow all configuration files (including languages and themes) to use XDG as @henry-js suggested. Indeed, with themes, even if you run |
I am a windows user and I set the XDG environment variables. On windows, helix doesn't honor these environment variables so it always goes to %APPDATA%, My %APPDATA% drive, is full so I changed XDG directories to a different drive. I think that if the variables are set, even on windows, should allow to follow XDG directories and if not should revert back to %APPDATA%
The text was updated successfully, but these errors were encountered: