in reply to How to get the width of a console window?
Here are a couple of other snippets which may( or may not :-) ) work for you :
#!/usr/bin/perl use Term::ReadKey; ($wchar, $hchar, $wpixels, $hpixels) = GetTerminalSize(); print "$wchar\t$hchar\t$wpixels\t$hpixels\n";
#!/usr/bin/perl @x = qx(stty -a); @y = split(/;/, $x[0]); print "screen size is $y[1] $y[2]\n"; ########################################### #Also, you can specify 'size' to avoid parsing; ($rows, $cols) = split ' ', qx"stty size </dev/tty 2>/dev/null"; print "screen size is $rows x $cols\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to get the width of a console window?
by bmcatt (Friar) on Jun 07, 2004 at 16:33 UTC |