-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipe detection still broken #224
Comments
We're going to all this effort to support using the WP CLI already has an SSH protocol handler for
If WP CLI (at least as much of it as is needed to run commands remotely) is included as a depedency of local server we might be able to use |
I think that has too many weaknesses to pursue:
|
That's not strictly true if we generate a |
Somehow even though I thought I had fixed pipe / tty detection about 3 times, it still seems to be broken. Most recently in #157.
Basically, I can not get the output TTY detection to work. In a plain PHP script:
Running
php -f test.php
will outputbool(true)
, whereasphp -f test.php | grep bool
will outputbool(false)
. This is expected, as in the first case, STDOUT is a TTY, and in the second case STDOUT is being piped togrep
.For some reason, when used via
composer server cli
, no matter what I check,posix_isatty( STDOUT )
is alwaysfalse
.In Composer commands (Symfony Console), there is a way to detect the TTY support (well, color support), like in https://github.com/symfony/symfony/blob/2.6/src/Symfony/Component/Console/Output/StreamOutput.php#L101. In
local-server
if I even try to doposix_isatty( $output->getStream() )
I also getFALSE
. So, the Console output stream is not a TTY, neither isSTDOUT
.I'm not sure if this is just my setup, but either way, it's breaking the TTY detection, which means things like
composer server cli post list
will not show table columns / dividers etc.We could disable the TTY detection for STDOUT, and only use the STDIN detection (which works fine). This would mean piping data in to CLI commands should be fine, and also tables and color formatting should work fine. However, it means doing something like
composer server cli -- post list --fields=ID | xargs -n 1....
will not work as expected, asxargs
will be receiving formatted output.The text was updated successfully, but these errors were encountered: