Skip to content

Commit

Permalink
fix "stty: 'standard input': Inappropriate ioctl for device" spam
Browse files Browse the repository at this point in the history
  • Loading branch information
hungtrinh committed Jan 10, 2023
1 parent dadd0c2 commit a910495
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/Zend/ProgressBar/Adapter/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ public function setWidth($width = null)
$this->_width = 80;

// Try to determine the width through stty
if (preg_match('#\d+ (\d+)#', (string) @shell_exec('stty size'), $match) === 1) {
if (preg_match('#\d+ (\d+)#', (string) @shell_exec('stty size 2>/dev/null'), $match) === 1) {
$this->_width = (int) $match[1];
} else if (preg_match('#columns = (\d+);#', (string) @shell_exec('stty'), $match) === 1) {
} else if (preg_match('#columns = (\d+);#', (string) @shell_exec('stty 2>/dev/null'), $match) === 1) {
$this->_width = (int) $match[1];
}
}
Expand Down

0 comments on commit a910495

Please sign in to comment.