NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/43839: vi can't resize in -current



The following reply was made to PR bin/43839; it has been noted by GNATS.

From: Julian Coleman <jdc%coris.org.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/43839: vi can't resize in -current
Date: Mon, 6 Sep 2010 07:23:21 +0100

 Hi,
 
 >      resizing an xterm with a vi running in it doesn't work properly.
 >      vi definately notices, but i think it fails to reset the scroll
 >      regions.  it is unable to display anything in the new larger space,
 >      and i believe i see it scrolling ~'s up the screen when the resize
 >      actually happens.
 
 mlelstv@ pointed out that vi no longer calls resizeterm().  Thus, the curses
 structures do not get updated on resize.  We had a local patch for this with
 the old vi:
 
   
http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/vi/cl/Attic/cl_screen.c.diff?r1=1.6&r2=1.7
 
 However, calling resizeterm() in cl_vi_init() didn't seem to work with the
 new vi (I didn't check the code path), so I tried calling resizeterm() from
 the sigwinch check in cl_ssize() - see appended patch.  This worked for me,
 although I haven't tested extensively.
 
 Thanks,
 
 J
 
   - - 8< - - - - - - - - - - - - - Cut here - - - - - - - - - - - - - >8 - -
 --- /usr/cvs/src/dist/nvi/cl/cl_term.c 2009-01-03 20:00:43.000000000 +0000
 +++ src/dist/nvi/cl/cl_term.c  2010-09-06 07:13:37.000000000 +0100
 @@ -414,6 +414,7 @@
                        *rowp = row;
                if (colp != NULL)
                        *colp = col;
 +              resizeterm(O_VAL(sp, O_LINES), O_VAL(sp, O_COLUMNS));
                return (0);
        }
  
   - - 8< - - - - - - - - - - - - - Cut here - - - - - - - - - - - - - >8 - -
 -- 
   My other computer also runs NetBSD    /        Sailing at Newbiggin
         http://www.netbsd.org/        /   http://www.newbigginsailingclub.org/
 


Home | Main Index | Thread Index | Old Index