Use readline history.

This commit is contained in:
Sage Vaillancourt 2022-03-15 22:47:46 -04:00
parent f37969418d
commit 4decbbbe5c
1 changed files with 2 additions and 0 deletions

View File

@ -1050,11 +1050,13 @@ Object systemCall(Object process, Object _, struct Environment* env)
void repl(struct Environment* env)
{
char* buf;
using_history();
while ((buf = readline("pebblisp::> ")) != NULL) {
if (strcmp("q", buf) == 0) {
free(buf);
break;
}
add_history(buf);
Object o = parseEval(buf, env);
printObj(&o);
free(buf);