From aad9f5fb45967cda6ffe90cf618d5ececb9e26d4 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 24 Nov 2022 22:51:20 +0000 Subject: [PATCH] Terminal: use fallback escape codes if TERM env var is not set tput requires a value for TERM, so it will generate errors if the var is not set, as it appears not to be in PhpStorm on macOS. --- src/utils/Terminal.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/Terminal.php b/src/utils/Terminal.php index 0ad729658..7144b8a9b 100644 --- a/src/utils/Terminal.php +++ b/src/utils/Terminal.php @@ -166,8 +166,10 @@ abstract class Terminal{ case Utils::OS_LINUX: case Utils::OS_MACOS: case Utils::OS_BSD: - self::getEscapeCodes(); - return; + if(getenv('TERM') !== false){ + self::getEscapeCodes(); + return; + } case Utils::OS_WINDOWS: case Utils::OS_ANDROID: