MC remains on screen after resize and quit
Hi George,
(How are you doing? After a 3 year break I have a Mac again, so I'm back :))
Start mc (midnight commander), do stuff, exit (F10) or hide the panels (Ctrl+O), it's gone as expected.
Start mc, resize the window, now exit or hide the panels. Most of mc's contents remain on the screen, which is very distracting and unexpected (since mc draws on the alternate screen, whereas the normal screen should be restored).
(Also, during resize, there's an intermittent staircase effect, mc's vertical lines becoming diagonal for a short while.)
Is there a particular reason for these behaviors?
When I implemented rewrapping in gnome-terminal, I settled at this approach (and apparently this is what Terminal.app does too):
Handle the normal screen (including its vertical positioning, cursor location etc.) exactly as if that one was the visible one, except that it's not actually visible because the alternate screen is shown, but it shouldn't matter as for how the normal screen's contents are updated.
(And by the way we don't rewrap the contents of the alternate screen (to avoid the intermittent staircase effect), the app will repaint it anyways.)
With this approach you can run long commands (e.g. "ls -lR somedir") either with mc panels on or off, resize the window with the panels on or off, toggle the panels, repeat these steps in any order, and still have the output of "ls -lR" formatted exactly as if it was originally run at the current window width.
Could you please consider following this approach in iTerm?
In iterm, the output of the command gets corrupted by some mc stuff, and it's also misleading that something that looks like an active mc remains there as dead cells on the normal screen. I don't think cells should ever be moved from the alternate screen to the normal one.
There's a setting "Save lines to scrollback in alternate screen mode" but toggling it didn't make a difference for me.
Thx a lot!
mac 10.10.5; iterm 2.1.1; com.googlecode.iterm2.plist