Use readline history.
This commit is contained in:
parent
f37969418d
commit
4decbbbe5c
|
@ -1050,11 +1050,13 @@ Object systemCall(Object process, Object _, struct Environment* env)
|
||||||
void repl(struct Environment* env)
|
void repl(struct Environment* env)
|
||||||
{
|
{
|
||||||
char* buf;
|
char* buf;
|
||||||
|
using_history();
|
||||||
while ((buf = readline("pebblisp::> ")) != NULL) {
|
while ((buf = readline("pebblisp::> ")) != NULL) {
|
||||||
if (strcmp("q", buf) == 0) {
|
if (strcmp("q", buf) == 0) {
|
||||||
free(buf);
|
free(buf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
add_history(buf);
|
||||||
Object o = parseEval(buf, env);
|
Object o = parseEval(buf, env);
|
||||||
printObj(&o);
|
printObj(&o);
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
Loading…
Reference in New Issue