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

missing escape terminator 'm' returned #10

Open
amityahav opened this issue Sep 14, 2023 · 2 comments
Open

missing escape terminator 'm' returned #10

amityahav opened this issue Sep 14, 2023 · 2 comments

Comments

@amityahav
Copy link

Hey thank you for this amazing project.

im trying to Cleanse the string "\u0008\u001b[K", i would expect to get an empty string afterwards since its all escape chars.
but instead im getting the error in the title.

also according to ChatGPT its seems like a valid sequence:

"\u0008" (Backspace): As mentioned earlier, this is the "Backspace" character, which is used to move the cursor or insertion point one position backward within the same line of text.

"\u001b[K": This is an ANSI escape sequence that instructs the terminal to clear characters from the current cursor position to the end of the line. The "\u001b" represents the Escape character, and "[K" is the control code for erasing characters to the right of the cursor.

@leaanthony
Copy link
Owner

Thanks for reporting this. Are you comfortable raising a PR for it?

@amityahav
Copy link
Author

amityahav commented Sep 15, 2023

Im not sure regarding all the cases where this sequence occurs, I mean what happens when there's a text adj to it , how can I know where is the cursor and what sequence of bytes I would need to erase. Also I got the same error with the same sequence with '[1P' at the end instead of '[K'.
Do you have any useful resource to read about all those codes?

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