aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2023-01-23 14:35:57 +0000
committerMichael Brown <mcb30@ipxe.org>2023-01-23 14:35:57 +0000
commit32a07ea8cb5ef24bc0388e035d3bb11c27f971eb (patch)
tree6e2e10df460059ba26d299ee14fc3b09b9226c22
parentfcfb70bfb2a9aae78e86a2505669068e7e511f79 (diff)
downloadipxe-32a07ea8cb5ef24bc0388e035d3bb11c27f971eb.zip
ipxe-32a07ea8cb5ef24bc0388e035d3bb11c27f971eb.tar.gz
ipxe-32a07ea8cb5ef24bc0388e035d3bb11c27f971eb.tar.bz2
[pxe] Avoid drawing menu items on bottom row of screenpxemenuscroll
Many consoles will scroll immediately upon drawing a character in the rightmost column of the bottom row of the display, in order to be able to advance the cursor to the next character (even if the cursor is disabled). This causes PXE menus to display incorrectly. Specifically, pressing the down arrow key while already on the last menu item may cause the whole screen to scroll and the line to be duplicated. Fix by moving the PXE menu one row up from the bottom of the screen. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/usr/pxemenu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usr/pxemenu.c b/src/usr/pxemenu.c
index 5e497f9..34fdf37 100644
--- a/src/usr/pxemenu.c
+++ b/src/usr/pxemenu.c
@@ -204,7 +204,7 @@ static void pxe_menu_draw_item ( struct pxe_menu *menu,
buf[ sizeof ( buf ) - 1 ] = '\0';
/* Draw row */
- row = ( LINES - menu->num_items + index );
+ row = ( LINES - menu->num_items + index - 1 );
color_set ( ( selected ? CPAIR_PXE : CPAIR_DEFAULT ), NULL );
mvprintw ( row, 0, "%s", buf );
move ( row, 1 );