Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard handling overflow ? #30

Open
vinz6751 opened this issue Dec 9, 2021 · 2 comments
Open

Keyboard handling overflow ? #30

vinz6751 opened this issue Dec 9, 2021 · 2 comments

Comments

@vinz6751
Copy link
Contributor

vinz6751 commented Dec 9, 2021

Reproduction steps:
1 Boot
2 Keep a arrow key down.
3 After some time, I get a
"Command not found
Could not load file: 000004B0" (or whatever address, seems to be in the low memory though)

Somebody can reproduce ?

@pweingar
Copy link
Owner

pweingar commented Dec 9, 2021

I think this is not so much an overflow as the system hitting the limit on the line size in the command line. sys_chan_readline takes a maximum size and treats anything over that limit as forcing a carriage return. Two things could (should?) happen here: one is for arrow key escape sequences to be caught and ignored/handled... and the other might be to keep reading keys until the CR but alert the user if the line length has been exceeded (and ignore those extra keypresses).

Thoughts?

@vinz6751
Copy link
Contributor Author

We could handle better the keys from the CLI. Readline could safely ignore up/down I suppose.

The CLI could also intercept keystrokes and handle things itself, so we can e.g. provide autocompletion later. For now I could just:

  • ignore up/down,
  • ignore "left" if the cursor position if = strlen(prompt)+1 to prevent writting above the prompt,
  • ignore right" if the cursor is already near the right border (max column number). That will limit the size of command line but it's should be good enough.
    Later we can manage command history and use up/down to browse it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants