Perl6 / Rakudo로 터미널 크기를 얻는 방법은 무엇입니까?
문제
는 Perl6에 이미 터미널 크기를 얻을 수 있습니까?
(예 : 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>;
제휴하지 않습니다 StackOverflow