Comparing screen output is difficult because ncurses only updates the changed parts of the screen using cursor addressing and other methods. Instead, the best approach is to compare the contents of a screen known as ncurses at different points in time.
You can create a dump screen using instr to get the text (but this omits attributes like color). The Python interface for ncurses also has inch (but it is assumed that the characters are 8 bits)
It would be nice to use putwin , but this (until recently) kept the window in binary form. The upcoming ncurses6 uses a text dump , which can be difficult. This change is not displayed to callers (since putwin / getwin always treated the file format as secret), and in principle, it can be included in the ncurse5 assembly. To do this, you probably have to create your own ncurses.
Thomas dickey
source share