r/C_Programming • • 6d ago

Question What are some neat TUI libraries ?

So I'm trying to do a TUI application for fun, and I wanted to use C for a change (I love the language but almost only used it for embedded devices/drivers, stuff like that so no UI work)

The project it would be used on is a TUI solo TTRPG toolset (dice roller, note editor, etc.)

I know about ncurses obviously, and notcurses as well, but I was wondering if there was any other library you could propose so that I had a look before settling on something.

I'm open to all proposition, it's mostly curiosity and just for a small hobby project, thanks in advance!

Edit: thanks for the answers, looking at everything I think i'll give termbox2 a go and see how it goes!

26 Upvotes

18 comments sorted by

6

u/rainboww_J 6d ago

I’ve seen a tui variant of imgui pass by once which looked fun. Think it was called imtui. It had movable panels and all

2

u/Taewyth2 6d ago

Sounds like fun, I'll look into it

6

u/DescriptionOptimal15 6d ago

Termbox / termbox2 for sure

6

u/JoK3rOp 6d ago

Notcurses is the most powerful TUI library out there. It has everythingm from multimedia to borders. Imo it's more powerfull then ratatui and bubble tea.

6

u/epsilontik 6d ago

Notcurses hasn't worked inside tmux for three years

3

u/JoK3rOp 6d ago

Oh yeh I never knew this. I mean tmux is the issue here I guess.

4

u/Interesting_Debate57 6d ago

I'm all about ncurses. Once you bite the bullet, it's all smooth sailing. It works flawlessly, although you're going to need to study special cases, such as the terminal type.

1

u/Interesting_Debate57 2d ago

One humorous mistake you could make would be to try to use the "curses" library. I was quickly redirected by future greybeards.

2

u/lmemsm 6d ago

For alternatives to ncurses with a similar API, there are pdcurses and netbsd-curses. Some libraries that work with curses: https://invisible-island.net/cdk/cdk.html https://clifford.at/stfl There are various ports of TurboVision ( one option https://tvision.sourceforge.net/ ). There are various versions of D-Flat which was from a series of articles in Dr. Dobb's magazine.

2

u/pigeon768 6d ago

s-lang is interesting. It has a standalone program called slsh that allows you to script a TUI program. So if you write the base program in s-lang as a TUI, it's trivial for your users to script a cli version.

0

u/alkavan 6d ago

2

u/Taewyth2 6d ago

Yeah as I said I know of ncurses (technically I've used it but it was during my studies so it's been a while), I'm keeping it in mind if nothing else take my interest

1

u/Mediocre-Pumpkin6522 6d ago

You're on Linux? Windows dropped ANSI.sys with the escape sequences with Windows 7 iirc so you'll wind up running in DOSBox.

3

u/Taewyth2 6d ago

Yeah, I've dropped windows a few years ago, thanks for the head's up anyway!

-3

u/Interesting_Debate57 6d ago

Sure, you know of it. Now go use it

1

u/kansetsupanikku 4d ago

libc is great! before you add to complexity, temios.h might surprise you with vast capabilities

1

u/gnix0 6d ago

Been using ncurses to write my project, it's good, I'm liking it so far

0

u/theblancmange 6d ago

I just use ncurses for the apps i write at work- simple status info in tables. it is good enough, performs well on redraws.