From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11255 invoked by alias); 25 Oct 2008 08:06:33 -0000 Received: (qmail 11245 invoked by uid 22791); 25 Oct 2008 08:06:32 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout2.012.net.il (HELO mtaout2.012.net.il) (84.95.2.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 25 Oct 2008 08:05:52 +0000 Received: from HOME-C4E4A596F7 ([77.126.215.238]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K9A00HHSBVTTX60@i_mtaout2.012.net.il> for gdb-patches@sourceware.org; Sat, 25 Oct 2008 10:07:21 +0200 (IST) Date: Sat, 25 Oct 2008 08:06:00 -0000 From: Eli Zaretskii Subject: Re: [RFA/RFC] new setting against auto-answer? (because "input not from terminal") In-reply-to: <20081025010445.GC29038@adacore.com> X-012-Sender: halo1@inter.net.il To: Joel Brobecker Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: References: <20081025010445.GC29038@adacore.com> X-IsSubscribed: yes 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/msg00635.txt.bz2 > Date: Fri, 24 Oct 2008 18:04:45 -0700 > From: Joel Brobecker > > If you have been in that situation, and you use a MinGW debugger, > then you probably know that there are a few issues with the "terminal". > One of the issues that is causing us some trouble is the fact that > GDB automatically assumes the default answer for its y/n queries. > For instance: > > (top-gdb) start > The program being debugged has been started already. > Start it from the beginning? (y or n) [answered Y; input not from terminal] > [...] > > I propose a new "set/show interactive-mode (auto|on|off)" command > to allow the user to override what GDB detects. Isn't it better to fix the original problem? 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?