Ncurses! It lets you draw/print characters at any position in the terminal window. It’s what most C/C++ roguelikes use to render dungeons and stuff.