ncurses and stdin blocking
问题 I have stdin in a select() set and I want to take a string from stdin whenever the user types it and hits Enter . But select is triggering stdin as ready to read before Enter is hit, and, in rare cases, before anything is typed at all. This hangs my program on getstr() until I hit Enter . I tried setting nocbreak() and it's perfect really except that nothing gets echoed to the screen so I can't see what I'm typing. And setting echo() doesn't change that. I also tried using timeout(0) , but