Skip to content

Commit

Permalink
fix: Fix the requirement checker Terminal getenv() usage (#999)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Michele Locati <[email protected]>
  • Loading branch information
theofidry and mlocati authored Oct 6, 2023
1 parent f290974 commit bee6dd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion requirement-checker/src/Terminal.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static function hasSttyAvailable(): bool
private static function initDimensions(): void
{
if ('\\' === DIRECTORY_SEPARATOR) {
if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON') ?: ''), $matches)) {
// extract [w, H] from "wxh (WxH)"
// or [w, h] from "wxh"
self::$width = (int) $matches[1];
Expand Down

0 comments on commit bee6dd7

Please sign in to comment.