Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is ncurses a good choice to implement a command history in a C program in linux

I am a student and I'm taking a course where my project is to write a server using unix sockets, threads or epoll, and so forth.

However, as the client takes his input from the user, I wanted to go an extra mile and give it some sort of memory for the commands he has given in the past; like the shell or gdb has.

I have no idea how to do this, can you guys help me? I put ncurses in the title because I suspect I'm supposed to use it, but I don't know how, I never used ncurses before.

like image 353
Gonçalo Silva Santos Avatar asked Oct 24 '25 17:10

Gonçalo Silva Santos


1 Answers

The GNU readline library provides this functionality.

like image 54
Greg Hewgill Avatar answered Oct 26 '25 06:10

Greg Hewgill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!