Rather than writing my own terminal, I decided to use term.js