-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
shared/readline: handle \r and \n correctly #18713
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
base: master
Are you sure you want to change the base?
shared/readline: handle \r and \n correctly #18713
Conversation
da20223 to
1ec37f4
Compare
The old code was only handeling `\r` and ignoring `\n`, which is a problem for systems that only send `\n`. this handels it better. btw zephyr uses a similar logic in its shell. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
1ec37f4 to
9a417b2
Compare
|
Code size report: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18713 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22298 22298
=======================================
Hits 21937 21937
Misses 361 361 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Can you elaborate the issue? Is this a terminal? AFAIK the terminal protocol explicitly specified /r/n sequences that may seem out of place for those reared on unix, but are actually part of the formal spec. |
Which terminal protocol? Btw one alternative would be to use |
Termios default settings But could you please answer the other questions, as I'm grasping in the dark what problem you are trying to solve. |
I used https://github.com/enjoy-digital/litex and the included
|
Summary
the old code was only handeling
\rand ignoring\n, which is a problem for systems that only send\n.this handels it better. btw zephyr uses a similar logic in its shell.
Testing
tested on the zephyr port
Trade-offs and Alternatives