<<< Date Index >>>     <<< Thread Index >>>

Re: [Mutt] #2960: Terminal resize problem after editor is called



#2960: Terminal resize problem after editor is called

Comment (by pdmef):

 I've patched the source as follows:

 {{{
 diff --git a/resize.c b/resize.c
 --- a/resize.c
 +++ b/resize.c
 @@ -54,7 +54,10 @@ void mutt_resize_screen (void)
      {
        SLtt_Screen_Rows = w.ws_row;
        SLtt_Screen_Cols = w.ws_col;
 +      dprint(1,(debugfile,"resize: %d,%d\n", SLtt_Screen_Rows,
 SLtt_Screen_Cols));
      }
 +    else
 +      dprint(1,(debugfile,"resize: ioctl() failed\n"));
      close (fd);
    }
    if (SLtt_Screen_Rows <= 0)
 @@ -80,6 +83,9 @@ void mutt_resize_screen (void)
    stdscr = newwin (0, 0, 0, 0);
    keypad (stdscr, TRUE);
  #else
 -  resizeterm (SLtt_Screen_Rows, SLtt_Screen_Cols);
 +  {
 +    int rc = resizeterm (SLtt_Screen_Rows, SLtt_Screen_Cols);
 +    dprint(1,(debugfile,"resize: resizeterm(%d,%d) = %d\n",
 SLtt_Screen_Rows, SLtt_Screen_Cols, rc));
 +  }
  #endif
  }
 }}}

 and run mutt:

 {{{
 $ mutt -nF /dev/null -e 'set editor=true' -f ...
 }}}

 I...

  * go to a message, hit e, everything is fine.
  * enlarge the terminal, everything is fine.
  * hit e, mutt redraws everything as if I didn't change the size.

 I can repeat steps 2 and 3 as often as I want, after 3 it always redraws
 the screen using the size as it was when I started mutt. The debug log
 shows these lines:

 {{{
 resize: 35,98
 resize: resizeterm(35,98) = 0
 resize: 50,135
 resize: resizeterm(50,135) = 0
 resize: 50,135
 resize: resizeterm(50,135) = 0
 resize: 60,163
 resize: resizeterm(60,163) = 0
 resize: 60,163
 resize: resizeterm(60,163) = 0
 resize: 73,189
 resize: resizeterm(73,189) = 0
 resize: 73,189
 resize: resizeterm(73,189) = 0
 resize: 78,213
 resize: resizeterm(78,213) = 0
 resize: 78,213
 resize: resizeterm(78,213) = 0
 }}}

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/2960#comment:8>