Disable typeahead being set to infd by default as this seems to cause

refresh issues in nvi.
This commit is contained in:
roy 2017-02-17 11:18:38 +00:00
parent 7003a76595
commit 0d7cbb25e8
1 changed files with 11 additions and 3 deletions

View File

@ -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 *infd)
#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;