Connecting Tech Pros Worldwide Help | Site Map

Console width

  #1  
Old March 26th, 2008, 01:15 PM
=?ISO-8859-1?B?QW5kcukgSORuc2Vs?=
Guest
 
Posts: n/a
Hi,

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

Regards,
André
  #2  
Old March 26th, 2008, 01:35 PM
Jerry Stuckle
Guest
 
Posts: n/a

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
==================

  #3  
Old March 26th, 2008, 03:55 PM
C. (http://symcbean.blogspot.com/)
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Console width and height, MS Visual C++ Piotrek answers 28 May 9th, 2007 12:05 AM
IIS, ASP, wshell.run, command prompt, console width, height maykil ceksin answers 0 October 25th, 2006 12:55 AM
console width? Gernot Frisch answers 2 December 1st, 2005 08:55 PM