I am writing a C program on Linux platform where I need to show something on console instantly when the up or down arrow key is pressed without ^[[A
or ^[[B
getting written on the console and then pressing enter to show something on the console.
I am simulating linux shell and I want to impelement linux shell like history feature where when we press up and down key, recent entered commands are displayed. I am using GNU history library to implement this. How do I do that?