문제

는 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>;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top