Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix #966 by using fixed folders #1362
base: main
Are you sure you want to change the base?
fix #966 by using fixed folders #1362
Changes from 3 commits
8f41821
8386fe3
aae074c
442e404
040f5d0
356a4f7
5b224a9
489a20e
f9baf0e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I thought accessing a hidden folder was also a problem for snaps, no? Cc/ @auscompgeek
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 is true for most snaps by default iirc, but afaik vscode uses something called classic confinement, which has unrestricted access to files. This makes sense since it's an IDE and users would expected to be able to access anything as their user anyway. So I think we should be okay here (though I haven't tested with the snap yet).
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 seems like it may have been some testing code?
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.
I left this in for someone with access to Windows in case they want to test using a hidden folder, but didn't uncomment it because I can't test if it works.
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.
@knausj85 any thoughts about that part? I'm happy to just delete the commented out bit if windows users don't care to add it
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.
I have no concerns with leaving this file unhidden. Thoughts on this @AndreasArvidsson ?
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.
fyi I'm not sure I want plugins making top-level directories under .talon, hidden or not
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.
Sounds good. Should we continue that discussion in the issue or here?
Personally I would prefer to keep it in the temp directory and agree with @rntz arguments in the issue that the extension should respect
TMPDIR
.If that doesn't work for some technical reason we should probably just create a new directory in user home. eg
~/.rpc
.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.
I believe TMPDIR doesn't work as a solution because it can be different path in talon vs vscode. This can definitely be the case on nix, as noted here #966 (comment) and also unrelated to that plugin which I've run into (which I already forget where as I've been using this PR for ~ 1 year). I originally hardcoded /tmp in the PR, but then eventually we opted for a /home-based path, which unfortunately I now can't find the reason/comment for it seems.
But I think because of all the potential snap/flatpak/nix related issues mentioned it's likely just best to avoid hoping one of those tmpdir/runtime path solutions work everywhere? Pretty sure atm we don't have the capacity to actually test it.
Something like ~/.rpc is fine with me if that's what people like (I just want it fixed at this point :D), but imo it does seem a bit opaque and potentially collision prone vs some name that associates it with talon, which was why I chose to drop the folder in ~/.talon/... ~/.talon-rpc or similar maybe makes more sense?
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.
If someone on purpose has set a different environment variable in Talon and vscode they kind off asking for trouble. As long as we check the sources in the same order we should get the same result.
Year that is a real problem because we don't want to break it for existing users.
~/.talon-rpc
would be fine with me, but I'm not sure the home directory is any more stable than the temp directory since the home directory can also be moved with environment variables.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.
FWIW I agree if it were actually the user just wantonly changing environment variables, it shouldn't something that needs catering to. However, this isn't a case of a user choosing to change TMPDIR, it's being done somewhere behind the scenes, so it's not something they can just choose not to do.
In addition to the original bug filer, there were numerous (#966 (comment)) cases of it differing in practice, as well as in my systems and for some other Nix users. When it started breaking for me (which prompted finally creating the PR) it's certainly not from me explicitly changing TMPDIR myself. This comment #966 (comment) also implies this type of thing happens on windows.
In light of that, I don't see how keeping the order checking consistent is enough, unless you mean you have some other mechanism to ensure the paths they are checking in the same order are actually matching? Maybe I'm missing something.
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.
If we can't make the temp directory work reliably then we can't of course use that. I assume the home directory is more reliable?