NetBSD-Bugs archive

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

Re: install/56467: sysinst output no longer scrolls correctly



Hi,

>  > I think this patch is OK - we set win->curx = 0 in scroll().  However, I
>  > wonder if we should add if (!__NONL), as is done there [*]?
 
>  Ah, I've lost all context for this, but, certainly there's an issue a few
>  lines above that:
>  
>  https://nxr.netbsd.org/xref/src/lib/libcurses/tty.c#116
>  
>  It should be `screen->outfd' as per the comment just above.

Good point!  Something like the attached should be OK.

Regards,

Julian
Index: src/lib/libcurses/addbytes.c
===================================================================
RCS file: /cvsroot/src/lib/libcurses/addbytes.c,v
retrieving revision 1.68
diff -u -r1.68 addbytes.c
--- src/lib/libcurses/addbytes.c	20 Dec 2022 04:57:01 -0000	1.68
+++ src/lib/libcurses/addbytes.c	6 Sep 2023 20:31:12 -0000
@@ -585,6 +585,8 @@
 			__CTRACE(__CTRACE_INPUT,
 			    "_cursesi_addwchar: do a scroll\n");
 			scroll(win);
+			if (!__NONL)
+				*x = 0;
 		}
 		newx = win->maxx - 1 + win->ch_off;
 		if (newx > *(*lnp)->lastchp)
Index: src/lib/libcurses/tty.c
===================================================================
RCS file: /cvsroot/src/lib/libcurses/tty.c,v
retrieving revision 1.49
diff -u -r1.49 tty.c
--- src/lib/libcurses/tty.c	6 Sep 2021 07:03:50 -0000	1.49
+++ src/lib/libcurses/tty.c	6 Sep 2023 20:31:12 -0000
@@ -113,7 +113,7 @@
 
 	if (tcgetattr(fileno(screen->infd), &screen->orig_termios)) {
 		/* if the input fd is not a tty try the output */
-		if (tcgetattr(fileno(screen->infd), &screen->orig_termios)) {
+		if (tcgetattr(fileno(screen->outfd), &screen->orig_termios)) {
 			/* not a tty ... we will disable tty related stuff */
 			screen->notty = TRUE;
 			__GT = 0;


Home | Main Index | Thread Index | Old Index