Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Terminal.php

function Terminal::getConsoleMode

Runs and parses mode CON if it's available, suppressing any error output.

Return value

int[]|null An array composed of the width and the height or null if it could not be parsed

1 call to Terminal::getConsoleMode()
Terminal::initDimensions in vendor/symfony/console/Terminal.php

File

vendor/symfony/console/Terminal.php, line 180

Class

Terminal

Namespace

Symfony\Component\Console

Code

private static function getConsoleMode() : ?array {
    $info = self::readFromProcess('mode CON');
    if (null === $info || !preg_match('/--------+\\r?\\n.+?(\\d+)\\r?\\n.+?(\\d+)\\r?\\n/', $info, $matches)) {
        return null;
    }
    return [
        (int) $matches[2],
        (int) $matches[1],
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal