Fixed EscapeSequence Handling, Connection Close on Window Close