Skip Menu |

This queue is for tickets about the TermReadKey CPAN distribution.

Report information
The Basics
Id: 24598
Status: rejected
Priority: 0/
Queue: TermReadKey

People
Owner: jns [...] gellyfish.co.uk
Requestors: burak [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.30
Fixed in: (no value)



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...
Hi, I'm not going to make this change. Firstly I cannot reproduce the problem either with ActivePerl or a hand made perl, secondly I don't think that adding a dependency to a module that in fact does exactly the same thing under the hood (via Win32::Console) is the best plan. The error message seems to indicate that the error is actually coming when the module is being used by Term::ReadLine::Perl - please can you let me have an example of the code that you are running that causes the error (if it is in some other software then please just tell me what it is that you are trying to do.)
Hi, I am seeing the same bug on Perl 5.12.4 with the Activestate distribution and Term::ReadKey 2.30 on XP SP3. The error happens when I am using a cygwin terminal (mintty) instead of the default cmd.exe (this may help you to reproduce this bug). The library will die with « 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. » This is not a big problem as it can be trapped with eval. But, before dying, the call to GetTerminalSize also prints on STDERR a message saying that "The specifed file cannot be found" (I don't know the exact message because I get it in French and I did not manage to get it in English). This output on STDERR cannot be suppressed without closing STDERR before a call to GetTerminalSize which is not very convenient... In the same condition Term::Size::Win32 gives an erroneous result but without any output on STDERR (see the attached picture). Ideally no results at all and no output (preferably without dying) would be the best result for the function in this situation.
Subject: a.gif
Download a.gif
image/gif 8.6k
a.gif