Index: trunk/phase3/maintenance/install-utils.inc |
— | — | @@ -95,10 +95,18 @@ |
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
| 99 | +if ( !function_exists( 'posix_isatty' ) ) { |
| 100 | + # We default as considering stdin a tty (for nice readline methods) |
| 101 | + # but treating stout as not a tty to avoid color codes |
| 102 | + function posix_isatty( $fd ) { |
| 103 | + return !$fd; |
| 104 | + } |
| 105 | +} |
| 106 | + |
99 | 107 | function readconsole( $prompt = '' ) { |
100 | 108 | static $isatty = null; |
101 | 109 | if ( is_null( $isatty ) ) { |
102 | | - if ( !function_exists( 'posix_isatty' ) || posix_isatty( 0 /*STDIN*/ ) ) { |
| 110 | + if ( posix_isatty( 0 /*STDIN*/ ) ) { |
103 | 111 | $isatty = true; |
104 | 112 | } else { |
105 | 113 | $isatty = false; |
Index: trunk/phase3/maintenance/eval.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | } |
42 | 42 | |
43 | 43 | if ( function_exists( 'readline_add_history' ) |
44 | | - && function_exists( 'posix_isatty' ) && posix_isatty( 0 /*STDIN*/ ) ) |
| 44 | + && posix_isatty( 0 /*STDIN*/ ) ) |
45 | 45 | { |
46 | 46 | $useReadline = true; |
47 | 47 | } else { |