-
Notifications
You must be signed in to change notification settings - Fork 78
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/bintoPATHwithout first removingFOO/binand creates the environment variable_HERMIT_OLD_MY_ENV=hello - run
deactivate-hermit - Hermit removes
BAR/binfromPATHand restoresMY_ENV=hello. - Issue: we are no longer in an activated hermit env, but we still have
FOO/binonPATHand 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-hermitto only deactivate a single environment (sounds more annoying than useful) - ensure that
deactivate-hermitexplicitly 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels