-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Description
Given two environments FOO
(which sets env var MY_ENV=hello
) and BAR
(which sets MY_ENV=goodbye"
):
- activate
FOO
- without deactivating
FOO
, activateBAR
- Hermit prepends
BAR/bin
toPATH
without first removingFOO/bin
and creates the environment variable_HERMIT_OLD_MY_ENV=hello
- run
deactivate-hermit
- Hermit removes
BAR/bin
fromPATH
and restoresMY_ENV=hello
. - Issue: we are no longer in an activated hermit env, but we still have
FOO/bin
onPATH
and still haveMY_ENV=hello
. Carrying artifacts of a previously activated hermit env around could have odd consequences, especially if something like JAVA_HOME is left set.
I assume that keeping FOO/bin
on PATH
is intentional for the sake of convenience in nested environments. If that is indeed the case, then one way to resolve this may be to keep a stack of previously activated environments and either:
- change
deactivate-hermit
to only deactivate a single environment (sounds more annoying than useful) - ensure that
deactivate-hermit
explicitly unwinds all previously activated environments
I also noticed that shell-hooks will always explicitly deactivate environments before activating a new one, making it impossible to encounter this issue.
Metadata
Metadata
Assignees
Labels
No labels