Get the length of the line based on the width of the terminal window

@return integer
499514
protected function getLength()
    {
        if (!$this->length) {
            $this->length = $this->util->width();
        }

        return $this->length;
    }
149567
public function getWidth()
    {
        return array_reduce(
            $this->cartLines->toArray(),
            function ($width, CartLineInterface $cartLine) {
                return max($width, $cartLine->getWidth());
            },
            0
        );
    }
203170
public function getWidth() : int
    {
        if (!$this->loadImageInfo()) {
            throw InvalidOperationException::format(
                    'Invalid call to %s: file \'%s\' is not a valid image',
                    __METHOD__,
                    $this->fullPath
            );
        }

        return $this->width;
    }
510066
public function getWidth()
    {
        try {
            list($width) = explode('x', $this->getSize());
        } catch (Exception $e) {
            $width = '';
        }
        return $width;
    }
502553
def get_width():
    """"""
    # Get terminal size
    ws = struct.pack("HHHH", 0, 0, 0, 0)
    ws = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, ws)
    lines, columns, x, y = struct.unpack("HHHH", ws)
    width = min(columns * 39 // 40, columns - 2)
    return width
999797
public function length()
    {
        $length = 0;

        foreach ($this->_streams as $stream) {
            $len = $stream->length();
            if ($len === null) {
                return;
            }
            $length += $len;
        }
        return $length;
    }
1282692
def get_terminal_size(fd):
    """"""
    sizebuf = array.array('h', [0, 0])
    fcntl.ioctl(fd, termios.TIOCGWINSZ, sizebuf, True)
    return tuple(reversed(sizebuf))
545043
public function getWidth() : ?float 
    {
        if ( ! $this->hasWidth()) {
            $this->setWidth($this->getDefaultWidth());
        }
        return $this->width;
    }
726795
public function getSize()
    {
        $filePath = $this->getPathname();
        $size = -1;
        $isWin = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN');
        $execWorks = (function_exists('exec') && !ini_get('safe_mode') && exec('echo EXEC') == 'EXEC');
        if ($isWin) {
            if ($execWorks) {
                $cmd = "for %F in (\"$filePath\") do @echo %~zF";
                exec($cmd, $output);
                if (is_array($output)) {
                    $result = trim(implode("\n", $output));
                    if (ctype_digit($result)) {
                        $size = $result;
                    }
                }
            }
            // try the Windows COM interface if its fails
            if (class_exists('COM') && $size > -1) {
                $fsobj = new \COM('Scripting.FileSystemObject');
                $file = $fsobj->GetFile($filePath);
                $result = $file->Size;
                if (ctype_digit($result)) {
                    $size = $result;
                }
            }
        } else {
            $result = trim("stat -c%s $filePath");
            if (ctype_digit($result)) {
                $size = $result;
            }
        }
        if ($size < 0) {
            $size = filesize($filePath);
        }
        return $size;
    }
1198814
def console_get_width(con: tcod.console.Console) -> int:
    
    return int(lib.TCOD_console_get_width(_console(con)))
802953
public function getLength()
    {
        if ($this->getPagination() == self::BOOLEAN_TRUE) {
            $properties = $this->getProperties();
            return (array_key_exists('length', $properties) ? $properties['length'] : false);
        }
        return false;
    }
1264281
public function width(): int
    {
        $lines = explode("\n", $this->value());
        $width = [];

        foreach ($lines as $line) {
            $raw = strip_tags($line);
            $width[] = strlen(trim($raw));
        }

        return max($width);
    }
122382
public function getWidth()
    {
        if (null === $this->width && !$this->initialised) {
            $this->refreshDimensions();
        }

        if (null === $this->width) {
            $width = getenv('COLUMNS');
            if (false !== $width) {
                $this->width = (int) trim($width);
            }
        }

        return $this->width ?: static::DEFAULT_WIDTH;
    }
1105215
public function count()
    {
        $handle = $this->createHandle($this->getFilePath());
        $lineCount = 0;

        while (!feof($handle)) {
            $line = $this->readLine($handle, null);
            if ($line !== '') {
                ++$lineCount;
            }
        }

        fclose($handle);

        return $lineCount;
    }
472361
public function length() : float
    {
        return sqrt($this->x * $this->x + $this->y * $this->y);
    }
196425
protected function getAdjustedKeyLength()
	{
		return $this->length - intval(strlen($this->prefix) + strlen($this->suffix));
	}
454319
public function getObjectLength()
    {
        $nrOfIdentifierOctets = strlen($this->getIdentifier());
        $contentLength = $this->getContentLength();
        $nrOfLengthOctets = $this->getNumberOfLengthOctets($contentLength);

        return $nrOfIdentifierOctets + $nrOfLengthOctets + $contentLength;
    }