Prioritize fallback over non-interactive mode #91
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.
This PR solves an obscure Windows issue when using
mintty
withoutwintty
, which causesstream_isatty(STDIN)
to incorrectly returnfalse
, which triggers non-interactive mode.This can occur when using "Git Bash" (which uses
mintty
under the hood) without thephp
CLI alias. I.e when prefixing a script withphp.exe
instead ofphp
, or when directly executing a PHP script with a shebang (like the Laravel installer).I can't find a reliable way to determine whether
STDIN
is interactive or not in this scenario becausemintty
simulates a TTY by using a pipe, which is typically not interactive. The most reliable workaround I can think of for the time being is to make the Windows fallback take precedence over non-interactive mode. We could alternatively force-enable interactive mode when usingmintty
withoutwintty
, but I'm not sure if there is a scenario where this would be genuinely non-interactive.Fixes laravel/installer#286