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

Malformed escapes cause panic #7

Closed
gandalf3 opened this issue Nov 2, 2022 · 0 comments · Fixed by #8
Closed

Malformed escapes cause panic #7

gandalf3 opened this issue Nov 2, 2022 · 0 comments · Fixed by #8

Comments

@gandalf3
Copy link

gandalf3 commented Nov 2, 2022

Malformed escape codes (e.g. just ESC[) cause a panic. Here is a minimal example:

use cansi::v3::categorise_text;

fn main() {
    let x = categorise_text("oops\x1b[\n");
    println!("{}", x[0].text);
}

I believe at least from Oxker's perspective it'd make the most sense for cansi to ignore these and remove them from the resultant slice (ignoring them seems to be what most terminal emulators do).

I understand if you are not interested in fixing this, but for context I'm here from this issue: mrjackwills/oxker#17

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

Successfully merging a pull request may close this issue.

1 participant