Bug 18709

Summary: getch ncurses man page confuses noecho and echo.
Product: Documentation Reporter: dwmalone <dwmalone>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me CC: bug-ncurses
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description dwmalone 2000-05-21 13:30:01 UTC
The getch man page says:

       If noecho has been set, then the character  will  also  be
       echoed into the designated window according to the follow-
       ing rules: If the character is the current  erase  charac-
       ter,  left  arrow,  or  backspace, the cursor is moved one
       space to the left and that screen position is erased as if
       delch  had  been  called.   If  the character value is any
       other KEY_ define, the user is alerted with a  beep  call.
       Otherwise the character is simply output to the screen.

I think this should begin:

	If echo has been set, ...

Actually, the behavior doesn't even match what is in the man page
then, but atleast is is closer. (This is regardless of if you call
keypag(stdscr, TURE) or not).

How-To-Repeat: 
Try the following program with (needs -lncurses to compile).

#include <ncurses.h>

int main(int argc,char **argv) {
	initscr();
	cbreak();

	clear();
	noecho();
	move(0,0);
	printw("Testing with noecho.");
	move(1,0);
	while( getch() != '\n' );

	clear();
	echo();
	move(0,0);
	printw("Testing with echo.");
	move(1,0);
	while( getch() != '\n' );

	return(0);
}
Comment 1 alex freebsd_committer freebsd_triage 2000-06-12 17:04:07 UTC
State Changed
From-To: open->feedback

I'd like to see that you backcontribute this to the ncurses authors, if 
not already fixed. 
We rarely change things in contrib/, and if, only in important cases. 

Maybe it's already fixed in the original version. 
Could you try to find that out? We can then import the vendor-fix, which 
is much better. 

Thanks!
Comment 2 dannyboy freebsd_committer freebsd_triage 2000-07-08 03:05:37 UTC
State Changed
From-To: feedback->suspended

This was fixed on the 27th of May by the ncurses people. 
The next ncurses release should have the fix in it.
Comment 3 dannyboy freebsd_committer freebsd_triage 2000-07-10 11:41:24 UTC
State Changed
From-To: suspended->closed

ncurses 5.1 prerelease, now in both HEAD and RELENG_4, fixes this.