Revert "fix when isatty() cannot find valid file descriptor"

This reverts commit 4b28d27b1f0fb2569af4ee9533edb932c5b9ce45.