I am looking for a GNU readline alternative. It comes with a lot of features but only couple of them are useful to me as explained below -
I am working on a interactive command prompt application (display prompt and accept next user command to be run). I want to implement some editing and history feature for the prompt. So when the user presses UP key it should show the last run command. Also, user should be able to navigate using arrow keys if he need to edit any typo or command switches etc.
On windows something similar already exists, if you use fgets
or scanf
to get the input on cmd prompt it already maintains history and also lets you edit.
Is there a good option available on linux?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…