Some users have reported that reading the CLI can be difficult,
especially when spitting out a lot of information.
This patch:
* adds a missing reset_more_printf() in the disk CLI
* reduces the total scrolling to 20 lines (seems better in my testing)
* removes a reset_more_printf() in the show disk function. This can potentially
be bad when doing a lot of show disk 0xXX (especially after 4 in a row)
but enhances the display when running show disks with lots of disks.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
void main_show_disk(int argc, char **argv,
struct s_hardware *hardware)
{
- reset_more_printf();
if (!argc) {
more_printf("Which disk?\n");
return;
}
fprintf(stderr, "\n");
}
+
+ more_printf("\n");
}
void main_show_disks(int argc __unused, char **argv __unused,
int i = -1;
detect_disks(hardware);
+ reset_more_printf();
for (int drive = 0x80; drive < 0xff; drive++) {
i++;
extern int display_line_nb;
#define more_printf(...) do {\
- if (display_line_nb == 23) {\
- printf("Press any key to continue\n");\
+ if (display_line_nb == 20) {\
+ printf("\nPress any key to continue");\
display_line_nb=0;\
get_key(stdin, 0);\
}\