Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hooks on 0.92.0 #12383

Merged
merged 3 commits into from
Apr 4, 2024
Merged

Fix hooks on 0.92.0 #12383

merged 3 commits into from
Apr 4, 2024

Conversation

IanManske
Copy link
Member

Description

Fixes #12382, where overlay changes from hooks were not preserved into the global state. This was due to creating child stacks for hooks, when the global stack should have been used instead.

@IanManske IanManske added the pr:bugfix This PR fixes some bug label Apr 3, 2024
@kubouch
Copy link
Contributor

kubouch commented Apr 3, 2024

Btw, for testing hooks, there is nu_repl_code in nu-test-support that uses the nu-repl testbing (see https://github.com/nushell/nushell/blob/main/tests/hooks/mod.rs). It might be quite dated, but might be usable if you want to add tests for this.

@IanManske IanManske marked this pull request as ready for review April 3, 2024 18:56
@IanManske IanManske marked this pull request as draft April 3, 2024 18:58
@IanManske IanManske marked this pull request as ready for review April 3, 2024 19:01
@IanManske
Copy link
Member Author

Added a test, but it doesn't fail on current main because the nu_repl testing code has a separate implementation from the actual REPL implementation.

@FrancescElies
Copy link

This pr fixes #12382, see below the manual test.
image

@sholderbach
Copy link
Member

Thanks for reporting the issue and testing the fix @FrancescElies

@sholderbach sholderbach merged commit cd00a48 into nushell:main Apr 4, 2024
15 checks passed
@hustcer hustcer added this to the v0.93.0 milestone Apr 4, 2024
@IanManske IanManske deleted the hook-stack-fix branch April 28, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:bugfix This PR fixes some bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.92 breaks hook with code (0.91 is fine)
5 participants