in reply to Printing Escape Characters

Yes, definitely curses. This is a package that was specifically designed to handle TTY terminals or their equivalent, allowing you to express what you want to do, at a fairly high level, and have curses do it.