I've been working on something like this as well, and your approach is closer to what I've done than terminal.js.  To me, it makes more sense to pass the commands back to the server for parsing and handling - let JS just be the display handler.  Oh, I like the tab completion stuff too.<p>Your source code indicates it may have an Open Source license on it.  Do you have the raw source available somewhere?  Happy to share what little I have done so far.