Author of term.js/tty.js[1] here. Nice work. You guys should keep an eye on term.js. The version you're using is slightly old and actually contains a bug (now fixed) wherein all events will become unbound if the reset control sequence is received. I'm also adding fixes for a few other things currently, such as double-width character support, which has been a problem in the past.