need to figure out difference of Canonical vs. non-canonical terminal input
As you tried i think on canonical
terminal so what's limitation you already now.So i just explain you about non-canonical
terminal
For non-canonical input - think vi
or vim
or whatever — you press a character, and it is immediately available to the program. You aren't held up until you hit return. The system does no editing of the characters; they are made available to the program as soon as they are typed. It is up to the program to interpret things appropriately. Now, vim
does do a number of things that look a bit like canonical input. For example, backspace moves backwards, and in input mode erases what was there. But that's because vim chooses to make it behave like that.
So you need to use non-canonical flavor.