浏览代码

Merge pull request #2256 from romainneutron/fix-show-width-detection

Do not use detected width for output formatting if it is not available
Jordi Boggiano 11 年之前
父节点
当前提交
36d3ca7568
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/Composer/Command/ShowCommand.php

+ 5 - 0
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--;
                 }