开发者

How to get the Terminalsize with perl6/rakudo?

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>;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜