Skip Menu |

This queue is for tickets about the TermReadKey CPAN distribution.

Report information
The Basics
Id: 133682
Status: new
Priority: 0/
Queue: TermReadKey

People
Owner: Nobody in particular
Requestors: jpierce [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.38
Fixed in: (no value)



Subject: Term::ReadKey does not work on dupped handles in Windows
This works: type CHANGES | perl -e "BEGIN{open($PIPE, '<&=', 'STDIN' ) or die $!; close(STDIN); open(STDIN, '<', 'CON')} print uc(<STDIN>),qq(\n\n); while(<$PIPE>){s/e/EEEE/g; print}" | more This fails spectacularly: type CHANGES | perl -MTerm::ReadKey; -e "BEGIN{open($PIPE, '<&=', 'STDIN' ) or die $!; close(STDIN); open(STDIN, '<', 'CON')} ReadMode(3); $prefix=ReadKey(); while(<$PIPE>){s/e/EEEE/g; print $prefix,$_}" | more SetConsoleMode failed, LastError=|5| at C:/Strawberry/perl/vendor/lib/Term/ReadKey.pm line 346. The process tried to write to a nonexistent pipe.
P.S. MS offers free VMs for development purposes: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ These come in more flavors and might also work: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/