2022/10/28

From Woozle Writes Code
Revision as of 16:51, 28 October 2022 by Woozle (talk | contribs)
Jump to navigation Jump to search
Friday, October 28, 2022 (#301)
Thursday Friday Saturday

I really need a way to have multiple rewriteable status lines in CLI, and it looks like the way to do that is via ncurses, but connecting PHP with ncurses looks complicated and fragile... plus I kinda feel like it should just be implemented natively in PHP, because doing terminal escape codes is not super-complicated (I did it in frickin' FORTRAN IV) and I don't need fancy windowing stuff that ncurses does. I've tried to find the source code for ncurses, to see what the escape codes are (mainly the magic it uses to determine which terminal is being emulated), but so far no luck.

This feels like a simple problem that has somehow been made unmanageably difficult.

ANSI escape codes seem like they may offer a solution. It's probably not as universally-compatible as using some library based on Terminfo[1], as ncurses seems to be, but I can wrap it in a class-family that will make it relatively easy to add support for other terminal code-sets later.

Query: Why isn't there a universal interface for PHP to talk to arbitrary .so libraries, the way Visual Basic does with ActiveX DLLs? How do .so libraries even work?

Footnote

  1. ...which, trivia, was first written by a trans woman