Airship\Hangar\Command::getScreenSize PHP Method

getScreenSize() public method

Return the size of the current terminal window
public getScreenSize ( ) : array
return array (int, int)
    public function getScreenSize() : array
    {
        $output = [];
        \preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", \strtolower(\exec('stty -a |grep columns')), $output);
        if (\sizeof($output) === 3) {
            return ['width' => $output[2][0], 'height' => $output[1][0]];
        }
        return [80, 25];
    }