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

Gracefully handle ANSI sequences inside of error messages #287

Open
Veetaha opened this issue Aug 22, 2023 · 0 comments
Open

Gracefully handle ANSI sequences inside of error messages #287

Veetaha opened this issue Aug 22, 2023 · 0 comments

Comments

@Veetaha
Copy link

Veetaha commented Aug 22, 2023

If the error message contains some ANSI escape sequences, for example to make part of the message stand out. Then they get broken when the error message gets big and it wrapped onto the next line.

Here is an example, where the path to a file in the error message was highlighted in red bold.

image

But when part of the path was wrapped to the next line the styling broke (I expected the marker_rustc_driver to also be red and bold).

To overcome this issue miette could use style wrapping such that it preserves the ANSI sequences in the error messages and resets them to their values when it has to insert some characters inside of the error message (like the pipe character and an arrow to display the chain of errors).

See also yansi::Paint::wrap method that implements this logic

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

1 participant