-
Notifications
You must be signed in to change notification settings - Fork 44
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
Handles <ESC>[J and <ESC>M #68
Conversation
Similar to up, used as inverse to <ESC>[J in zsh sometimes.
Hi @wasv, thanks for this! Are you able to provide us with some examples of using this behaviour so we can implement some tests? |
I saw this issue most often was when using autocomplete in zsh. I've attached an example, captured using the |
A lot has happened in the world since I made this PR and #67. I can understand why they may have fallen into the backlog. However, I was wondering if they could be merged at some point? That way I can use the upstream instead of building my fork each time. If any additional work is needed, please let me know. |
Hey @wasv, I’m sorry that this one’s not been a high priority and has fallen a bit by the wayside. Given the potentially high-impact nature of changes to this for us, we’d really prefer them to have test coverage, and while I initially had intended to add that myself, it’s been a very weird year and other things have pulled our collective attention elsewhere. If you’d be able to add some specs for each of the escape codes you’ve added I’m sure we could get this merged, though! |
This way we don't end up with extraneous whitespace output
I wound up down a very deep rabbit hole of reading specs and testing terminal behaviours with this one today! 😂 I’ve pushed a few commits, and I hope they meet with your approval.
Wherever possible, I’ve followed the lead of xterm, iTerm 2 and Apple Terminal, and all seem to agree with the implementation I’ve ended up with. I’ve also sourced some of the explanations of codes, and borrowed some names, from https://www.real-world-systems.com/docs/ANSIcode.html I will be passing this to some golang-speaking colleagues for their input and merge approval, but I’d also love your thoughts on this. Apologies again for taking so long to get here, and thanks so much for caring enough to open this! 😃 |
Thank you for looking into this. Your commits look good to me, however, I actually don't know Go. I learned it for this PR. I'll check if this fixes the issues I was having with zsh autocomplete. |
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.
I was able to get this code to build and run, and it does fix the issues I was having with zsh autocomplete. However, I ran into some unrelated issues with the Dockerfile, which I described in a new issue. |
Thanks for this, @wasv! |
An issue introduced by an oversight in #68, it was possible for the line clearing instructions to fail if there weren't any lines present to clear in their respective positions.
Clears lines below current line on [J, clears entire scrollback buffer on [2J or [3J.
Also includes support for M, reverse linefeed, which is used alongside [J in zsh.
Fixes #2