Repository navigation
IR: fix incorrect capturing of subexpressions - #13467
Merged
Merged
Conversation
Closed
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.
Description
Discovered by
@warpon Discord.The IR compiler was not properly setting redirect modes for subexpressions because
FullCellPathwas always being compiled with capture-out redirection. This is the correct behavior if there is a tail to theFullCellPath, as we need the value in order to try to extract anything from it (although this is unlikely to work) - however, the parser also generatesFullCellPaths with an empty tail quite often, including for bare subexpressions.Because of this, the following did not behave as expected:
Capturing the output meant that
dockerdidn't have direct access to the terminal as a TTY.As this is a minor bug fix, it should be okay to include in the 0.96.1 patch release.
User-Facing Changes
Tests + Formatting
I added a test for this, though we're not currently running all tests with IR on the CI, but it should ensure this behaviour is consistent. The equivalent minimum repro I could find was:
as this should cause the
cococomessage to appear on stdout, and if Nushell is capturing the output, it would be discarded instead.