From cdad10a21a1207fa82bd2ab2523b9b15c58b02f2 Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Tue, 17 Feb 2004 05:49:16 +0000 Subject: [PATCH] * apply bold escape codes only if output is going to a terminal/tty --- pear/PEAR/Frontend/CLI.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pear/PEAR/Frontend/CLI.php b/pear/PEAR/Frontend/CLI.php index 1ecd223c1f..95067b024f 100644 --- a/pear/PEAR/Frontend/CLI.php +++ b/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); -- 2.50.1