From ffd75a57d4d6eac3a5420e32ef7abeb238bae90c Mon Sep 17 00:00:00 2001 From: Dominique FOURNIER Date: Fri, 18 Mar 2022 11:08:47 +0100 Subject: [PATCH] Console : allow to know if the TTY is enabled (or if the console is called from pipe) --- src/Console.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Console.php b/src/Console.php index b6a749f..b578053 100644 --- a/src/Console.php +++ b/src/Console.php @@ -993,6 +993,13 @@ class Console } // }}} + /** Return true if the TTY is enabled, or false if the program is called from pipe + */ + public function isTTY() + { + return !! $this->initSttyState; + } + /** Tokenize the provided line and aggragate if there is single or double * quotes. * Trim the spaces