libcliscreen is a small C library useful for drawing on the terminal window as if it were a raster screen. Its original purpose was to be used for terminal games, but it may also be used for building simple TUI applications.

A key feature of the library is that the screen’s size can be fixed. For example, if a game needs a screen of exactly 60x20 characters but the terminal window is larger than that, the library will add a margin around those 60x20 characters.

Snake-CLI, a small terminal game I made using libcliscreen

libcliscreen offers functions to clear the screen, set a single character, fill a rectangle and write strings. It’s also possible to use ANSI escape codes to add colors to the characters.

I’ve also written manpages for most of the library’s functions. These may be useful when using them.

Manpage for the cliscreen_create function

View on GitHub: click here