是有没有东西可以获得终端化?

(例如perl5“术语:: 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