chuck-sys/superdiff

Progressbar \r fails when terminal window is not wide enough

Closed this issue · 5 comments

Instead of a progress bar that doesn't move, we get a progress bar that moves downwards by 1 row. This is probably because certain terminals will segment the line into multiple rows when not given enough space.

Temporary solution: truncate filenames until we have enough space (most terminals are ~80 width minimum, right?).

(most terminals are ~80 width minimum, right?)

I wouldn't count on it, that's an accessability problem for people having poor eyesight and who need massive fonts.

Have you considered using a third party library to do the progress bar? It would also mean not having to worry about weirdnesses on exotic platforms.

that's an accessibility problem for people having poor eyesight and who need massive fonts.

Ah I didn't think of that. The initial reason why I wanted to not use third party libraries for this was because of the additional dependencies it would bring to the table. I'll have a look at small libraries that do this.

If you're worried about that, why not print a percentage out instead of a progress bar?

Progress bar with percentage implemented in https://github.com/cheukyin699/superdiff/releases/tag/2.2.0 onwards