Avoid stale messages on terminal to appear in new lines

This commit is contained in:
Andrea Mazzoleni 2025-10-12 23:55:32 +02:00
parent 1aa1455ea0
commit c1e101699a
2 changed files with 97 additions and 33 deletions

View file

@ -4395,9 +4395,6 @@ void state_progress_end(struct snapraid_state* state, block_off_t countpos, bloc
msg_bar(" in %u:%02u", (unsigned)(elapsed / 3600), (unsigned)((elapsed % 3600) / 60));
/* some extra spaces to ensure to overwrite the latest status line */
msg_bar(" ");
msg_bar("\n");
msg_flush();
}
@ -4431,8 +4428,6 @@ void state_progress_restart(struct snapraid_state* state)
state->progress_wasted += now - state->progress_interruption;
}
#define PROGRESS_CLEAR " "
/**
* Set the latest tick data in the progress vector.
*/
@ -4845,7 +4840,7 @@ int state_progress(struct snapraid_state* state, struct snapraid_io* io, block_o
}
msg_bar(", %u:%02u ETA", out_eta / 60, out_eta % 60);
}
msg_bar("%s\r", PROGRESS_CLEAR);
msg_bar("\r");
msg_flush();
}