Browse Source

* apply bold escape codes only if output is going to a terminal/tty

PEAR_1_4DEV
Stig Bakken 22 years ago
parent
commit
cdad10a21a
  1. 4
      pear/PEAR/Frontend/CLI.php

4
pear/PEAR/Frontend/CLI.php

@ -47,7 +47,9 @@ class PEAR_Frontend_CLI extends PEAR
{
parent::PEAR();
$term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1
if ($term) {
if (function_exists('posix_isatty') && !posix_isatty(1)) {
// output is being redirected to a file or through a pipe
} elseif ($term) {
// XXX can use ncurses extension here, if available
if (preg_match('/^(xterm|vt220|linux)/', $term)) {
$this->term['bold'] = sprintf("%c%c%c%c", 27, 91, 49, 109);

Loading…
Cancel
Save