Is there for perl6 already something to get the Terminalsize?
( for example like the 开发者_JAVA百科perl5 "Term::ReadKey::GetTerminalSize" );
I'm not aware of a direct method, but parsing qx/resize/
should work on systems where the resize command is available.
Update: somewhat golfed parsing code:
my %h = qx/resize/.lines.grep(/\=/).map: { m/(\w+) \= (\d+) /; $/.list };
my ($y, $x) = %h<LINES COLUMNS>;
精彩评论