Repository navigation
Conversation
…losed When a caller closes stderr (instead of redirecting it to /dev/null) - for example Ruby's IO.popen(..., err: :close) - the >&2 redirection inside nvm_err returns non-zero. nvm_compare_checksum ends with nvm_err 'Checksums matched!' on success, so a successful checksum was reported as a failure and the install was aborted. zsh can also abort the whole shell when its diagnostic about the failed redirection cannot be written. Run the redirection in a subshell and discard its exit code, while keeping nvm_echo's existing stderr silencing for printf failures. Fixes #3906
schnare22
reviewed
Sep 3, 2026
schnare22
left a comment
There was a problem hiding this comment.
I owe you send me a link I'll take care of you I got only couple hundred more to fix miscellaneous
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Member
|
Duplicate of #3907. |
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 a caller closes stderr (instead of redirecting it to /dev/null) - for example Ruby's
IO.popen(..., err: :close)or a child process that closes fd 2 explicitly - the>&2redirection insidenvm_errreturns non-zero. Becausenvm_compare_checksumends withnvm_err 'Checksums matched!'on success, a successful checksum is then reported as a failure and the install is aborted. zsh can additionally abort the whole shell when its own diagnostic about the failed redirection cannot be written.Running the redirection in a subshell and discarding its exit code keeps that failure isolated from the caller.
nvm_echoitself already silencesprintferrors via2>/dev/null, so no further change is needed there.The fix applies the same treatment to
nvm_err_with_colorsfor consistency.Fixes #3906