Move event handling off the window level and down to the terminal DIV itself.
_lineToHTML() should just look at the length of the line array.