With Strawberry Perl 5.26.2 (Windows 7) I got some complaints about unknown terminal window size when starting the debugger.
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/vendor/lib/Term/ReadLine/readline.pm line 410
+.
These lines in sub afterinit take care of it:
my ($cols, $lines) = split ' ', (grep { m{^\s*\d+\s+\d+\s}xms } `p
+owershell -command "&{\$H=get-host;\$H.ui.rawui.WindowSize;}"`)[0];
$ENV{'COLUMNS'} = $cols;
$ENV{'LINES'} = $lines;
print "COLUMNS and LINES are set ($cols,$lines).\n";
Powershell is used here to get the console property WindowSize. Then the environment variables COLUMNS and LINES are locally set and the readline.pm module is happy. |