Fix Windows build

Use github.com/mattn/go-isatty to check terminal
Merge pull request #662 from github/fix_windows

Fix Windows build