The author of Notcurses released version 3.0.0 several days ago, a ton of work went into that! https://github.com/dankamongmen/notcurses/releases/tag/v3.0....
Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
21–30 of 33 posts
Re: Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
#22Somewhat related ... Is there a proper name for a "top-like interface" ? I think that "TUI" refers very broadly to any terminal user interface and both 'vim' and 'alpine' and 'top' would fall under this broad category. But is there a specific name for a refresh-every-second, full page status output - like 'top' ? Is there a standard library for creating such an interface, or do people always use curses ? Presumably c…
TUI generally refers to a program that’s “full screen” with respect to the terminal it’s running in. Programs that don’t drive the whole terminal screen, instead generating output that may be mixed with other output in the same terminal, are often referred to as CLIs. curses dates back to around 1980: https://en.wikipedia.org/wiki/Ncurses#History
I guess I'll just keep calling it a "top-like interface".
Re: Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
#23Happy was the day I gave up on curses and just started splatting crap at the terminal with my own control codes. For too long did I think that curses was the one and only way to do anything with a terminal.
Re: Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
#24From page 8: "We don’t switch from blue to some other specified color, because we don’t know the background color of the terminal. Some people, possibly aliens, don’t favor a dark terminal background. If the terminal background were white, and we had just used e.g. ncdirect_fg(n, 0xffffff), text following “house” would be invisible. "One might observe that a user with a blue background will have invisible “house” tex…
Re: Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
#25The author of Notcurses released version 3.0.0 several days ago, a ton of work went into that! https://github.com/dankamongmen/notcurses/releases/tag/v3.0....
These release notes are such a joy to read.
Re: Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
#26From page 8: "We don’t switch from blue to some other specified color, because we don’t know the background color of the terminal. Some people, possibly aliens, don’t favor a dark terminal background. If the terminal background were white, and we had just used e.g. ncdirect_fg(n, 0xffffff), text following “house” would be invisible. "One might observe that a user with a blue background will have invisible “house” tex…
Re: Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
#27Ok, if you're looking into notcurses, you may want to watch this: https://www.youtube.com/watch?v=dcjkezf1ARY (~ 6') the WTF effect that video had on me lasted quite a while. I still can't describe it.
i'm working on a new one now which is going to be some absolute Wizard of Oz shit; stay tuned. =] hack on!
Re: Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
#28Happy was the day I gave up on curses and just started splatting crap at the terminal with my own control codes. For too long did I think that curses was the one and only way to do anything with a terminal.
Care to elaborate on the control codes over curses? I’m curious :]
Taking a peek under covers to see how easy it is. A couple printfs from whatever language is way way less overhead than bundling in the whole of curses.
Re: Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
#29Happy was the day I gave up on curses and just started splatting crap at the terminal with my own control codes. For too long did I think that curses was the one and only way to do anything with a terminal.
Care to elaborate on the control codes over curses? I’m curious :]
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f729679...
Turning the cursor on and off, 24 bit color, etc. A lot is possible though you potential sacrifice portability (which in 2021 translates to “don’t expect your stuff to render properly if your at the Linux console, and everywhere else it is fine.”)
Re: Hacking the planet with Notcurses: a guide to TUIs (2020) [pdf]
#30From page 8: "We don’t switch from blue to some other specified color, because we don’t know the background color of the terminal. Some people, possibly aliens, don’t favor a dark terminal background. If the terminal background were white, and we had just used e.g. ncdirect_fg(n, 0xffffff), text following “house” would be invisible. "One might observe that a user with a blue background will have invisible “house” tex…
WITH THAT SAID, Notcurses can now acquire the default background from the terminal (this was not true when I wrote the book, sigh), and I fully support @akkartik's approach given this fact. Using NCALPHA_HIGHCONTRAST together with explicit reproduction of the user's chosen background is a complete and general solution to this problem, and I really ought update the book. Thanks, @akkartik!