Skip to content
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

Handle terminal line wrap to avoid new line #533

Merged
merged 3 commits into from May 9, 2023

Conversation

RDruon
Copy link
Contributor

@RDruon RDruon commented Apr 17, 2023

Terminal usually wrap line in case it can't fit the current terminal width.
This behavior is not taken in account by indicatif and create some visual artifacts.

The issue was reported as #144 (closed with a workaround) and #520.

Please find below a demo without the patch:
WindowsTerminal_wwpvPvmRKY

Demo with the patch:
WindowsTerminal_Q7z1mdXh3O

Using #144 example:
WindowsTerminal_HVhbcstdMB

Copy link
Collaborator

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a nice improvement to me! @chris-laplante what do you think?

Would be nice to have some tests for this.

@chris-laplante
Copy link
Collaborator

Seems like a nice improvement to me! @chris-laplante what do you think?

Would be nice to have some tests for this.

Makes sense to me too! I agree some tests would be nice. @RDruon are you able to implement a render test or two for this?

@RDruon
Copy link
Contributor Author

RDruon commented Apr 24, 2023

Seems like a nice improvement to me! @chris-laplante what do you think?
Would be nice to have some tests for this.

Makes sense to me too! I agree some tests would be nice. @RDruon are you able to implement a render test or two for this?

I added 2 render tests, one with ProgressBar and one with MultiProgress

@RDruon
Copy link
Contributor Author

RDruon commented May 9, 2023

@chris-laplante could I get another review? It seems several projects are interested in this change.

@djc djc merged commit 3d5dbb3 into console-rs:main May 9, 2023
9 checks passed
@djc
Copy link
Collaborator

djc commented May 9, 2023

I think this is looking good, thanks! @chris-laplante feel free to follow-up if you have more thoughts.

@chris-laplante
Copy link
Collaborator

Sorry for the delay! Looks good to me as well

@djc djc mentioned this pull request May 24, 2023
lgarron added a commit to lgarron/folderify that referenced this pull request Jun 2, 2023
Release notes:

- Avoid extra newlines in narrow terminals by bumping the `indicatif` dependency to v0.17.4.
  - This pulls in the fix for console-rs/indicatif#533
  - console-rs/indicatif#520 is still an issue if the terminal only has space for ≈lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants