Subject: | A fix neded for GetTerminalSize() under Win32 |
I got this error under Windows XP SP2 with Perl 5.8.8.819:
Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call
didn't work. The COLUMNS and LINES environment variables didn't work.
The resize program didn't work. at C:/Perl/lib/Term/ReadKey.pm line
362.
Compilation failed in require at C:/Perl/lib/Term/ReadLine/Perl.pm
line 64.
Adding this patch to line 324 seems to fix the error:
if ( @results < 4 && $^O eq 'MSWin32') {
require Term::Size::Win32;
my($columns, $rows) = Term::Size::Win32::chars(*STDOUT{IO});
my($x, $y) = Term::Size::Win32::pixels();
@results = ($columns, $rows, $x, $y);
}
And you need to add Term::Size::Win32 to your PREREQ dynamically...