public function getTerminalWidth()
    {
        if ($this->isInteractiveShell()
            || (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && getenv('shell'))
        ) {
            return (int)shell_exec('tput cols');
        }

        return self::TERMINAL_DEFAULT_WIDTH;
    }