How do I set the RAW console to go to the next line when it receives ^M
You write an appropriate control code to the console when you read an ^M. The whole point of raw mode is that the console does not do things like recognize line ends, backspaces, etc., etc., because you want to handle them yourself. Once you do that, you need to handle all those things.
can I set the Shell to NOT display the keys pressed
Sure. Turn off echo
. With the stty
command, you would use stty raw -echo
but if you're doing this from a C program, you'd be much better off using the terminal API. See man tcsetattr