Fix the indicator for redirecting standard input - #2749
Conversation
|
Will add a test in a few mins. |
a2a2f51 to
436c71c
Compare
|
sergei (@vors) Jason Shirk (@lzybkr) From reading the code, I feel it's fine to swap the order of calling |
|
|
| myInfo.PipelineIterationInfo = pipelineIterationInfo; | ||
| commandProcessor.DoPrepare(psDefaultParameterValues); | ||
| myInfo.ExpectingInput = commandProcessor.IsPipelineInputExpected(); | ||
| commandProcessor.DoPrepare(psDefaultParameterValues); |
There was a problem hiding this comment.
I believe it's a correct change.
|
OK, finally finished running all tests on windows and analyzing the failures. There are 8 test failures:
None of the failures is related to swapping the order of |


Fix #2745
PipelinePositionstarts from 1,so the indicator for redirecting standard input should bePipelinePosition > 1.When there is input to a native command like
1,2,3 | <native>, the native command is still marked as position 1 in the pipeline because the input doesn't take up pipeline position. So we cannot simply usingPipelinePositionto decide whether standard input needs to be redirected.The new fix swaps the running order of the following code in
PipelineProcessor.Start, so as to make sureExpectingInputis set before callingDoPrepare. Then inNativeCommandProcessor.Preparewe can useMyInvocation.ExpectingInputto check whether to redirect standard input.