Skip to content

Conversation

WhyNotHugo
Copy link
Contributor

@WhyNotHugo WhyNotHugo commented Mar 19, 2025

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

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.
@rustbot
Copy link
Collaborator

rustbot commented Mar 19, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-console-output Area: Terminal output, colors, progress bar, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 19, 2025
} else {
string.truncate(ellipsis_pos);
string.push_str("...");
string.push_str("");
Copy link
Contributor

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().

Copy link
Contributor Author

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.

Copy link
Contributor

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

@epage
Copy link
Contributor

epage commented Mar 19, 2025

Thanks for contributing this! It would be great to find ways to better leverage unicode output now that we can with term.unicode being added in #13337.

@weihanglo
Copy link
Member

@rustbot user

epage pushed a commit to epage/cargo that referenced this pull request Sep 12, 2025
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.

Closes rust-lang#15330
github-merge-queue bot pushed a commit that referenced this pull request Sep 12, 2025
### What does this PR try to resolve?

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.

### How to test and review this PR?

This applies the review feedback left in #15330

Closes #15330
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 12, 2025
@WhyNotHugo WhyNotHugo deleted the ellipsis branch September 12, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-console-output Area: Terminal output, colors, progress bar, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants