Dasharo / dasharo-issues

The Dasharo issue tracker
https://dasharo.com/
25 stars 0 forks source link

escape takes too long #788

Open 532910 opened 6 months ago

532910 commented 6 months ago

Component

Dasharo firmware

Device

PC Engines APU6

Dasharo version

v0.9.0

Dasharo Tools Suite version

No response

Brief summary

escape takes too long

How reproducible

every time

How to reproduce

press escape

Expected behavior

escape must take the same time as enter or up/down arrows

Actual behavior

escape takes several seconds

Screenshots

No response

Additional context

No response

Solutions you've tried

No response

miczyg1 commented 6 months ago

@532910 unfortunately this cannot be "fixed" and it is not an issue. The delay in ESC is necessary to correctly recognize terminal escape sequences. Each escape sequence starts with an ESC code (0x1b) optionally followed by control characters (depending on the pressed key). E.g. arrow up is ESC [ A and escape key is simply ESC. Because of these optional control characters, the serial console driver waits for up to 2 seconds for these optional characters to arrive. If they do no arrive, it means an ESC key was pressed.

532910 commented 6 months ago

This is very annoying behavior! Before I understand that delay exist, I thought it just doesn't work at all. I believe the delay should be reduced significantly. As for arrow up you will receive [A almost instantly, so 500ms or even less should be more than enough. It might be worth making this configurable in Console Options.

One more enhancement I see there is to add one more button for back action.

Please reopen.

532910 commented 6 months ago

115200 is less than 0.1 millisecond per byte, so I believe the delay could be safely set to 50ms that will be completely invisible for human

macpijan commented 4 months ago

the serial console driver waits for up to 2 second

Any idea if it comes from some specification, or simply that how it was set in this code?

mkopec commented 4 months ago

seems to be a pretty old upstream change: https://github.com/tianocore/edk2/blame/8c09d862bfb034e00b6b3bc37fe37243c866dd3a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c#L1359-L1369

miczyg1 commented 4 months ago

No idea if it comes from specification, but typical AMI firmwares also have this 2s timeout for escape sequences. Seems pretty standard

clhodapp commented 3 days ago

Dasharo ought to be better than AMI!

Firminator commented 2 days ago

Offtopic: Interesting comment in there regarding the 2s timeout:

2 seconds are allowed for an ESC sequence to be completed. If the ESC sequence is not completed in 2 seconds, then the raw key strokes of the partial ESC sequence are converted into EFI Keys.

There is one special input sequence that will force the system to reset. This is ESC R ESC r

I wonder if this is a replacement for CTRL+ALT+DEL.

miczyg1 commented 1 day ago

Offtopic: Interesting comment in there regarding the 2s timeout:

2 seconds are allowed for an ESC sequence to be completed. If the ESC sequence is not completed in 2 seconds, then the raw key strokes of the partial ESC sequence are converted into EFI Keys. There is one special input sequence that will force the system to reset. This is ESC R ESC r

I wonder if this is a replacement for CTRL+ALT+DEL.

Not a replacement but probably some equivalent for serial console.

miczyg1 commented 1 day ago

Dasharo ought to be better than AMI!

Maybe in a few more decades, when we reach the same level of experience, growth, partnerships, etc.

Also, better in what aspects? Each solution has pros and cons.