According to the man page for curs_initscr:
If newterm is called more than once for the same terminal, the first terminal referred to must be the last one for which endwin is called.
I have taken this to read that if I have several WINDOW
s, all against a terminal type of screen-256color, whichever one I newterm()
first, must be last one closed.
If this is the case — in an application where there many newterm()
invocations of many different terminal types, how are you supposed to track them and close them correctly?
My specific applications is network based and uses the TELNET protocol to determine the terminal type, passing the information to ncurses. I am having strange behaviour on closing connections with I think is due to calling endwin()
incorrectly.