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
kinnison opened this issue
Dec 27, 2021
· 1 comment
· Fixed by #3692
Labels
A-helpArea: documentation, including docs.rs, readme, examples, etc...C-bugCategory: Updating dependenciesE-mediumCall for participation: Experience needed to fix: Medium / intermediate
fnmain(){letmut app = App::new("Example");
app = app.subcommand(SubCommand::with_name("update").arg(Arg::with_name("force-non-host").help("Install toolchains that require an emulator. See https://github.com/rust-lang/rustup/wiki/Non-host-toolchains").long("force-non-host").takes_value(false)));let res = app.get_matches();println!("{:?}", res);}
Steps to reproduce the bug with the above code
If you run this with cargo run -- update --help you'll see the help text. If your terminal is narrow you'll notice that the URL gets word-broken.
Interestingly, if you shorten the text before the URL to fewer characters than the number of columns in the terminal (I was testing with a 35 column terminal, and at 32 characters before the URL it worked but at 33 it incorrectly broke the URL word.
Actual Behaviour
The URL is "word broken".
Expected Behaviour
I would expect the URL to not be broken, no matter how long it is, so that terminals can detect the full URL to permit clicking on it.
Interestingly it word-breaks the URL even on very very wide terminals.
Additional Context
This reproduces in rustup, particularly in
.arg(Arg::with_name("force-non-host").help("Install toolchains that require an emulator. See https://github.com/rust-lang/rustup/wiki/Non-host-toolchains").long("force-non-host").takes_value(false)),
We're using textwrap. So we need to either look into how we can customize it for our needs or open a bug for making it so we can limit splits like this.
epage
added
the
E-medium
Call for participation: Experience needed to fix: Medium / intermediate
label
Dec 27, 2021
epage
added a commit
to epage/clap
that referenced
this issue
May 4, 2022
A-helpArea: documentation, including docs.rs, readme, examples, etc...C-bugCategory: Updating dependenciesE-mediumCall for participation: Experience needed to fix: Medium / intermediate
Please complete the following tasks
Rust Version
rustc 1.57.0 (f1edd0429 2021-11-29)
Clap Version
2.33.3
Minimal reproducible code
Steps to reproduce the bug with the above code
If you run this with
cargo run -- update --help
you'll see the help text. If your terminal is narrow you'll notice that the URL gets word-broken.Interestingly, if you shorten the text before the URL to fewer characters than the number of columns in the terminal (I was testing with a 35 column terminal, and at 32 characters before the URL it worked but at 33 it incorrectly broke the URL word.
Actual Behaviour
The URL is "word broken".
Expected Behaviour
I would expect the URL to not be broken, no matter how long it is, so that terminals can detect the full URL to permit clicking on it.
Interestingly it word-breaks the URL even on very very wide terminals.
Additional Context
This reproduces in
rustup
, particularly inAs per rust-lang/rustup#2920
Debug Output
The text was updated successfully, but these errors were encountered: