Add input command for unix
diff --git a/unix/main.c b/unix/main.c
index 5a7ea1c..cc80811 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -49,11 +49,7 @@
 #include "repl.h"
 #include "gc.h"
 #include "genhdr/py-version.h"
-
-#if MICROPY_USE_READLINE
-#include <readline/readline.h>
-#include <readline/history.h>
-#endif
+#include "input.h"
 
 // Command line options, with their defaults
 bool compile_only = false;
@@ -143,31 +139,6 @@
     return s;
 }
 
-STATIC char *prompt(char *p) {
-#if MICROPY_USE_READLINE
-    char *line = readline(p);
-    if (line) {
-        add_history(line);
-    }
-#else
-    static char buf[256];
-    fputs(p, stdout);
-    char *s = fgets(buf, sizeof(buf), stdin);
-    if (!s) {
-        return NULL;
-    }
-    int l = strlen(buf);
-    if (buf[l - 1] == '\n') {
-        buf[l - 1] = 0;
-    } else {
-        l++;
-    }
-    char *line = malloc(l);
-    memcpy(line, buf, l);
-#endif
-    return line;
-}
-
 STATIC void do_repl(void) {
     printf("Micro Python " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; UNIX version\n");