Skip to content

🐛 fix(activation): restore the user's pydoc alias on xonsh deactivate - #3750

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:rework/pr-3703
Nov 20, 2026
Merged

gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:rework/pr-3703

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Xonsh activation replaced a user's pydoc alias and removed it on deactivation. Deactivation now restores the prior alias, including after switching environments. If there was no prior alias, it removes virtualenv's alias. An alias that refers to another alias keeps that reference, so later changes to its target still apply. Fixes #3586.

The activator saves the alias definition before installing its own and restores it only when that activator registered the replacement. The outside input is the user's alias definition; activation stores and reassigns it without evaluating it as source. This matches the PowerShell behavior in #3529.

Contribution by Pratik-Kumar-Dhakar.

@gaborbernat
gaborbernat marked this pull request as ready for review November 20, 2026 17:07
@gaborbernat
gaborbernat merged commit 7ff7cc4 into pypa:main Nov 20, 2026
97 of 155 checks passed
@gaborbernat
gaborbernat deleted the rework/pr-3703 branch November 23, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xonsh activator removes the user's own pydoc alias on deactivate

1 participant