/* Initialize these last, because terminal position could be affected by printfs above. */
if (params->have_vga == GRUB_VIDEO_TYPE_TEXT)
{
- params->video_cursor_x = grub_console_getxy () >> 8;
- params->video_cursor_y = grub_console_getxy () & 0xff;
+ grub_term_output_t term;
+ int found = 0;
+ FOR_ACTIVE_TERM_OUTPUTS(term)
+ if (grub_strcmp (term->name, "vga_text") == 0)
+ {
+ grub_uint16_t pos = grub_term_getxy (term);
+ params->video_cursor_x = pos >> 8;
+ params->video_cursor_y = pos & 0xff;
+ found = 1;
+ }
+ if (!found)
+ FOR_ACTIVE_TERM_OUTPUTS(term)
+ if (grub_strcmp (term->name, "console") == 0)
+ {
+ grub_uint16_t pos = grub_term_getxy (term);
+ params->video_cursor_x = pos >> 8;
+ params->video_cursor_y = pos & 0xff;
+ found = 1;
+ }
+ if (!found)
+ {
+ params->video_cursor_x = 0;
+ params->video_cursor_y = 0;
+ }
}
#ifdef __x86_64__