I’m building Termisu, a small, minimal terminal API inspired by Termbox and Termbox-Go. The goal is to offer a simple, lightweight foundation for building text based UIs on *nix systems.
I don’t use Windows myself, so cross-platform support isn’t on my immediate roadmap, but I’m open to contributions if anyone wants to explore that side.
If you’d like to try it out and give feedback or suggestions, I’d really appreciate it!
Good Catch, thanks for reporting, I just pushed a fix for the bug.
The problem was in the terminfo parser:
Wrong EXTENDED_MAGIC constant: Was using octal 0o542 (354) instead of decimal 542, causing incorrect offset calculations for 32-bit extended terminfo format
Incomplete capability ordering: Missing the complete 414-entry STRING_CAPS array in correct ncurses order
The fix implements proper name-based capability lookup and correctly handles extended format. With TERM=xterm-256color, you should now get clean ANSI sequences like \e[?1049h instead of the garbage %p1%dG output.
The different behavior across terminals likely depends on whether they use standard (16-bit) vs extended (32-bit) terminfo format.
Pull the latest changes and it should work correctly!