Suport manual terminal geometry specification.

* grub-core/term/ieee1275/ofconsole.c (grub_ofconsole_dimensions):
	Save state in grub_ofconsole_terminfo_output.
	(grub_ofconsole_term): Use grub_terminfo_getwh.
	(grub_ofconsole_getwh): Removed.
	* grub-core/term/serial.c (grub_serial_getwh): Removed.
	(grub_serial_term): Use grub_terminfo_getwh.
	* grub-core/term/terminfo.c (grub_terminfo_getwh): New function.
	(options): New struct.
	(OPTION_*): New enum.
	(grub_cmd_terminfo): Transform into extcmd and handle new parameters.
	* include/grub/terminfo.h (grub_terminfo_output_state): New fields
	width and height.
	(grub_terminfo_getwh): New proto.
	* grub-core/lib/legacy_parse.c (grub_legacy_parse): Handle --lines.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-09-20 16:27:33 +02:00
parent 1a8fed20ad
commit a9cc5438a5
6 changed files with 119 additions and 89 deletions

View file

@ -273,7 +273,7 @@ struct legacy_command legacy_commands[] =
" default values are COM1, 9600, 8N1."},
/* FIXME: setkey unsupported. */ /* NUL_TERMINATE */
/* NOTE: setup unsupported. */
/* FIXME: --no-echo, --no-edit, --lines, hercules unsupported. */
/* FIXME: --no-echo, --no-edit, hercules unsupported. */
/* NOTE: both terminals are activated so --silent and --timeout
are useless. */
{"terminal", NULL, NULL, 0, 0, {}, FLAG_TERMINAL | FLAG_IGNORE_REST,
@ -558,20 +558,16 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix)
}
grub_strcpy (outptr, "; ");
outptr += grub_strlen (outptr);
if (serial && dumb)
if (serial)
{
grub_strcpy (outptr, "terminfo serial dumb; ");
outptr += grub_strlen (outptr);
}
if (serial && !dumb)
{
grub_strcpy (outptr, "terminfo serial vt100; ");
grub_snprintf (outptr, outbuf + sizeof (outbuf) - outptr,
"terminfo serial -g 80x%d %s; ",
lines, dumb ? "dumb" : "vt100");
outptr += grub_strlen (outptr);
}
grub_strcpy (outptr, "\n");
return grub_strdup (outbuf);
}