tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Lua binding for curses



On Sun, Aug 06, 2023 at 04:34:44AM +0300, Valery Ushakov wrote:
> 
> Nice.  What is prior art in this area?  I know of
> 
>   https://github.com/lcurses/lcurses
> 
> though I never used it myself and don't know its status.  If it
> already has adoption in the lua community, it makes sense to use it
> and make sure it can be compiled against our curses.  Though that may
> be less fun that writing your own from scratch :)
> 

If it is not suitable or you just want to do your own I would recommend
starting with:

initscr
*refresh
*getch
*move
and the output routines
then the window routines

That would allow you to build a basic curses app.  Leave colour and
pads until last.

> It would be nice to be able to use the same lua binding with both our
> curses and ncurses.  I have a simple screen grabber based on a
> rumpified wsvt25 that I wrote to test and debug the kernel terminal
> emulator(*) and it might be tempting to co-opt it as both wsvt25 *and*
> curses test bed (I know, Brett doesn't like the screen grab approach,
> but I think it has its place :).  Being able to run the same test with
> ncurses and our curses and compare results will be handy.
> 

It isn't that I don't like the screenshot method it is just that with 
curses the journey to the destination is just as important as the
destination.  Just because the output looks right it doesn't mean
curses is operating correctly.  For example if the screen is cleared
by writing blanks to every cell instead of issuing a clear screen
code then the output looks the same but there is a huge difference
in the amount of characters emitted... which is part of the aim
of curses.

-- 
Brett Lymn
--
Sent from my NetBSD device.

"We are were wolves",
"You mean werewolves?",
"No we were wolves, now we are something else entirely",
"Oh"


Home | Main Index | Thread Index | Old Index