diff options
| author | 2024-09-04 12:20:50 -0400 | |
|---|---|---|
| committer | 2024-09-04 12:20:50 -0400 | |
| commit | 995e8da6536dc25a9ad37e8ef11e9b2f92b48e91 (patch) | |
| tree | b2882d3306be8c32723b5b115361f2b92710b5f0 /src/lush.c | |
| parent | added exists function to lua api (diff) | |
history saving implemented
Diffstat (limited to 'src/lush.c')
| -rw-r--r-- | src/lush.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -17,6 +17,7 @@ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. #include "lush.h" #include "help.h" +#include "history.h" #include "lauxlib.h" #include "lua.h" #include "lua_api.h" @@ -517,6 +518,7 @@ int main() { // Print the prompt printf("[%s@%s:%s] ", username, device_name, prompt_cwd); char *line = lush_read_line(); + lush_push_history(line); printf("\n"); if (line == NULL || strlen(line) == 0) { free(line); @@ -533,6 +535,7 @@ int main() { for (int i = 0; args[i]; i++) { free(args[i]); } + // add last line to history free(cwd); free(args); free(commands); |
