From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31250 invoked by alias); 25 Oct 2008 15:46:10 -0000 Received: (qmail 31240 invoked by uid 22791); 25 Oct 2008 15:46:09 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 25 Oct 2008 15:45:34 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 465922A9689; Sat, 25 Oct 2008 11:45:31 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id q-OgAh73-C9M; Sat, 25 Oct 2008 11:45:31 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 142262A9681; Sat, 25 Oct 2008 11:45:31 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 132C7E7ACD; Sat, 25 Oct 2008 08:45:29 -0700 (PDT) Date: Sat, 25 Oct 2008 15:46:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [RFA/RFC] new setting against auto-answer? (because "input not from terminal") Message-ID: <20081025154528.GE29998@adacore.com> References: <20081025010445.GC29038@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00637.txt.bz2 > 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