
On 1/6/23 15:52, Simon Glass wrote:
The current cread_line() function is very long. It handles the escape processing inline. The menu command does similar processing but at the character level, so there is some duplication.
Split the character processing into a new function cli_ch_process() which processes individual characters and returns the resulting input character, taking account of escape sequences. It requires the caller to set up and maintain its state.
Update cread_line() to use this new function.
The only intended functional change is that an invalid escape sequence does not add invalid/control characters into the input buffer, but instead discards these.
Signed-off-by: Simon Glass sjg@chromium.org
Hello Simon
in the Change Boot Order menu of the eficonfig command I hit the PAGE-UP or PAGE-DOWN button and get this output:
[ ] label0038 [ ] label0039impossible condition #876 impossible condition #876 Press UP/DOWN to move, +/- to change orde Press SPACE to activate or deactivate the entry Select [Save] to complete, ESC/CTRL+C to quit
Hitting an unsupported key should not result in output.
This is the line providing the output.
common/cli_getch.c:201: puts("impossible condition #876\n");
How line be reached by an "impossible condition". That text does not make any sense.
This is the patch to blame
b08e9d4b6632 ("cli: Move readline character-processing to a state machine")
Please, remove that debug message.
The conitrace command shows these escape sequences:
PAGE-DOWN 1b 5b 36 7e PAGE-UP 1b 5b 35 7e
Best regards
Heinrich