Module Name:    src
Committed By:   roy
Date:           Fri Feb 17 11:18:38 UTC 2017

Modified Files:
        src/lib/libcurses: screen.c

Log Message:
Disable typeahead being set to infd by default as this seems to cause
refresh issues in nvi.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libcurses/screen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libcurses/screen.c
diff -u src/lib/libcurses/screen.c:1.31 src/lib/libcurses/screen.c:1.32
--- src/lib/libcurses/screen.c:1.31	Tue Jan 31 09:17:53 2017
+++ src/lib/libcurses/screen.c	Fri Feb 17 11:18:38 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: screen.c,v 1.31 2017/01/31 09:17:53 roy Exp $	*/
+/*	$NetBSD: screen.c,v 1.32 2017/02/17 11:18:38 roy Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)screen.c	8.2 (blymn) 11/27/2001";
 #else
-__RCSID("$NetBSD: screen.c,v 1.31 2017/01/31 09:17:53 roy Exp $");
+__RCSID("$NetBSD: screen.c,v 1.32 2017/02/17 11:18:38 roy Exp $");
 #endif
 #endif					/* not lint */
 
@@ -135,7 +135,15 @@ newterm(char *type, FILE *outfd, FILE *i
 #endif
 
 	new_screen->infd = infd;
-	new_screen->checkfd = fileno(infd);
+	/*
+	 * POSIX standard says this should be set to infd by default,
+	 * but this seems to break nvi by leaving an unrefreshed screen.
+	 * Also, the line breakout optimisation advertised in ncurses
+	 * doesn't actually do anything, so explicitly disabling it here makes
+	 * sense for the time being.
+	 * A caller can always enable it by calling typeahead(3) anyway.
+	 */
+	new_screen->checkfd = -1; // fileno(infd);
 	new_screen->outfd = outfd;
 	new_screen->echoit = new_screen->nl = 1;
 	new_screen->pfast = new_screen->rawmode = new_screen->noqch = 0;

Reply via email to