Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had the problem of my progress bars starting to flicker after adding some more bars, especially over an ssh connection. I then found #42 and from that then found #143, but the fix described there to set
m.set_move_cursor(true);
didn't make a difference at all.After some debugging, I found out, that the move_cursor flag was used in the
draw_to_term()
function, but this is only called from aDrawable::Term
, while theset_move_cursor
was only set on theMultiState
which is only used in theDrawable::Multi
. So in the current state, it never has any effect when actually drawing to the terminal.Then after forwarding the flag to the correct DrawState instance, I noticed, that the first bar always starts drawing one line too high on the last char, so the first line was just off-by-one. This was because the cursor is always on the last char of the last line, and then moving up the number of bars, will always end up one line too high. So just move up one line less, but then the cursor also still needs to be moved to the front of the line.
So this now fixes using of
set_move_cursor(true)
again, so it can be used to fix the flickering.