-
-
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
Unbound max_term_width
hurts readability
#4295
Comments
I tried messing around with |
In the migration guide, there is this line:
We previously had a "wrap_help" feature flag that didn't control help wrapping but instead controlled wrapping to the terminal's width. I moved wrapping into that feature as well as there are a lot of commands that focus on keeping their help short enough that only in small terminals do they need wrapping. For now, I left it as non-default but called it out in the migration guide. |
I saw that, but it's odd to have |
Eh, actually nevermind about taking on the extra deps. Though the *term_width functions should really be behind the feature flag. In general, the clap docs are in a pretty unhealthy state right now with a lot of references to things that don't exist or don't work anymore. |
They are now documented as needing
Thats a pretty broad comment to be making especially when it hasn't been backed up with creating issues to point out what else is the matter. |
For 5.0, these should really be behind the feature unless there's some reasoning I'm not aware of.
Fair enough, though the *term_width functions are just one example. I must admit the upgrade to 4.0 was quite frustrating. Created #4308. It might be worth picking some random OSS project and upgrading them to clap v4 to see what it's like for yourself. |
I'm familiar with what the upgrade is like |
That's actually pretty cool, wasn't aware. Maybe the actual issue then is that there's too little info explaining how to restore old behavior. The changelog sort of reads as a "Here's what changed, good luck trying to restore old behavior you liked lol." Of course I'm exaggerating, but adding the |
That would be a bug. Please create a minimal reproduction case and open an issue |
That's what this issue was about. Run the above repro ( clap/src/output/help_template.rs Line 104 in 106d8f5
|
To summarize what is going on
Nothing is broken per se. The behavior for I can understand though of changing the behavior of Re-opening, taking this as a request to change |
max_term_width
hurts readability
From #4484
This was added in #654 to resolve #653. The value does not seem to have changed in that entire time. |
That issue appears to be confirming the behavior of the PR I just opened:
What is there to discuss? It's basically just "Should max_term_width have a default?" yes/no. If the answer is no, then this issue should be closed, otherwise my PR should be merged. Clap 3 defaulted to yes and if we take |
|
Well again, I still consider this a regression, so:
|
I'm stepping away from this Issue for a cool down period as you are coming across as belligerent in responses rather than collaborating in good faith. |
I'm frustrated because a good chunk of my interactions with you have been immediately rejected without justification beyond what amounts to "I don't like this." Let's take this issue as an example. We're the only two participants and I've said what I think multiple times: we should bring back the max width (because it's a clap 3 regression, hard to read, and not a breaking change). For there to be discussion, I would need to know what your opinion is, but I don't. Furthermore, you haven't acknowledged my points so there are no counterpoints I can address. Hence there is nothing for me to discuss. So I guess I feel like I'm being needlessly asked to waste my time repeating myself over and over again (I've sunk ~5hrs into this issue by now for what I feel should be a trivial change). I also think my language might be misconstrued, so I want to be super clear.
This is an honest question. Again, you've put out the questions to discuss but not provided opinions. I've answered the questions several times so what else am I supposed to say? Again, honest question. I have no idea what else you're picturing in your head when you say discuss. There's nothing more for me to say.
Putting "broke" in quotes is supposed to mean I don't consider that a breaking change. When I said "look nicer," I meant that sincerely though I can see how it could be seen a sarcasm. Apologies if that's how you interpreted it. I'm saying that you've already made changes to the help output to improve it and I consider that to be fine so we may as well keep doing that. Basically, "eh/whatevs/don't care." |
Actually, I take that back. To quote you: "having too long of lines becomes unhelpful for reading" and "is this innocuous enough to not be a breaking change (I think so)." So we're even in agreement? I just don't get it. |
The state of this Issue is marked in the labels, as I mentioned. I've consistently asked for people to discuss things before moving on to PRs
Another important aspect is communication. This issue would go a lot more smoothly but
I've also had less patience in this issue because
I'd recommend taking a step back for a few days, and looking at this again with fresh eyes. |
That's true, but under the assumption that this isn't any more of a breaking change than the other help tweaks, there are only a few options:
Same here, which is why it's sad that we're wasting time on this. Concerns or fears about the change still haven't been shared, even though it appears you are in favor the change.
Same here, this is draining. I'm not enjoying this any more than you are.
|
Just thought of something: those people would probably argue that a max width requires them to scroll more vertically, so maybe the max width should be 120? Or you could argue that the terminal's actual width is the prefered width, but I've found that to rarely be the case as the terminal tends to be in-editor or tiled by a window manager these days. If not, then the default starting width for a terminal width is 80 AFAIK, so this change wouldn't affect those people. |
I'd like to also clarify why I believe this is a regression, because I don't think I'm getting through. In clap 3, the default width was 100 because the My point is that by forcing people to use their terminal width to get any wrapping at all, the distinction between devs saying "I want my users to be terminal wrapped" vs "I want wrapping of any kind" has been lost. And this issue is arguing that it's better to cater to the "I want wrapping of any kind" people because they are necessarily a superset of the "I want my users to be terminal wrapped" people (though I guess that's bad logic because the set difference could still be smaller, but I don't think it is). |
Sigh, now I can't get this issue out of my head. Prior art: #1891
Similar to the other quote I posted, the problem solved by using the terminal width seems to be about when it's too thin.
Seems to be about 80 chars specifically, so let's not do that. I'm leaning more towards 120?
A point in favor of 100.
That's a great summary of how I feel about this issue. I just sunk another 1.5 hrs into it, and for what? To me, it was self-evident that some max width was better than none because every modern website ever, the existence of books, newspapers, etc uses some max width. I should have been quicker to see that you don't share that axium and given you arguments to support it. But also, now I'm sad that I've lost so much time to an issue that seemed trivial to me. |
So... why is it that setting I would also like to point out that the documentation for Command::max_term_width seems to be wrong. It says
That would be my preference, but it is not how it behaves. Instead, the help is wrapped to the dynamically determined terminal width. |
Finally getting back to this
Originally, wrapping itself was an external dependency but was always forced on. We've re-implemented the text wrapping code internally but whether its internal or not makes less of a difference (besides people who play dependency golf which I disagree with). So rather than forcing a dependency to be always on, we've consolidated wrapping related features to
An upcoming change will fix this documentation bug. |
The case not being handled is if someone is already setting one or both values. If someone is setting the term width to a hard coded value and we set max term width to be less than that, we've violated expectations from the given API |
Please complete the following tasks
Rust Version
nightly
Clap Version
4.0.4
Minimal reproducible code
Steps to reproduce the bug with the above code
Run
Actual Behaviour
Help is way too long
Expected Behaviour
Max 100 chars
Additional Context
Workaround: manually call
#[command(max_term_width = 100)]
Debug Output
No response
The text was updated successfully, but these errors were encountered: