Repository navigation
lib/shell: warn on self-referential session variables - #9863
Open
khaneliman wants to merge 1 commit into
Open
khaneliman wants to merge 1 commit into
khaneliman wants to merge 1 commit into
Conversation
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
from
August 28, 2026 06:17
be37b8f to
aaa509d
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
2 times, most recently
from
August 28, 2026 20:48
c423753 to
d1b8f95
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
from
August 28, 2026 20:58
d1b8f95 to
db64429
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
from
August 28, 2026 21:04
db64429 to
ba28415
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
2 times, most recently
from
August 29, 2026 04:20
7af7a17 to
9c5f5ae
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
from
August 29, 2026 04:47
9c5f5ae to
01d3a49
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
from
August 29, 2026 13:30
01d3a49 to
af16441
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
2 times, most recently
from
August 30, 2026 03:02
4f4bc39 to
d791196
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
2 times, most recently
from
August 30, 2026 20:02
a62bd55 to
3f62937
Compare
khaneliman
marked this pull request as ready for review
August 30, 2026 20:04
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
from
September 9, 2026 22:13
3f62937 to
527e9b9
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
from
September 11, 2026 03:12
527e9b9 to
8aee3ac
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
2 times, most recently
from
September 30, 2026 18:58
aa51f5c to
d7eaa33
Compare
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
from
October 1, 2026 02:11
d7eaa33 to
793d075
Compare
Warn when session-variable definitions may change if applied more than once. Apply the check to home and Zsh session variables without changing their generated output. Detect direct references after caller-specific rendering while excluding stable whole-value expansions. Attribute each warning to the surviving per-attribute definitions, including their module priorities and wrappers. This gives users advance notice before later work allows the session configuration to be applied in new shells. Recommend search-variable options for path-like values and complete assignments for other values. Tests cover detector boundaries, Zsh escaping, source attribution, and both module call sites.
khaneliman
force-pushed
the
session-vars-6-self-reference-warning
branch
from
November 18, 2026 01:13
793d075 to
a796c21
Compare
This branch has not been deployed
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.
Description
Warns when
home.sessionVariablesorprograms.zsh.sessionVariablescontains a direct self-reference that may change when applied more than once. This PR changes diagnostics only; generated session-variable output is unchanged.The detector follows each caller's rendering rules, including Zsh backslash escaping. It excludes stable whole-value references, default and assignment expansions, and alternate expansions whose selected value is stable. The check remains best-effort and does not try to parse indirect references.
Each offender is attributed to the surviving definition of that attribute. Attribution respects module conditions, priorities, ordering, and explicit definition locations. The warning recommends the search-variable options for path-like values and complete assignments for other variables.
This gives users advance notice before the next PR allows session-variable configuration to run in each new shell.
Part of splitting #9735 into independently reviewable changes; the stack as a whole supersedes that PR.
Checklist
nix fmt.nix build .#test-all.{component}: {description}format.