Index: sys/boot/forth/menu.4th =================================================================== --- sys/boot/forth/menu.4th (revision 264244) +++ sys/boot/forth/menu.4th (working copy) @@ -897,10 +897,10 @@ create kernelsbuf 256 allot 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) - s" menu_timeout_command" getenv dup + s" menu_timeout_command" getenv dup -1 = if drop \ clean-up else @@ -915,10 +915,17 @@ create kernelsbuf 256 allot ( -- ) 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 ! @@ -927,14 +934,9 @@ create kernelsbuf 256 allot 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