Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JO6KP-0007RW-Nv for mharc-grub-devel@gnu.org; Sun, 10 Feb 2008 02:10:17 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JO6KO-0007RF-DF for grub-devel@gnu.org; Sun, 10 Feb 2008 02:10:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JO6KN-0007R1-PW for grub-devel@gnu.org; Sun, 10 Feb 2008 02:10:15 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JO6KN-0007Qq-Lf for grub-devel@gnu.org; Sun, 10 Feb 2008 02:10:15 -0500 Received: from ns39764.ovh.net ([91.121.25.85] helo=nexedi.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JO6KN-00079W-Bg for grub-devel@gnu.org; Sun, 10 Feb 2008 02:10:15 -0500 Received: from [10.8.0.46] (unknown [10.8.0.46]) by nexedi.com (Postfix) with ESMTP id 6F5E33EB24 for ; Sun, 10 Feb 2008 08:17:29 +0100 (CET) From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Sun, 10 Feb 2008 08:10:13 +0100 User-Agent: KMail/1.9.4 References: <20080208161855.GA19377@thorin> <200802092103.09542.okuji@enbug.org> <20080209220901.GC25086@thorin> In-Reply-To: <20080209220901.GC25086@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802100810.13574.okuji@enbug.org> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [PATCH] if timeout is set to zero, don't bother drawing the menu X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Feb 2008 07:10:16 -0000 On Saturday 09 February 2008 23:09, Robert Millan wrote: > On Sat, Feb 09, 2008 at 09:03:09PM +0100, Yoshinori K. Okuji wrote: > > On Friday 08 February 2008 17:18, Robert Millan wrote: > > > Fixes an ugly result of setting timeout=0. > > > > > > When this is combined with the "sleep" patch I just sent, user can > > > implement hiddenmenu-like functionality via scripting: > > > > > > echo -n "Press `ESC' to enter the menu... " > > > if sleep -v -i 10 ; then > > > set timeout=10 > > > else > > > set timeout=0 > > > fi > > > > I think this is a bit strange. I don't think anybody expects that "sleep" > > outputs a counter or is interrupted by a key input. It is too different > > from POSIX's sleep. > > > > My preference is rather to extend "read". Bash's "read" accepts a timeout > > and some other options. > > Ok, so you suggest: > > read --timeout N --verbose --interruptible > > ? "read" exits when an input is passed by default, so "interruptible" sounds odd. Here, I think what you want is a behavior that "read" does not wait for ENTER, but reads immediately any character (or only ESC). In GRUB Legacy, the hidden menu uses ESC, because if it uses ENTER, and the user pushes ENTER too long, and a key repeat occurs, then the first item may be selected quick as a flash. But we could avoid this problem by vacuuming all inputs before showing a menu, so it might be acceptable to use ENTER instead. (Actually, this should be implemented, regardless of this issue, because some BIOSes may leave garbage in a key buffer. I don't remember if this has been done for GRUB 2.) To count down, I don't think it should be named "--verbose". For me, this is like "--print-timeout". Okuji