summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÁkos Kőrösi <korakos99@gmail.com>2026-05-18 19:35:43 +0200
committerÁkos Kőrösi <korakos99@gmail.com>2026-05-18 19:35:43 +0200
commit843d58e2ef3552093876af45c4cba963943d2551 (patch)
tree4ca325a714c36e7e06b06ba738c03d403eb47c74
parentd7d3843b8259b83f86dcdf93a138eb48060d74db (diff)
add readline history
-rw-r--r--main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.c b/main.c
index 52e1691..35c2bff 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <readline/readline.h>
+#include <readline/history.h>
#include <string.h>
#include "exec.h"
@@ -13,6 +14,7 @@ int main() {
line = readline("$ ");
if (line[0] == '\0') continue;
if (strcmp(line, "exit") == 0) exit(0);
+ add_history(line);
process_input_line(line, &shstate);
}
free(line);