Am tiring to implement history command in c Linux. My CLI has to read the commands and store in a buffer and upon pressing down or up arrow it has to show the command as in vim editor.

History command works fine. But an up arrow key displays "^[[A". How can avoid displaying the up arrrow "^[[A" and display the respective command without pressing an enter key.

And how to increment a counter by 1 if I press up arrow or down arrow ? Can some one help. If you provide a link/source code as how it is done linux also fine. Thanks.

0 Answers