Skip Menu |

This queue is for tickets about the Term-ProgressBar CPAN distribution.

Report information
The Basics
Id: 38767
Status: open
Priority: 0/
Queue: Term-ProgressBar

People
Owner: Nobody in particular
Requestors: twhaples [...] airwave.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.09
Fixed in: (no value)



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).
Could you please provide a test case? Oh and the source code now lives here: https://github.com/szabgab/Term-ProgressBar