Re: [RFA/RFC] new setting against auto-answer? (because "input not from terminal")

Joel Brobecker
2008-10-25T15:46:10Z

> Is the problem with isatty returning the wrong value? If so, did you
> (or can you) try the following trick?
>
> #define ISATTY(fd) (isatty(fd) && lseek(fd,SEEK_CUR,0) == -1)
>
> and then use ISATTY instead of isatty?

That wouldn't work, unfortunately, because the problem is that isatty
returns zero. In the case of ssh to cygwin sshd, it's expected, since
my understanding is that cygwin uses pipes. There is also another
context that we use to run GDB, which is GPS. I need to double-check
with one of my collegues in Spain, but I believe that GPS creates a
console, and somehow MinGW's isatty also returns zero.

I assume that the first issue (with cygwin sshd) is fixable, since
running cygwin's GDB, the debugger detects a "terminal" and runs in
the right mode. I'll take a look at the sources and see if I can find
something.

In the second case, I don't really know. Perhaps fixing the first
case will fix this one as well.

--
Joel