The old way of calling isatty() is problmatic, because the checked file descriptor might be redirected by users. For example, 'konsole < /dev/null > /dev/null 2> /dev/null' will make that method fail. The better way is trying to open /dev/tty to see whether we have controlling terminal. Thanks to Askar Safin <safinaskar@mail.ru> for pointing this out.wilder-portage
parent
1e722af5ab
commit
819475ff1d
1 changed files with 9 additions and 4 deletions
Loading…
Reference in new issue