NetBSD-Bugs archive

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

lib/57860: Curses getnstr() family handling of kill char (^U) not correct.



>Number:         57860
>Category:       lib
>Synopsis:       Curses getnstr() family handling of kill char (^U) not correct.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 15 21:35:00 +0000 2024
>Originator:     Anthony Howe
>Release:        9.3
>Organization:
>Environment:
NetBSD elf.snert.com 9.3 NetBSD 9.3 (GENERIC) #0: Thu Aug  4 15:30:37 UTC 2022  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64

>Description:
Entering text into a field with Curses getnstr() family of functions does not correct handle the behaviour of ^U kill char.   
>How-To-Repeat:
Short test program, instructions at end:
```
#include <curses.h>
#include <unistd.h>

int
main(int argc, char **argv)
{
        char buf[80];
        if (initscr() == NULL) {
                return 1;
        }
        echo();
        cbreak();
        addstr(" 123456789.123456789.123456789.1234567890\n");
        standout();
        addstr("[                                        ]\n");
        mvgetnstr(1, 1, buf, sizeof (buf));
        standend();
        endwin();
        return 0;
}

/*
Type in a string like "abcdefghi", ^U, 1234.
Observe how there is a gap between 1 and 2.
Appears kill char ^U not handled properly.
Backspace / erase char (^H) works just fine.
*/
```

>Fix:



Home | Main Index | Thread Index | Old Index