Detect mouse-enabled terminals; improve terminfo reporting