Add history (currently only for one session)

This commit is contained in:
g1n 2021-09-28 09:47:06 +03:00
parent 7a88322f19
commit d35e7e4b38
1 changed files with 2 additions and 0 deletions

View File

@ -186,6 +186,7 @@ int main(int argc, char *argv[]) {
}
} else {
using_history();
while(1) {
gen_prompt();
line = readline(prompt); // FIXME: add prompt
@ -193,6 +194,7 @@ int main(int argc, char *argv[]) {
printf("exit\n");
break;
}
add_history(line);
commands = split_line(line, ";");
int after_parse_position = position; // To know where we in ; list FIXME
for (int i = 0; i <= after_parse_position - 1; i++) {