question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bar soft wraps if terminal window is too narrow (wide unicode chars are tricky)

See original GitHub issue

As in the title: when terminal window is too narrow progress bar stops animating and it prints itself line by line.

I’m using code from README:

with alive_bar(len(text)) as bar:
    for i in range(len(text)):
        #do some stuff
        bar(text="xd", incr=1)

Here’s output: 2019-12-08-14-08-43

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:51 (39 by maintainers)

github_iconTop GitHub Comments

4reactions
rsalmeicommented, Jul 7, 2020

Here it is: wrap_support

4reactions
rsalmeicommented, Jul 7, 2020

Hello @MartinHammarstedt, how are you?

Good news, this is ready and working! 🎉 After realizing that v2 was getting way too big, I’ve decided to split this implementation in two: now we’ll get a static soft wrap behavior right in this major (so including python 2 support), and someday that adaptive one I’ve talked about.

This new version will include:

  1. soft wrapping support
  2. hiding cursor support
  3. logging support
  4. exponential smoothing of ETA data
  5. proper bar title
  6. enhanced elapsed time representation

Wow, that will make a very mature and feature complete progress bar for python 2, ready to expand for python 3 only.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Need a single width unicode character to indicate a wide ...
I'm looking at formatting a utf8 free text string to fit an exact column width on a terminal. I'm coding various truncation methods ......
Read more >
Double-width characters in Unicode 9+ - Freedesktop GitLab
Making a character narrower is way more problematic when it comes to line wrapping. You print a double-wide character first, but there was ......
Read more >
Unicode and UTF-8 Output Text Buffer - Windows Command ...
In this post, we'll discuss the improvements we've been making to the Windows Console's internal text buffer, enabling it to better store and ......
Read more >
UTS #18: Unicode Regular Expressions
Unicode is a large character set—regular expression engines that are only adapted to handle small character sets will not scale well. Unicode ......
Read more >
mintty [OPTION]... [ - | PROGRAM [ARG]... ]
Determine whether to keep the terminal window open when the command has ... while the horizontal terminal view is narrower than the actual...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found