Just a quick message to announce pd_readline - a public-domain readline and command-history implementation (using the Unlicense).
It can be obtained from here -
https://github.com/mooseman It is still a bit alpha-ish (I've had the occasional problem with a stack-smash) but it "generally behaves as expected" (for most values of "generally"...... ;) )
Give it a go. Compile it, put the "test.txt" file in the same directory (that's just a dummy "command-history" file for now), and play around with it. "Share and enjoy......" ;)