fix: strip instance specific env vars from launched processes - #178
Merged
Conversation
Strobotti
reviewed
Aug 7, 2026
Strobotti
approved these changes
Aug 7, 2026
Strobotti
left a comment
Owner
There was a problem hiding this comment.
Thanks for this! I might add a unit test for the SanitizeEnviron later 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This fixes a very specific and somewhat obscure bug I encountered while opening a link from
signal-desktopintidal-hifi. All of the env variables that signal launched with got inherited by linkquisition which in turn passed them down totidal-hifi. As bothtidal-hifiandsignalare electron applications, theCHROME_DESKTOPvariable was still set to the value it received for (and from) signal, which somehow causedtidal-hifito segfault.At first I just changed my manual entry for
tidal-hifito unset the var, which would suffice as a fix if you are against touching the process environment at all. As linkquistion is always going to play the role of a middleman between two apps though, I'd argue that this in scope for what this app should do, as for an (admittedly very specific) edge case like this, it would not be able to fulfill its role in that chain. I'd be interested in your view though :)I also added this to all platforms as it should apply equally to all of them. I verified that the env also gets inherited on MacOS in the same way that it does on Unix (see also the
open(1)man page. I don't currently have a windows install lying around, so those changes are speculative.Currently, I have not added any test for these changes as I thought their scope to be small enough. I'd be happy to take a crack at building them though, just let me know if a small unit test suffices or if you'd like a full integration test as well :)
Also thanks for building this thing, it solved a very specific problem I had 😅
full disclosure: the list of variables was largely picked out by claude opus 5 but went through a lot of source code checks which makes me fairly confident that it holds.