StrawberryPerl / Perl-Dist-Strawberry

Tooling to build and package releases for Perl on Windows.
https://strawberryperl.com
Other
286 stars 48 forks source link

Too much verbosity while starting pdl2 #25

Closed sumanstats closed 1 year ago

sumanstats commented 3 years ago

I am trying to use PDL library from the portableshell that comes with https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-64bit-PDL.zip interactively.

But starting pdl2 in the shell throws so much verbose message, looks like related to Term::Readline:

Loading DB routines from perl5db.pl version 1.57
Editor support available.

Enter h or 'h h' for help, or 'perldoc perldebug' for more help.

main::(-e:1):   1
Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call didn't work. The COLUMNS and LINES environment variables didn't work. at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadLine/readline.pm line 410.
 at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadKey.pm line 462.
        Term::ReadKey::GetTerminalSize(GLOB(0x28512b0)) called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadLine/readline.pm line 410
        readline::get_window_size called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadLine/readline.pm line 1114
        readline::init called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadLine/readline.pm line 208
        require Term/ReadLine/readline.pm called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadLine/Perl.pm line 63
        eval {...} called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadLine/Perl.pm line 63
        Term::ReadLine::Perl::new("Term::ReadLine", "perldb", GLOB(0x2b5b9c8), GLOB(0x28512b0)) called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/lib/perl5db.pl line 6868
        DB::setterm() called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/lib/perl5db.pl line 1849
        DB::_DB__read_next_cmd(undef) called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/lib/perl5db.pl line 2789
        DB::DB called at -e line 1
SetConsoleMode failed, LastError=|5| at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadKey.pm line 346.
 at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadLine/readline.pm line 1581.
        readline::readline("  DB<1> ") called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/vendor/lib/Term/ReadLine/Perl.pm line 11
        Term::ReadLine::Perl::readline(Term::ReadLine::Perl=ARRAY(0xd7fd08), "  DB<1> ") called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/lib/perl5db.pl line 7367
        DB::readline("  DB<1> ") called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/lib/perl5db.pl line 1858
        DB::_DB__read_next_cmd(undef) called at C:/strawberry-perl-5.32.1.1-64bit-PDL/perl/lib/perl5db.pl line 2789
        DB::DB called at -e line 1
  DB<1>

This is my Windows system.

> systeminfo

Host Name:                 SUMANKHANAL
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19042 N/A Build 19042
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          N/A
Registered Organization:   N/A
Product ID:                00331-20350-00000-AA867
Original Install Date:     10/19/2020, 3:36:49 PM
System Boot Time:          5/20/2021, 12:54:06 PM
System Manufacturer:       Dell Inc.
System Model:              Inspiron 5379
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 142 Stepping 10 GenuineIntel ~2001 Mhz
BIOS Version:              Dell Inc. 1.12.0, 5/9/2019
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC+05:45) Kathmandu
Total Physical Memory:     8,026 MB
Available Physical Memory: 1,189 MB
Virtual Memory: Max Size:  14,682 MB
Virtual Memory: Available: 4,330 MB
Virtual Memory: In Use:    10,352 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\SUMANKHANAL
Hotfix(s):                 9 Hotfix(s) Installed.
                           [01]: KB4601554
                           [02]: KB4562830
                           [03]: KB4577266
                           [04]: KB4580325
                           [05]: KB4586864
                           [06]: KB4593175
                           [07]: KB4598481
                           [08]: KB5003173
                           [09]: KB5003242
Network Card(s):           3 NIC(s) Installed.
                           [01]: TAP-Windows Adapter V9
                                 Connection Name: Ethernet 2
                                 Status:          Media disconnected
                           [02]: Hyper-V Virtual Ethernet Adapter
                                 Connection Name: vEthernet (Default Switch)
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 172.18.0.1
                                 [02]: fe80::3598:e844:d6de:8022
                           [03]: Qualcomm QCA61x4A 802.11ac Wireless Adapter
                                 Connection Name: Wi-Fi
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.1.254
                                 IP address(es)
                                 [01]: 192.168.1.83
                                 [02]: fe80::b44c:6125:d241:7731
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.
shawnlaffan commented 1 year ago

I think this has been fixed in more recent versions of PDL but could be mistaken. I cannot replicate the issue with PDL 2.077 on Strawberry perl 5.032 and PDL 2.058 on SP 5.28.0.

If you cannot update your PDL version then the workaround is to set your terminal to dumb.

set TERM=dumb
perl -d somescript.pl

See details in https://stackoverflow.com/questions/54324750/cpan-error-unable-to-get-terminal-size-the-win32-getconsolescreenbufferinfo-ca and related Strawberry issue in https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/38#issuecomment-1420408896

shawnlaffan commented 1 year ago

I don't think there is anything more to do on this issue so I'll close it. If there are continuing issues despite the workaround then please re-open, or open a new issue.