Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 26th, 2008, 01:15 PM
=?ISO-8859-1?B?QW5kcukgSORuc2Vs?=
Guest
 
Posts: n/a
Default Console width

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
Default 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
Default 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.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles