Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Rlnzr-0004dX-6T for mharc-grub-devel@gnu.org; Fri, 13 Jan 2012 15:45:11 -0500 Received: from eggs.gnu.org ([140.186.70.92]:50334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rlnzm-0004Ws-PV for grub-devel@gnu.org; Fri, 13 Jan 2012 15:45:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rlnzk-0004dC-Kh for grub-devel@gnu.org; Fri, 13 Jan 2012 15:45:06 -0500 Received: from acsinet15.oracle.com ([141.146.126.227]:33921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rlnzk-0004b6-Fq for grub-devel@gnu.org; Fri, 13 Jan 2012 15:45:04 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id q0DKj0HX019280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 13 Jan 2012 20:45:01 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q0DKj0Ne026244 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Jan 2012 20:45:00 GMT Received: from abhmt110.oracle.com (abhmt110.oracle.com [141.146.116.62]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q0DKj0nC011840 for ; Fri, 13 Jan 2012 14:45:00 -0600 Received: from bergsoft (/10.132.136.136) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 13 Jan 2012 12:44:59 -0800 Date: Fri, 13 Jan 2012 12:43:32 -0800 (PST) From: Seth Goldberg X-X-Sender: sethg@bergsoft To: grub-devel@gnu.org Subject: grub-emu console-read causing issues with the read command Message-ID: User-Agent: Alpine 2.00 (GSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090201.4F1097CD.00DB,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:45:07 -0000 Hi, When using the read command under grub-emu, the resulting value read (present in the environment variable) includes a time-dependent number of 0xff characters + the input that the user made. I tracked it down to grub_ncurses_getkey(), which times out after 100ms and causes grub_ncurses_getkey to return -1 instead of GRUB_TERM_NO_KEY, which causes grub_getkey() to return -1 instead of blocking until it has real input. My suggestion would be to change grub_ncurses_getkey to return GRUB_TERM_NO_KEY in the ERR case: static int grub_ncurses_getkey (struct grub_term_input *term __attribute__ ((unused))) { int c; wtimeout (stdscr, 100); c = getch (); switch (c) { case ERR: < return -1; > return GRUB_TERM_NO_KEY; --S