Open
Description
With setEnvInherit
, a process can be executed with the environment variables inherited from the parent:
ghci> runProcess_ $ proc "sh" ["-c", "env"]
SHELL=/opt/homebrew/bin/fish
ITERM_PROFILE=Default
COLORTERM=truecolor
XPC_FLAGS=0x0
TERM_PROGRAM_VERSION=3.4
...
setEnv
can be used to set environment variables, but doing so prevents the subprocess from inheriting any environment variables from its parent:
ghci> runProcess_ $ setEnv [("a", "b")] $ proc "sh" ["-c", "env"]
sh: line 1: env: command not found
*** Exception: Received ExitFailure 127 when running
Raw command: sh -c env
I'd like to (e.g.) run a program with environment variables inherited but with some changes.
Metadata
Metadata
Assignees
Labels
No labels