Console width

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

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


Re: Console width

André Hänsel wrote:
Quoted text here. Click to load it

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.

Re: Console width

Quoted text here. Click to load it

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.


Site Timeline