NetBSD-Bugs archive

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

Re: lib/58151: Should Curses getnstr() family handle erase and kill characters when input is not a tty?



The following reply was made to PR lib/58151; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: lib/58151: Should Curses getnstr() family handle erase and kill
 characters when input is not a tty?
Date: Tue, 16 Apr 2024 02:09:00 +0000

 On Sun, Apr 14, 2024 at 02:30:01PM +0000, achowe%snert.com@localhost wrote:
  > 	echo();
  > 	cbreak();
 
 Calling cbreak() instructs curses to tell the tty to _not_ handle
 special characters (other than those that generate signals, which
 doesn't include erase and kill). So I don't see a bug here. (Same
 for 57680.)
 
 One could argue that getnstr/mvgetnstr in cbreak mode should handle
 simple line editing, but it does not, and there are problems with
 doing so. (For example: how simple? Tty cooked mode editing is fairly
 straightforward, but also not particularly useful or adequate since
 it's no longer 1983, but anything more complicated gets into religious
 questions like whether you should move to the beginning of the line
 with ^A or esc-^-i or what.)
 
 One could _also_ make an argument that curses should fake tty cooked
 mode when the caller does _not_ put the terminal in cbreak mode and
 the input is not a tty, but (a) that's not the way things historically
 work, (b) very few curses applications use tty cooked mode and there
 are good reasons for that, (c) there's an easy workaround (open a
 pty), and (d) it's not clear that there's much if any practical
 application for such behavior anyhow.
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index