-
Notifications
You must be signed in to change notification settings - Fork 1.3k
readline: make ctrl-l clear screen & redraw line #6639
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, the control string works when I copy it to PuTTy but I'm having issues (on my end and ran out of time) testing it so I do not want to approve just by myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to make this work in Terminal too? (For displays that echo the serial output.)
If by "Terminal" you mean the mac terminal program / command window, I don't have a mac to test on. I only tried xfce4, a standard-ish terminal on Linux, based on the list of ANSI escape codes at https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_(Control_Sequence_Introducer)_sequences (though I was reading a different reference the wikipedia codes match) If it's not widely compatible then we can just close this up, I'm not a terminal expert. |
Using CSI 2 J might be worth trying, that's "clear entire screen" instead of "clear to end of screen". After the cursor has moved to 0,0 with CSI H, they should be the same, and so I chose the sequence that was shorter by 1 byte. |
oh! taking a quick look at that code, it may be that the fix is to use the sequence CSI ; H as the H-parsing only comes after a ';' is encountered. |
oh yes and only CSI 2 J is supported by the terminal class too |
.. similar to how standard Python does it. The specific escape sequence is chosen for compatibility with the built-in `terminalio.Terminal`. Closes: adafruit#6635
OK it's now tested on a pyportal. In addition to the problem of the incompatible escape sequences, it was originally inside a disabled |
Co-authored-by: Scott Shawcroft <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works in PuTTY now. The ifdef was why it wasn't working for me before.
#6608 includes a fix for the build that runs out of space. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
.. similar to how standard Python does it.
Closes: #6635