Python Forum
terminal emulation - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: terminal emulation (/thread-18635.html)



terminal emulation - Skaperen - May-25-2019

does anyone know of any Python code that can do the screen formatting part of terminal emulation? i need to feed it a stream like a terminal would get and periodically get an array of the screen layout.


RE: terminal emulation - Larz60+ - May-26-2019

curses: https://docs.python.org/3/howto/curses.html


RE: terminal emulation - Skaperen - May-26-2019

curses uses terminal type info to generate a terminal data stream that carries out the logical requests of the code that calls curses. what i need is kinda the opposite ... take the terminal stream output as input and fill in an array of characters in the places commanded by the various escape sequences and character bytes that are being sent by whatever sends proper sequences (such as curses, but many programs do this without curses). if i do not find anything that can just do this, i will end up stripping out select code from Linux kernel source, which does this for VTs. i'm hoping for something in Python but i will do C if i must.


RE: terminal emulation - heiner55 - May-26-2019

Sorry, wrong thread.