envars: skip Prepend when value is already at front of list#561
Open
stuartwdouglas wants to merge 1 commit intocashapp:masterfrom
Open
envars: skip Prepend when value is already at front of list#561stuartwdouglas wants to merge 1 commit intocashapp:masterfrom
stuartwdouglas wants to merge 1 commit intocashapp:masterfrom
Conversation
When Prepend.Apply() is called and the value's path components are already a prefix of the current list, skip the operation entirely. This prevents hermit exec from reordering PATH entries that were intentionally placed before Hermit-managed paths by the caller. Previously, hermit exec unconditionally removed and re-prepended all Hermit-managed paths, which pushed non-Hermit entries (like wrapper script directories) behind Hermit paths even when the caller had already set up the correct PATH order. The hermit_on_activate shell hook exists to fix this reordering, but it only runs in interactive shells — not during hermit exec via bin stubs. Co-authored-by: Claude Code <noreply@anthropic.com>
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
Prepend.Apply()is called and the value's path components are already a prefix of the current list, skip the operation entirely. This preventshermit execfrom reordering PATH entries that were intentionally placed before Hermit-managed paths by the caller.Previously,
hermit execunconditionally removed and re-prepended all Hermit-managed paths, which pushed non-Hermit entries (like wrapper script directories) behind Hermit paths even when the caller had already set up the correct PATH order.The
hermit_on_activateshell hook exists to fix this reordering, but it only runs in interactive shells — not duringhermit execvia bin stubs.