Repository navigation
🐛 fix(activation): restore the user's pydoc alias on xonsh deactivate - #3591
Merged
gaborbernat merged 2 commits intoNov 20, 2026
Merged
Conversation
Pratik-Kumar-Dhakar
marked this pull request as ready for review
November 19, 2026 16:59
Activation replaced and then removed a user-defined pydoc alias. Save it on activation and restore it on deactivation, including when switching environments.
Xonsh resolves alias references in aliases.get(), which freezes the command when activation saves pydoc. Read the raw mapping entry so deactivation restores the user's alias chain.
gaborbernat
force-pushed
the
fix/xonsh-restore-pydoc
branch
from
November 20, 2026 01:13
b1c96d3 to
1099cc7
Compare
This was referenced Nov 20, 2026
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.
Fixes #3586
Xonsh activation replaced a user's
pydocalias and removed it on deactivation. The activator now restores that alias, including after switching environments. An alias that refers to another alias keeps that reference, so later changes to its target still apply. This matches #3529 for PowerShell.The activator saves the raw alias definition before installing its own. It restores the saved definition only if it registered the replacement; this lets the next activator deactivate the previous one without removing the user's alias.
Security scope (activation script): the outside input is the user's own
pydocalias definition. The script stores and reassigns that definition without executing it as source.Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)
tox -e fix)docs/changelog/+short-description.<type>.rstfragment for each user-facing change, or appliedskip newspyvenv.cfg, wheel downloads, app-data or release workflows: explained in the PR text which outside input the change handlesmainin my environment)