For C++, there is also ImTui that I wrote sometime ago:

https://github.com/ggerganov/imtui

I made a few sample apps with it, such as HN client and a WTF configuration tool. They are both linked in the repo if you are interested.

I still want to make some other cool terminal app with it, but haven't found a nice idea yet.

So, does that actually work in a proper terminal? Or is it only when you have a framebuffer available?

> does that actually work in a proper terminal?

Yes - all of the examples in the linked repo run in the terminal and are also ported to the Web using Emscripten.

> Or is it only when you have a framebuffer available?

ImTui creates a framebuffer and renders the scene using ASCII characters into the framebuffer. To create the scene, you can use the entire API of Dear ImGui [0] - it has various options for creating windows, buttons, sliders, tables, checkboxes, colors, etc.

You now need to display this framebuffer somehow and also provide input from the keyboard and the mouse. ImTui provides an ncurses interface for this. It uses the ncurses API to render the characters in the terminal and also to grab input from the keyboard and the mouse.

Technically, ncurses is an overkill for this application, since ImTui only uses only a very small subset of the ncurses functions. But this was the easiest way to make it work.

ImTui can be extended with more interfaces. For example, I made a second one which I call "Emscripten" interface. It's purpose is to provide an API to easily export the framebuffer to the JS layer and to easily grab input back from the JS layer. This way, I can have a single application code that builds and runs both in the terminal and on the web.

[0] https://github.com/ocornut/imgui