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

fix(clap): line wrap on strings that contain ascii control characters #4361

Merged
merged 2 commits into from Oct 9, 2022
Merged

fix(clap): line wrap on strings that contain ascii control characters #4361

merged 2 commits into from Oct 9, 2022

Conversation

hargut
Copy link
Contributor

@hargut hargut commented Oct 8, 2022

counting ascii control sequences leads to unpredictable line breaks on colorized inputs (e.g. syntax highlighted strings)

#4360

counting ascii control sequences lead to unpredictable and early
line breaks on colorized inputs (e.g. syntax highlighted strings)
counting ascii control sequences lead to unpredictable and early
line breaks on colorized inputs (e.g. syntax highlighted strings)
@epage
Copy link
Member

epage commented Oct 9, 2022

Thanks! What is bothering me is that I can't find the origin of this code. textwraps code doesn't look like this. I rewrote some of the code but this doesn't look like something I wrote...

@epage epage merged commit db7439f into clap-rs:master Oct 9, 2022
@hargut
Copy link
Contributor Author

hargut commented Oct 9, 2022

@epage
It looks like it originates from the textwrap crate. https://github.com/mgeisler/textwrap/blob/master/src/core.rs
At least parts of the comments are equal, and it seems that textwrap also added the skipping of ansi control characters at some point.

Eventually it was included due to an extension/fix?

@epage
Copy link
Member

epage commented Oct 10, 2022

The textwrap implementation is very different and hasn't changed since I copied other code over from it.

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 this pull request may close these issues.

None yet

2 participants