[Mutt] #2960: Terminal resize problem after editor is called
#2960: Terminal resize problem after editor is called
Mutt (ncurses?) doesn't seem to properly catch up upon terminal resize
when the editor is involved. I have two scenarios where I can exactly
reproduce it on OS X (xterm in Apple's X11 and Terminal.app) and FreeBSD
(xorg's xterm). I use mutt hg tip with ncursesw 5.6 in all 3 cases.
Scenario 1:
* In the index, edit a message, quit without saving.
* Enlarge the screen just a little bit.
* Repeat step 1).
* Now the index is drawn as if the terminal wasn't resized in step 2.
Scenario 2:
* From the index, start composing a message, edit message in the editor.
* Leave the compose menu without postponing and sending.
* Enlarge the terminal just a little bit.
* Repeat step 1)
* Now the compose menu is drawn as if the terminal wasn't resized in step
3).
* When comming back to the index, it's also drawn as if no resize
happened.
In both cases, when resizing the terminal from the index, mutt recognizes
the new size and everything seems to work fine again. However, once the
editor was invoked either way, things are broken afterwards again.
The only way to make mutt usable again is to exit it and restart. This is
especially true when the terminal is made smaller since it completely
messes up everything.
I've put some debug printing in and it turns out that LINES and COLS are
really the narrower old sizes afterwards, so mutt does everything right
with wrong values reported by curses.
Especially the fact that mutt gets the original size (just when mutt was
started) over and over again if endwin() is called in between makes we
wonder whether it's curses having a problem to catch up upon resizing or
if it's mutt. But I'm by no means a curses expert.
--
Ticket URL: <http://dev.mutt.org/trac/ticket/2960>