-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
textwrap is confused by ColoredHelp #1246
Comments
Sorry for the long wait, I've been out with my day job. I looks like the unprinted color codes are what's confusing it. @mgeisler this looks like it might be on your end 😉 |
Hi guys, yeah, that is something textwrap should be able to handle better! Thanks for the great bug report, I've added an issue for it in my tracker: mgeisler/textwrap#140. |
The linked |
I removed the colors from being sent to textwrap. That still doesn't solve this issue because we are now not coloring the possible/default values. Let's keep this open until that is fixed. |
So it sounds like we've implemented a hack (remove coloring) and textwrap has a permanent fix even if we undo the hack. @pksunkara what would be the reason for keeping this open? |
I think I wanted this open to give more context for #1456. |
This presumably depends on #836
Rust Version
1.25.0
Affected Version of clap
2.31.2
Expected Behavior Summary
Displaying colored help should use the available
term_width
.Actual Behavior Summary
The escape sequences make the
String
look long to the text wrapper, but not to the user, and the newline arrive long before the visibleterm_width
.Steps to Reproduce the issue
Take this App definition and run it either normally (colored) or piped to
cat
(non-colored).The text was updated successfully, but these errors were encountered: