You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.
Displaying colored help should use the available term_width.
-f <foo> Many colored values make this obvious [default: a] [possible values: a, b, c, d, e,
f, g, h, i, j]
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 visible term_width.
-f <foo> Many colored values make this obvious [default: a] [possible values:
a, b, c, d, e, f, g, h,
i, j]
Steps to Reproduce the issue
Take this App definition and run it either normally (colored) or piped to cat (non-colored).
let args = app_from_crate!().global_setting(AppSettings::ColoredHelp).arg(Arg::with_name("foo").help("Many colored values make this obvious").short("f").takes_value(true).possible_values(&["a","b","c","d","e","f","g","h","i","j"]).default_value("a")).get_matches();
The text was updated successfully, but these errors were encountered:
Comment by mgeisler Tuesday May 22, 2018 at 19:26 GMT
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.
Comment by pksunkara Tuesday Apr 14, 2020 at 22:06 GMT
This is fixed in #1824 because I removed the colors for arg metadata. Re-adding them back will be addressed in #1456. And that should address this properly. Keeping this open until then.
Comment by pksunkara Tuesday Jun 30, 2020 at 23:08 GMT
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.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue by vincentdephily
Friday Apr 13, 2018 at 09:25 GMT
Originally opened as clap-rs/clap#1246
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: