protected function getDimensionsFromAnsicon() : ?array
    {
        if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
            return [
                'width'  => (int) $matches[1],
                'height' => (int) ($matches[4] ?? $matches[2])
            ];
        }

        return null;
    }