Skip to content

Set environment in script before_ not picked up when applying dotfiles #2331

Answered by twpayne
latipun7 asked this question in Q&A
Discussion options

You must be logged in to vote

Sadly, this is not generally possible due to the way Linux/UNIX processes work.

Environment variables are passed from parent processes to their children. They are not shared and do not pass from children to their parents. When a child process sets an environment variable (e.g. adding an extra directory to $PATH or setting a variable like $BW_SESSION) this is only visible to the child process and not the parent [1]. So, the chezmoi process that spawns your run_ script does not see any changes that the child process makes.

The Bitwarden password manager stores persistent logins in an environment variable, so, by design, a child Bitwarden process cannot login on behalf of a parent process. S…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@latipun7
Comment options

Answer selected by latipun7
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants