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 6e5b413
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,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 6e5b413

Please sign in to comment.