From 6865e611111ae07348600d67317b2be8e336edb8 Mon Sep 17 00:00:00 2001 From: Jonathan Vollebregt Date: Wed, 21 Aug 2024 19:38:27 +0200 Subject: [PATCH] CliRenderer: Hide stderr in tput check --- build/kint.phar | Bin 462825 -> 462989 bytes src/Renderer/CliRenderer.php | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build/kint.phar b/build/kint.phar index 2c0e531f7d7bb26094e7865e4d966fe124cdfa25..4d352be0a60b081d80dc495138f47bef257fefeb 100644 GIT binary patch delta 234 zcmaDkU#54V%mxhsfwdwG3=R8qWI*({RGsc-3xReE0Y)HZ+HN7heCHyMf{~qmN@|&Y zUTIFw^o@2bBGVlLnK`ES`!aJdmlTvv5A0`^oGx&Xk#)Mg5VOei366{$(|I$PBw3sj zi%X_YbY_&Ap0$ZZfXTuD!jTtd7KW(mf6Bx*ecoecq4wfO%s|Wn#H`zkAF=7_dd#pY zzu&NO;?d11e@{K@YOHX2l)p#+_pIg@q1qF9)NR&pT3q{lS$?~??B)RX_j$ delta 159 zcmeBODD!f@%mxhs0ZtJHhK7AQG9Wrccv5n+g+RN703#4HZMP6$zH@Q9QW&$ybcanW z9Mk_@VC9}JD8ec--N2cVr~UsUW*}w(V%F{dAF;XVdQ6zNyda+~?m$oO=Y0oHUU<>w zxq(x3?mM9eK@3+Ou~;vNlaUMF#dY_D(rKyBjxP3|?>_{*?VeHpu!Q%#i2PH(a25sz J26rc4Cjb_fKED6} diff --git a/src/Renderer/CliRenderer.php b/src/Renderer/CliRenderer.php index 74d1ed3ca..f8401f40e 100644 --- a/src/Renderer/CliRenderer.php +++ b/src/Renderer/CliRenderer.php @@ -94,8 +94,12 @@ public function __construct() if (null === self::$terminal_width) { if (!KINT_WIN && self::$detect_width) { try { - $tput = \exec('tput cols'); - if (false !== $tput) { + $tput = \exec('tput cols 2>/dev/null'); + if ((bool) $tput) { + /** + * @psalm-suppress InvalidCast + * Psalm bug #11080 + */ self::$terminal_width = (int) $tput; } } catch (Throwable $t) {