Eli Zaretskii wrote: >> + return isatty (fd) - 1; > Do we need this "-1" part now? It could misfire if isatty does > return 1 some day. Sorry, I don't so how it can misfire. isatty returns 1 on success, 0 on failure; whereas the caller returns 0 on success, -1 on failure. So subtracting 1 is the right thing to do, no? A revised patch, taking your other comments into account, is attached. It's relative to trunk bzr 117527.