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
Support XDG_CONFIG_HOME
for the argv.json
file
#162712
Comments
~/.vscode/
)
If it's not available, fall back to reading and/or creating `~/.[product-name]/argv.json`. 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.
…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.
…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.
…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.
I agree that we should respect the
Where we currently just use I would leave out the part that allows to configure the user data dir, that seems like a separate request. |
~/.vscode/
)XDG_CONFIG_HOME
for the argv.json
file
@bpasero I want to try this issue as it is marked as good first issue, From what I understand this is to make the |
Yes, basically instead of just using |
This is what I assume this would be the Migration style: Scenario 1 Scenario 2 Scenario 3 Scenario 4 |
Is there any solution for this |
@untainsYD the PR #170364 by @Da-Viper hasn't yet been merged. In fact it seems to have failed a CI action so may need attention by the author before it is ready for @bpasero or another member of the core team to review. |
I tried to update the MR but it is requesting review before CI |
Any updates on that ISSUE? |
I'm willing to work on this |
VSCode also generates |
In this issue
|
While you are at it, please do not forget about macOS: vscode/src/vs/platform/environment/node/userDataPath.js Lines 91 to 92 in 7ca9900
|
I don't know if this should be added in this issue, but the R extension also creates |
Any news how this evolved? Related intel appears pretty cluttered and lacking of clear MSFT guidance on how to get vscode to respect XDG defaults - if / once set. |
There are many of us who find it bad practice that VSCode creates a
~/.vscode/
folder instead of following the common XDG base directory structure, respected by a wide variety of programs. This issue has come up regularly, without a good permanent solution:I would like to propose the following new behaviour:
~/.config/vscode/argv.json
1 is present at launch in non-portable mode, then VSCode uses this as the path forargv.json
.argv.json
supports setting the following arguments, which the user can set to XDG-compatible paths if they like:user-data-dir
extensions-dir
As far as I can tell, this would be sufficient to avoid creating a
~/.vscode/
folder. It also reuses the existing structure of VSCode to do this without introducing significant hacks, edge cases, or race conditions.Part 1 seems reasonably feasible to me, given that
argv.json
is hardcoded in delightfully few places at the moment: https://github.com/microsoft/vscode/search?q=%22argv.json%22&type=codePart 2 would essentially involve adding those arguments to
SUPPORTED_ELECTRON_SWITCHES
.I'd be happy to submit a PR if this kind of approach is amenable to the maintainers.
Footnotes
If a non-branded or non-Insiders build is launched, this would generalize to
~/.config/[prefix]code[suffix]/argv.json
, per https://github.com/microsoft/vscode/issues/3884 . This is deterministic for any given installed build. ↩The text was updated successfully, but these errors were encountered: