How to change termios configuration, so that getc() immediately returns when user presses <tab> key?
问题 I want to implement auto-completion feature for my CLI application. The default behavior of getc() is returning only when the following list of characters are entered: NEW_LINE or EOF. I want to add TAB to this list so that I can trigger my auto-completion algorithm. Is there a way to do it, for instance, using termios? The editline library (http://www.thrysoee.dk/editline/) can do it but I could not figure how it does? 回答1: Handling of terminal IO takes about 40 pages in the second edition