Outputs;#!/usr/bin/env perl use strict; use warnings; chomp(my @lines = `stty -a`); my ($rows, $columns); for (@lines) { $rows = $1 if /rows (\d+);/; # linux $rows = $1 if /(\d+) rows;/; # FreeBSD $columns = $2 if /columns (\d+);/; # line $columns = $1 if /(\d+) columns;/; # FreeBSD } print "rows $rows columns $columns\n";
On my FreeBSD clone.rows 45 columns 118
In reply to Re: bulletproof way of finding size of terminal?
by bruceb3
in thread bulletproof way of finding size of terminal?
by bcrowell2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |