Skip to content

Commit

Permalink
Use posix_isatty if it is available. (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson authored Jun 4, 2019
1 parent 2db95d9 commit 2a6587f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Util/Tty.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ class Tty
*/
public static function isTtySupported()
{
// Start off by checking STDIN with `posix_isatty`, as that appears to be more reliable
if (function_exists('posix_isatty')) {
return posix_isatty(STDIN);
}
if (method_exists('\Symfony\Component\Process\Process', 'isTtySupported')) {
return Process::isTtySupported();
}
Expand Down

0 comments on commit 2a6587f

Please sign in to comment.