* of `window-min-height' (`window-min-width' if HORIZONTAL is non-nil).
* With IGNORE non-nil the values of these variables are ignored.
*
- * In either case, never return a value less than 1.
+ * In either case, never return a value less than 1. For TTY frames,
+ * additionally limit the minimum frame height to a value large enough
+ * to support the menu bar, the mode line, and the echo area.
*/
static int
frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal,
{
struct frame *f = XFRAME (frame);
Lisp_Object par_size;
+ int retval;
if ((!NILP (horizontal)
&& NUMBERP (par_size = get_frame_param (f, Qmin_width)))
if (min_size < 1)
min_size = 1;
- return (NILP (pixelwise)
- ? min_size
- : min_size * (NILP (horizontal)
- ? FRAME_LINE_HEIGHT (f)
- : FRAME_COLUMN_WIDTH (f)));
+ retval = (NILP (pixelwise)
+ ? min_size
+ : min_size * (NILP (horizontal)
+ ? FRAME_LINE_HEIGHT (f)
+ : FRAME_COLUMN_WIDTH (f)));
}
else
- return XINT (call4 (Qframe_windows_min_size, frame, horizontal,
- ignore, pixelwise));
+ retval = XINT (call4 (Qframe_windows_min_size, frame, horizontal,
+ ignore, pixelwise));
+ /* Don't allow too small height of text-mode frames, or else cm.c
+ might abort in cmcheckmagic. */
+ if ((FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) && NILP (horizontal))
+ {
+ int min_height = (FRAME_MENU_BAR_LINES (f)
+ + FRAME_WANTS_MODELINE_P (f)
+ + 2); /* one text line and one echo-area line */
+ if (retval < min_height)
+ retval = min_height;
+ }
+
+ return retval;
}