Connecting Tech Pros Worldwide Forums | Help | Site Map

Console width

=?ISO-8859-1?B?QW5kcukgSORuc2Vs?=
Guest
 
Posts: n/a
#1: Mar 26 '08
Hi,

when I use PHP on the command line, is there a way to get the current
console's width (in characters)?

Regards,
André

Jerry Stuckle
Guest
 
Posts: n/a
#2: Mar 26 '08

re: Console width


André Hänsel wrote:
Quote:
Hi,
>
when I use PHP on the command line, is there a way to get the current
console's width (in characters)?
>
Regards,
André
>
Not directly, and I can't seem to find a way to do it indirectly. For
instance, you can get some info from the ANSI escape sequences if the
system supports them (most do nowadays), but it doesn't look like width
is one of them.

It sounds like it could be useful, though.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

C. (http://symcbean.blogspot.com/)
Guest
 
Posts: n/a
#3: Mar 26 '08

re: Console width


On 26 Mar, 13:27, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
André Hänsel wrote:
Quote:
Hi,
>
Quote:
when I use PHP on the command line, is there a way to get the current
console's width (in characters)?
>
>
Not directly, and I can't seem to find a way to do it indirectly. For
instance, you can get some info from the ANSI escape sequences if the
system supports them (most do nowadays), but it doesn't look like width
is one of them.
>
I'd have thought it would be in ncurses but a quick gander at the dox
did not turn up anything relevant. The 'resize' command works with
most terminals (except weird things like Data General 400s) and is
driven by the data in Termcap -you could laways run it from PHP or
read its source code.

C.
Closed Thread