-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Use ellipses when truncating progress #15330
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
base: master
Are you sure you want to change the base?
Conversation
Use ellipses when truncating progress instead of three periods. While this allows an extra two characters to fit on screen, the main motivation it to reduce the visual quirkiness or the resulting output.
r? @weihanglo rustbot has assigned @weihanglo. Use |
ellipsis_pos = string.len(); | ||
} | ||
} else { | ||
string.truncate(ellipsis_pos); | ||
string.push_str("..."); | ||
string.push_str("…"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not unconditionally output unicode characters but need to check either shell().out_unicode()
or shell().err_unicode()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unicode is a superset of ascii. I assume you mean non-ascii Unicode?
It actually slipped my mind that this is non-ascii. I'll update this and review the tests below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unicode is a superset of ascii. I assume you mean non-ascii Unicode?
Yes
Thanks for contributing this! It would be great to find ways to better leverage unicode output now that we can with |
What does this PR try to resolve?
Visual quirkiness in progress that doesn't fit on screen. Instead of using three periods at the end of the screen, use an ellipses.
How should we test and review this PR?
Any regular operation on a narrow screen should make the difference evident.
Additional information
n/a