NetBSD Problem Report #53633
From www@NetBSD.org Wed Sep 26 19:15:02 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 4E2E97A14F
for <gnats-bugs@gnats.NetBSD.org>; Wed, 26 Sep 2018 19:15:02 +0000 (UTC)
Message-Id: <20180926191501.780BC7A26B@mollari.NetBSD.org>
Date: Wed, 26 Sep 2018 19:15:01 +0000 (UTC)
From: n54@gmx.com
Reply-To: n54@gmx.com
To: gnats-bugs@NetBSD.org
Subject: curses(3) KEY_RESIZE does not update max y,x of stdscr
X-Send-Pr-Version: www-1.0
>Number: 53633
>Category: lib
>Synopsis: curses(3) KEY_RESIZE does not update max y,x of stdscr
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: lib-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Sep 26 19:20:00 +0000 2018
>Closed-Date: Thu Sep 27 15:18:34 +0000 2018
>Last-Modified: Thu Sep 27 15:18:34 +0000 2018
>Originator: Kamil Rytarowski
>Release: NetBSD 8.99.25 amd64
>Organization:
TNF
>Environment:
NetBSD chieftec 8.99.25 NetBSD 8.99.25 (GENERIC) #0: Tue Sep 25 20:06:09 CEST 2018 root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC amd64
>Description:
getch(3) in curses(3) after catching KEY_RESIZE it does not update max Y,X size.
getmaxyx(3) in particular returns old size, from the state before resizing.
>How-To-Repeat:
#include <curses.h>
#include <stdio.h>
int
main(int argc, char **argv)
{
int y1, x1;
int y2, x2;
int ch;
initscr();
keypad(stdscr, TRUE);
getmaxyx(stdscr, y1, x1);
do {
ch = wgetch(stdscr);
getmaxyx(stdscr, y2, x2);
} while (ch != KEY_F(1));
endwin();
printf("ch = %d; (y1=%d,x1=%d)->(y2=%d,x2=%d)\n", ch, y1, x1, y2, x2);
return 0;
}
>Fix:
N/A
>Release-Note:
>Audit-Trail:
From: "Roy Marples" <roy@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/53633 CVS commit: src/lib/libcurses
Date: Thu, 27 Sep 2018 14:07:55 +0000
Module Name: src
Committed By: roy
Date: Thu Sep 27 14:07:55 UTC 2018
Modified Files:
src/lib/libcurses: get_wch.c getch.c
Log Message:
curses: call resizeterm if getch issues KEY_RESIZE
This fixes PR #53633.
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.68 -r1.69 src/lib/libcurses/getch.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->pending-pullups
State-Changed-By: roy@NetBSD.org
State-Changed-When: Thu, 27 Sep 2018 14:38:17 +0000
State-Changed-Why:
Pull request #1042 to -8
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/53633 CVS commit: [netbsd-8] src/lib/libcurses
Date: Thu, 27 Sep 2018 15:12:15 +0000
Module Name: src
Committed By: martin
Date: Thu Sep 27 15:12:15 UTC 2018
Modified Files:
src/lib/libcurses [netbsd-8]: curses_private.h get_wch.c getch.c
Log Message:
Pull up following revision(s) (requested by roy in ticket #1042):
lib/libcurses/getch.c: revision 1.68
lib/libcurses/getch.c: revision 1.69
lib/libcurses/get_wch.c: revision 1.17
lib/libcurses/get_wch.c: revision 1.18
lib/libcurses/curses_private.h: revision 1.63
curses: unify resize handling in getch
Instead of testing each fgetc call for resize event, add the wrapper
__fgetc_resize to simplify the logic.
While here, ensure that get_wch uses the correct input stream which
may or may not be stdin.
curses: call resizeterm if getch issues KEY_RESIZE
This fixes PR #53633.
To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.4.1 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.14.4.1 -r1.14.4.2 src/lib/libcurses/get_wch.c
cvs rdiff -u -r1.65.4.1 -r1.65.4.2 src/lib/libcurses/getch.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: pending-pullups->closed
State-Changed-By: kamil@NetBSD.org
State-Changed-When: Thu, 27 Sep 2018 17:18:34 +0200
State-Changed-Why:
Pullup -8 #1042 done.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.