mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-12-23 13:17:54 +00:00
parallel: Use stty -a </dev/tty
if resize
does not work to find $COLUMNS of terminal.
This commit is contained in:
parent
338ea44e27
commit
2e68cd95dc
|
@ -2268,6 +2268,10 @@ sub progress {
|
|||
my $resize = qx{ sh -c 'resize 2>/dev/null' };
|
||||
$resize =~ /COLUMNS=(\d+);/ and do { $columns = $1; };
|
||||
}
|
||||
if(not $columns) {
|
||||
my $stty = qx{ stty -a </dev/tty };
|
||||
$stty =~ /(\d+) columns/ and do { $columns = $1; }
|
||||
}
|
||||
$columns ||= 80;
|
||||
}
|
||||
return $columns;
|
||||
|
|
Loading…
Reference in a new issue