I create a program that displays some information in ncurses and then opens vim (using system) to allow the user to edit the file. However, after vim exits, the ncurses screen will not be redrawn. refreshand wrefreshdo nothing, which leads to the complete destruction of my beautiful menu.
So, I am returning to the command line. Menu items are redrawn when I go to them. Moving a bit leads to what looks like this:

As you can see, I am no longer in my beautiful ncurses environment,
I could completely tear down ncurses and set things up again, but then some things (like menu position) are not saved.
How to do it right? Is there a better way to invoke some external program and return here gracefully?
source
share