Repository navigation
Skip passing sandbox env to spawned shell in Flatpak - #1116
Merged
Merged
Conversation
ranisalt
marked this pull request as ready for review
May 19, 2025 22:55
Owner
|
@ranisalt nice! make sense, could you also update the releases.md |
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.
When passing
std::env::vars_os()to the spawned shell inside a Flatpak sandbox, it ends up overriding important host environment variables with overridden values meant for the sandboxed application (in this case, Rio). Most notably,$XDG_CONFIG_HOMEis overridden by the value passed to Rio, which is$HOME/.var/app/com.rioterm.Rio/configinstead of$HOME/.config(or whatever value the user has set):(current behavior)
There's no need to pass any environment variables to the shell outside the sandbox, they get inherited from the process that spawned the Flatpak sandbox, which is usually the user session that already has the environment properly set up:
(fixed behavior)
Additionally, the order of the parameters does not matter in this scenario, so I moved setting
TERM_PROGRAM(nowTERMandCOLORTERM, sinceTERM_PROGRAMis for Mac) to the initial data of the vector and skip the push.As a bonus, it now renders icons and ligatures as the shell has access to the host fonts :)