Reference: https://github.com/antirez/linenoise
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
http://www.3waylabs.com/nw/WWW/products/wizcon/vt220.html