When a program displays "static text" or is otherwise exercising control over the whole terminal display, it is actually printing commands to the terminal using hidden control characters (like those shown in your blob). See answer here. Libraries like ncurses
provide a portable API for terminal control by getting information about the host terminal from terminfo.
In your project, I suppose you'll have to obtain some kind of dictionary of the host's command sequences and filter or interpret them to display properly when printed to the client's terminal. You might take a look at the colorama project, which translates ANSI command sequences into Win32 calls to properly control a Windows command terminal. But that's for Python, which I know nothing about.