add flake8, and correct terminal detection