9

Is there a Windows equivalent of ncurses for PHP?

I've created a CLI script and want to display various statistics (currently processed record, completion percentage etc.) in a nice way, without outputting loads and heaps of text to the cmd.exe window.

The ncurses extension doesn't work on Windows.

4
  • 2
    Looks like our best bet is pdcurses, once someone decides that it would be a good idea to make a PHP module for it. Sep 20, 2010 at 5:28
  • 1
    I think you're right. I'll leave this question open until then.
    – demonkoryu
    Sep 20, 2010 at 17:10
  • 1
    In the last couple of years, Microsoft has added nearly complete, modern support for VT100 XTerm escape sequences to the Windows 10 console (it's not a flawless implementation but it's passable). I built a simple PHP class that emits a wide variety of XTerm-compatible sequences that seems to work fine on Windows 10: github.com/cubiclesoft/php-misc/blob/master/support/xterm.php It's not ncurses, but it can be used to output those statistics in your CLI script you were wanting a decade ago. Oct 28, 2021 at 20:32
  • @CubicleSoft Thanks, now I feel I need to write an ETL program again 😅
    – demonkoryu
    Oct 28, 2021 at 21:21

2 Answers 2

3

ncurses only works for unix-like environments so you can use cygwin but [Link outdated] looks promising. Check it out and let me know!

(Edit Apr 2016: removed the link as it's out of date and clicking on it takes you down a nasty path.)

1
  • 1
    Thanks. I know about Cygwin, but I'm trying to do this with the native Windows console. It doesn't have to be ncurses, just an equivalent solution for Windows.
    – demonkoryu
    May 22, 2010 at 10:30
2
+50

There is pdcurses which I believe works in a windows console window. The aren't any PHP bindings so you would need to build your own.

1
  • I don't have enough knowledge of C or the PHP core to be able to do that. Sep 15, 2010 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.