Question

est là pour Perl6 déjà quelque chose pour obtenir la terminalalisation?

(par exemple comme le Perl5 "Terme :: Readkey :: getterminalsize");

Était-ce utile?

La solution

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>;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top