Commit 12e826fe authored by Sebastian Kummer's avatar Sebastian Kummer

Revert "Merge pull request #57 in ZP/z-push from...

Revert "Merge pull request #57 in ZP/z-push from bugfix/ZP-704-z-push-top-screen-size-calculation-fails-under-OS-X to develop"

This reverts commit 307dc5e1.
parent 908d98db
......@@ -692,7 +692,7 @@ class ZPushTop {
/**
* Pads and trims string
*
* @param string $str to be trimmed/padded
* @param string $string to be trimmed/padded
* @param int $size characters to be considered
* @param boolean $cutmiddle (optional) indicates where to long information should
* be trimmed of, false means at the end
......@@ -719,9 +719,8 @@ class ZPushTop {
* @return array 'width' and 'height' as keys
*/
private function scrGetSize() {
$tty = strtolower(exec('stty -a | fgrep columns'));
if (preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", $tty, $output) ||
preg_match_all("/([0-9]+).rows;.([0-9]+).columns;/", $tty, $output))
preg_match_all("/rows.([0-9]+);.columns.([0-9]+);/", strtolower(exec('stty -a | fgrep columns')), $output);
if(sizeof($output) == 3)
return array('width' => $output[2][0], 'height' => $output[1][0]);
return array('width' => 80, 'height' => 24);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment