Why are you implementing that here rather than in lib/repl.js?