Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
perl6 是否已经有了获得 Terminalsize 的东西?
(例如像 perl5 "Term::ReadKey::GetTerminalSize" );
我不知道直接的方法,但是解析qx/resize/应该在 resize 命令可用的系统上工作。
qx/resize/
更新:有点打高尔夫球的解析代码:
my %h = qx/resize/.lines.grep(/\=/).map: { m/(\w+) \= (\d+) /; $/.list }; my ($y, $x) = %h<LINES COLUMNS>;