That's a good solution too, but backspace and CTRL + U don't work...
That's a good solution too, but backspace and CTRL + U don't work...
While input is line buffered, these things are taken care of for you at some level by the terminal. When you turn it off, they become your responsibility to handle because all input is expected immediately. You need to make special cases for stuff like delete and ctrlz, handling your buffer appropriately. Give it a shot.