NetBSD-Bugs archive

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

lib/53636: curses(3) resizeterm(3) does not ungetch(3)/unget_wch(3) KEY_RESIZE



>Number:         53636
>Category:       lib
>Synopsis:       curses(3) resizeterm(3) does not ungetch(3)/unget_wch(3) KEY_RESIZE
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 28 09:05:00 +0000 2018
>Originator:     Kamil Rytarowski
>Release:        NetBSD 8.99.24 amd64
>Organization:
TNF
>Environment:
NetBSD rugged 8.99.24 NetBSD 8.99.24 (GENERIC) #8: Fri Aug 31 21:55:37 CEST 2018  root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC amd64
>Description:
resizeterm(3) shall return a character KEY_RESIZE to buffer.

KEY_RESIZE shall be generated regardless of the terminal being really resized or not (new size equals the old one).

This works well in ncurses.
>How-To-Repeat:
#include <curses.h>
#include <stdio.h>
int
main(int argc, char **argv)
{
	int ch;

	initscr();
	resizeterm(10,10);
	ch = getch();
	endwin();

	printf("KEY_RESIZE = %s\n", ch == KEY_RESIZE ? "yes" : "no");

	return 0;
}

$ gcc test2.c -lcurses
$ ./a.out # waits infinitely for input
KEY_RESIZE = no
$ gcc test2.c -lncurses -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -I/usr/pkg/include -I/usr/pkg/include/ncurses
$ ./a.out
KEY_RESIZE = yes

>Fix:
N/A

It's not clear whether we can use ungetch(3) inside resizeterm(3), as we might want to handle a wide character variation. It might be better to emulate this.



Home | Main Index | Thread Index | Old Index