Implementing linenoise lib in REPL