I think I've got the logic working here and I've tested it to the extent I can by hand. If there's a test suite or something similar I should run, please let me know.
Add support for modal usage of ncurses windows
Any chance this is going to be accepted or evaluated soon?
Merge remote-tracking branch 'upstream/master'
+1, could you please merge this? This is working for me.