From a9656427692f1548f8831ba2d85a9a8a4cef1544 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 11 Sep 2013 19:37:30 +0200 Subject: [PATCH] Do not use detected width for output formatting if it is not available --- src/Composer/Command/ShowCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 166129989..c0b515401 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -185,6 +185,11 @@ EOT } } list($width) = $this->getApplication()->getTerminalDimensions(); + if (null === $width) { + // In case the width is not detected, we're probably running the command + // outside of a real terminal, use space without a limit + $width = INF; + } if (defined('PHP_WINDOWS_VERSION_BUILD')) { $width--; }