473,320 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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é
Mar 26 '08 #1
2 1756
André Hänsel wrote:
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.
js*******@attglobal.net
==================

Mar 26 '08 #2
On 26 Mar, 13:27, Jerry Stuckle <jstuck...@attglobal.netwrote:
André Hänsel wrote:
Hi,
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.
Mar 26 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Raaijmakers, Vincent (IndSys, GE Interlogix) | last post by:
Ok, perhaps a question on a newbie level. I try to create a simple 'write to a console application' where all the items in a string do have a variable size: items = Well, actually, I need to...
5
by: kevin | last post by:
using VS 2003 I have a console app and writing to the console looks ugly as the line wraps at exactly 80 characters. Short of counting every character, is there an easier way to format my...
3
by: Roy Gourgi | last post by:
Hi, How would I set the width of lnSize to 6 in the statement Console.WriteLine("Size of {0} ", lnSize); Furthermore is there a way to combine these 3 statements into 1 ...
3
by: Mr Mind - Lion | last post by:
Is there any way in .NET to force to run console application through it and get the result of tht application in our program. Please reply me quickly. Any reply will highly be appreciated....
2
by: Gernot Frisch | last post by:
Is there an std way to get the width of my console window? If not - how to do it on Win32? -- -Gernot int main(int argc, char** argv) {printf ("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g',...
0
by: maykil ceksin | last post by:
Hi, Is there anyone knows which user profile is using by IIS while running an DOS application within asp with wshell.run command. To describe my problem clear; I'm using a DOS command and...
28
by: Piotrek | last post by:
<<If this message is duplicated, please ignore the previous one, I had some connection problems>> Hi, Could you please tell me how to check width and height of Windows console program...
4
intOwnsVoid
by: intOwnsVoid | last post by:
Point.h #pragma once #include <iostream> using namespace std; class Point {
9
by: Nathan Sokalski | last post by:
I have a Console Application, and when I do a "Start Without Debugging" to test it, everything works, but it will not allow me to make the window wider than half my screen. Even if I maximize it,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.