Subject: | Term::ProgressBar does not determine terminal size properly for filehandle-type output |
If you attempt to instantiate
my $bar = Term::ProgressBar->new({
....
fh => $fh,
});
and $fh is not stdout, and stdout is redirected to a file, then
Term::ProgressBar emits warnings that it cannot find the width of the
terminal (and, in fact, cannot determine the width of the terminal, even
if $fh is open to a terminal).
Line 297 of ProgressBar.pm states:
$result = (Term::ReadKey::GetTerminalSize($fh))[0];
The first line of GetTerminalSize states:
my($file) = normalizehandle((@_>1?$_[1]:\*STDOUT));
It should be calling Term::ReadKey->GetTerminalSize($fh) instead (as a
class method, not just a fully qualified function name).