-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Linux: Support XDG_CONFIG_HOME for argv.json location
#164118
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
Conversation
argv.json at ~/.config/[product-name]/argv.json.argv.json at ~/.config/[product-name]/argv.json (XDG convention)
259008b to
819057a
Compare
I work for GitHub, therefore I'm also a Microsoft employee. @microsoft-github-policy-service agree [company="Microsoft"] |
|
@microsoft-github-policy-service agree company="Microsoft" |
819057a to
f626398
Compare
…vention). If it's not available, fall back to reading and/or creating `~/.[product-name]/argv.json`. See `$XDG_CONFIG_HOME` at https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html This will allow VSCode to avoid creating new dirs in the home folder, matching a large number of other programs: https://wiki.archlinux.org/index.php/XDG_Base_Directory_support This addresses microsoft#162712 Unfortunately, there is an issue in that `AbstractNativeEnvironmentService.argvResource()` does not have access to the filesystem directly. It will need further work to fall back from one location to another.
f626398 to
280c8e1
Compare
| // TODO: how do we fall back to this? | ||
| // return joinPath(this.userHome, this.productService.dataFolderName, 'argv.json'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file seems to use an abstract environment that does not know about the underlying file system (or similar abstraction). I could use guidance on the best way to implement a fallback.
|
poke :-D |
|
Thanks for the PR, I cannot make promises when I get a chance for review though. |
argv.json at ~/.config/[product-name]/argv.json (XDG convention)XDG_CONFIG_HOME for argv.json location
bpasero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems to attempt to do two things that are mutually exclusive:
- allow to set the user data dir via
argv.json - support
XDGfor the location ofargv.json
I do not think both changes should be in one PR so I suggest to focus on the XDG support here. The other change for supporting user data dir in argv.json does not work anyway in this form.
As for the location of argv.json I think the solution we use here should be copied/applied, not something new invented:
| appDataPath = process.env['XDG_CONFIG_HOME'] || path.join(os.homedir(), '.config'); |
|
Thanks for the review, @bpasero!
That sounds reasonable to me. What about allowing the part about user extensions to be set via
Could I ask you to clarify how that would work? Do you mean to suggest that:
In particular, how do you envision that users' existing Also, unfortunately the use of the
|
|
My only suggestion here was to use I wonder why node.js is not supporting |
FWIW, I think this is a fairly idiomatic place for
|
Hmm, yeah, that doesn't help me at all, unfortunately. 😔
Probably. However, I wouldn't look to |
|
Maybe then I misunderstood the original request, why does this not help you? |
I want to avoid a Most programs now create their dot folders in As documented in #162712 , this is also a regular wish by other VSCode users. Since VSCode is a macOS application, there is no reliable way to work around this using env vars, which is why I proposed this PR with its original title. |
|
Sorry but I only own the part about |
Sounds reasonable. If we can address the |
|
Sounds good. |
|
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
If it's not available, fall back to reading and/or creating
~/.[product-name]/argv.json.This addresses #162712
Unfortunately, there is an issue in that
AbstractNativeEnvironmentService.argvResource()does not have accessto the filesystem directly. It will need further work to fall back from
one location to another.