Fixes to overwrite mode
This commit is contained in:
+12
-2
@@ -227,6 +227,8 @@ int main (int argc, char **argv)
|
||||
}
|
||||
|
||||
#ifdef USE_DCGM
|
||||
if (compact && (gpu_count > 0))
|
||||
printf("\n");
|
||||
print_dcgm(compact, overwrite);
|
||||
#endif
|
||||
|
||||
@@ -234,9 +236,17 @@ int main (int argc, char **argv)
|
||||
printf("\n"); /* Print line break at the end for continuous output */
|
||||
|
||||
if (overwrite && compact) {
|
||||
int total_lines = 0;
|
||||
if (print_board_sensors) total_lines++;
|
||||
if (gpu_count > 0) {
|
||||
total_lines += (gpu_num == -1) ? gpu_count : 1;
|
||||
}
|
||||
#ifdef USE_DCGM
|
||||
total_lines++;
|
||||
#endif
|
||||
printf("\x1b[1G"); /* Move cursor back to column 1 */
|
||||
if (gpu_count > 1 || print_board_sensors)
|
||||
printf("\x1b[%dA", gpu_count-1+print_board_sensors); /* Move cursor back up to the top of gpu list */
|
||||
if (total_lines > 1)
|
||||
printf("\x1b[%dA", total_lines - 1); /* Move cursor back up to the top */
|
||||
}
|
||||
|
||||
fflush(stdout);
|
||||
|
||||
Reference in New Issue
Block a user