diff -u original/menu.4th new/menu.4th --- original/menu.4th 2014-06-04 17:21:20.137501000 +0900 +++ new/menu.4th 2014-06-04 17:43:32.100160000 +0900 @@ -681,8 +681,8 @@ menu_timeout @ 0= if \ We've reached the end of the timeout - \ (user did not cancel by pressing ANY - \ key) + \ (user did not cancel by pressing + \ ASCII sequence 0x8 BS or higher) str_menu_timeout_command getenv dup -1 = if @@ -699,10 +699,17 @@ ( -- ) then - key? if \ Was a key pressed? (see loader(8)) + key? if ( and ) key dup 7 > if - \ An actual key was pressed (if the timeout is running, - \ kill it regardless of which key was pressed) + ( -- N ) + + \ Was a key pressed? (see loader(8)) + \ ... and was it a usable ASCII sequence? + + \ NB: Some systems may generate ASCII 0x7 BEL when a + \ keyboard is not connected (e.g., booting serial) + + \ If the timeout is running, kill it menu_timeout @ 0<> if 0 menu_timeout ! 0 menu_timeout_enabled ! @@ -711,14 +718,9 @@ 0 menu-timeout-update then - \ get the key that was pressed and exit (if we - \ get a non-zero ASCII code) - key dup 0<> if - exit - else - drop - then - then + exit + + else drop then then 50 ms \ sleep for 50 milliseconds (see loader(8)) again