Author: Pali Rohár Date: To: Heinrich Schuchardt CC: Pavel Machek, maemo-leste, u-boot, Simon Glass, Thirupathaiah Annapureddy Subject: Re: [maemo-leste] [PATCH] bootmenu: Allow to quit it via CTRL+C
On Sunday 27 December 2020 00:04:53 Heinrich Schuchardt wrote: > On 12/26/20 11:42 PM, Pali Rohár wrote:
> > On Saturday 26 December 2020 23:32:27 Pavel Machek wrote:
> > > On Sat 2020-12-26 20:15:40, Pali Rohár wrote:
> > > > On Saturday 26 December 2020 20:10:10 Heinrich Schuchardt wrote:
> > > > > Am 26. Dezember 2020 20:03:56 MEZ schrieb "Pali Rohár" <pali@???>:
> > > > > > On Saturday 26 December 2020 19:44:23 Heinrich Schuchardt wrote:
> > > > > > > Am 26. Dezember 2020 19:02:25 MEZ schrieb "Pali Rohár"
> > > > > > <pali@???>:
> > > > > > > > When CTRL+C is pressed interrupt bootmenu and jump into U-Boot
> > > > > > console.
> > > > > > > > As the last entry in bootmenu is always U-Boot console just choose
> > > > > > the
> > > > > > > > last
> > > > > > > > entry when CTRL+C is pressed.
> > > > > > > >
> > > > > > > > It is useful when bootmenu is part of boot process and you want to
> > > > > > > > interrupt boot process by scripts which control U-Boot (serial)
> > > > > > > > console.
> > > > > > >
> > > > > > > Wouldn't the escape key be a better choice?
> > > > > >
> > > > > > I can add also escape key. But has escape key stable ANSI sequence
> > > > > > which
> > > > > > is needed to catch? If you tell me which bytes to catch (for escape
> > > > > > key)
> > > > > > I will add it.
> > > > >
> > > > > 0x1b is Escape
> > > >
> > > > Does not work. 0x1b is not escape key. It is start of the ANSI escape
> > > > sequence which matches also existing keys up and down.
> > >
> > > Unfortunately, 0x1b _is_ escape key. That is long standing bug of
> > > vt100 terminal.
> >
> > Ok. And has xterm (or other terminals) somehow fixed it? Should we
> > expect that some other terminals send something different for ESC key?
> >
> > > Usually timeout is used for detection. 0x1b followed by delay is
> > > escape key; 0x1b followed by [ is some other key.
> >
> > Any idea how long timeout should be used for this detection?
> >
> > Heinrich wrote in his patch that sequence of 0x1b 0x1b should be handled
> > by escape key. Does it mean that we need to handle both 0x1b+timeout and
> > also 0x1b+0x1b as a escape key? Or we should handle 0x1b+timeout or 0x1
> > followed by any non '[' character as escape key?
>
> 'man console_codes' teaches that that there are escape sequences not
> starting with CSI (ESC, '[').
Thanks! I did not know about this manpage.
> At 1200 baud waiting for 10 ms would be enough to differentiate between
> a single key stroke an escape sequence. The 1 ms wait used in
> do_conitrace() will only work at >= 19200 baud.
>
> >
> >
> > Anyway, this bootmenu was initially written for Nokia N900 (used on LCD
> > display with integrated keyboard) and this device does not have ESC key.
> > So I would like to have CTRL+C in bootmenu working independently of ESC
> > key support.
> >
>