#include #include #include #include #include "rl.h" #include "frontend/print.h" using namespace std; string rl() { const char * PROMPT = "> "; char * input = readline(PROMPT); SessionLog::get().append(PROMPT); if (input == NULL) exit(EXIT_SUCCESS); // ctrl-d string out = string(input); if (out.size() > 0) add_history(input); free(input); SessionLog::get().append(out); SessionLog::get().append("\n"); return out; }