mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2025-01-11 09:07:55 +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' };
|
my $resize = qx{ sh -c 'resize 2>/dev/null' };
|
||||||
$resize =~ /COLUMNS=(\d+);/ and do { $columns = $1; };
|
$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;
|
$columns ||= 80;
|
||||||
}
|
}
|
||||||
return $columns;
|
return $columns;
|
||||||
|
|
Loading…
Reference in a new issue