NetBSD-Bugs archive

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

Re: install/51374: sysinstall leaves serial console in non-scrolling state



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

From: Julian Coleman <jdc%coris.org.uk@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: install/51374: sysinstall leaves serial console in non-scrolling state
Date: Fri, 29 Jul 2016 16:30:03 +0100

 Hi,
 
 >  > 	Sysinstall should remove the scroll region whenever it is going
 >  > 	to exit from its "heavily controlled display" mode.  Thus it
 >  > 	should do so at exit (before shutting down the newly-installed
 >  > 	system) as well as any time the user requests "exit to shell".
 >  
 >  Isn't this a curses problem?
 
 It does sound like one, but see below.
 
 For vtxxx-based terminals (including Xterm), it's necessary to reset the
 scrolling region to the size of the screen to avoid strange effects like
 this.  Our curses code does do this - see refresh.c lines 1715 onward:
 
   tputs(tiparm(change_scroll_region, top, bot),
       0, __cputchar);
     ...
   tputs(tiparm(change_scroll_region,
       0, (int) __virtscr->maxy - 1), 0, __cputchar);
 
 where we initially set a smaller scrolling region (from "top" to "bot")
 then restore it (from "0" to __virtscr->maxy - 1).  There isn't a code
 path were we don't restore it.
 
 > 	When sysinstall starts up, it appears to establish a "scroll
 > 	region" on lines 1 through 24.  If you're running sysinstall
 > 	within a qemu emulator session, and your terminal session is
 > 	"tall" (ie, has more than 24 lines;  mine has 36), then when
 > 	sysinstall exits, it leaves the scroll region intact.  
 
 In the above, "__virtscr->maxy - 1" should be equal to the height of the
 terminal minus 1 (we count internally from row 0).  I would guess that
 something goes wrong when we try and determine the screen size, and we
 end up guessing 24 lines.  Thus, when we reset the scrolling region to
 the size of the screen, we actually set it to the wrong size.
 
 Does sysinst only use the first 24 rows of the screen?
 
 It looks like some terminals accept an empty scrolling region to reset it
 to the default (row 1 to max row).  We might be able to use that instead
 of the explicit values.  However, I'm not sure if every terminal supports
 the empty scrolling region (maybe this no longer matters).  Also, I see
 that ncurses always sends explicit values when resetting.
 
 Regards,
 
 J
 
 -- 
    My other computer runs NetBSD too   -         http://www.netbsd.org/
 


Home | Main Index | Thread Index | Old Index