ID:               31516
 Updated by:       [EMAIL PROTECTED]
 Reported By:      csaba at alum dot mit dot edu
-Status:           Open
+Status:           Feedback
 Bug Type:         Feature/Change Request
 Operating System: Windows
 PHP Version:      5.0.3
 New Comment:

Just send the appropriate escape sequence, afaik this should work:

echo chr(27), "[2H";



Previous Comments:
------------------------------------------------------------------------

[2005-01-12 14:26:03] csaba at alum dot mit dot edu

Description:
------------
>From a command line php.exe invoked from a cmd prompt under Win XP Pro,
I'd like to be able to blank the screen and/or determine the screen
height.

Motivation:
I have a program that takes several hours to run and it shows several
lines of progress statistics, which are periodically updated.  I'd like
to keep this presentation professional.

I could simulate what I'm asking by interspersing 1000 "\n" whenever
I'm printing an updated set of stats.  However, this puts the info at
the bottom of the screen.  If I could programatically determine the
height (since it might be changed/stretched/shrunk by the user) of the
DOS (CMD) screen in lines then I could compensate for it (and if you
give me that, I'd like to know the width, too, please).  

Alternately, if there was a simple way to blank the screen with the
cursor starting off at the top left, that might be another way to go
(sort of a PHP issued CLS).

Thanks for considering whether this is possible/reasonable,
Csaba Gabor from Vienna

Note:  This is distinct from http://bugs.php.net/bug.php?id=24109
because (1) as I understand it, ncurses does not apply here because it
does not work for DOS/cmd prompts. (2) I want to reuse the current
window.

Apropos:  Perhaps an alternate approach (Ie. feature request) is to ask
PHP to return a handle to its parent process.  Perhaps it is possible to
query that (using Windows APIs) for its properties.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31516&edit=1

Reply via email to