Improve web terminal and ANSI character sequence parser