terminal: add basic REPL support