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
falkenhawk committed Dec 5, 2022
1 parent 9bf004f commit 4ac34de
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ 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) {
$this->_width = (int) $match[1];
Expand Down

0 comments on commit 4ac34de

Please sign in to comment.