This repository was archived by the owner on Apr 17, 2020. It is now read-only.
EXIT traps that print to stdout shouldn't break process substitution#25
Open
onlynone wants to merge 1 commit intorvm:masterfrom
Open
EXIT traps that print to stdout shouldn't break process substitution#25onlynone wants to merge 1 commit intorvm:masterfrom
onlynone wants to merge 1 commit intorvm:masterfrom
Conversation
Author
|
This test failed, only because there's a bug with rvm. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
OS X sets a trap on
EXITto callshell_session_update, this callsshell_session_savewhich will print to stdout. Normally this is not a problem for subshells instantiated like$(...), because the traps are apparently not inherited by (at least these types of) subshells. However, rvm re-installs this trap, (even from within subshells) when you call something likecd(which rvm overrides).Basically:
Will not have the
EXITtrap called inside the$(...), and will result ina=a. However:Will have the trap called, and will result in
a=a trapped.The latter is what rvm ends up doing when it's loaded by its version of
cd, and you do something like:Perhaps the overridden shell commands should never install the exit trap? Or rvm could detect when it's being run inside a subshell where it's helpers aren't needed and not run any of the init code?