Update ReadKey.xs to improve compatibility for newer Perl versions.
On newer Perl versions (tested on 5.32.1) the PerlIO_fileno does not return a usable fileno that can be used for GetConsoleScreenBufferInfo, which causes the following error messages:
Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call didn't work. The COLUMNS and LINES environment variables didn't work.
Fallback to GetStdHandle(STD_OUTPUT_HANDLE) will solve this issue.
I have tested this PR on Strawberry Perl 5.32.1 & Windows 10 20H2 x86-64.
Update ReadKey.xs to improve compatibility for newer Perl versions. On newer Perl versions (tested on 5.32.1) the
PerlIO_fileno
does not return a usable fileno that can be used forGetConsoleScreenBufferInfo
, which causes the following error messages:Fallback to
GetStdHandle(STD_OUTPUT_HANDLE)
will solve this issue.I have tested this PR on Strawberry Perl 5.32.1 & Windows 10 20H2 x86-64.