From af06a2d9e69e86a80a2559942d364be66f5dd707 Mon Sep 17 00:00:00 2001 From: jkh Date: Thu, 1 Aug 1996 10:58:54 +0000 Subject: Close PR#1542. Don't just assume 24 lines, get the tty size. Some things may still display text on the 24th line, but that's because they've always been screens designed to fit into a minimal real-estate and have hardwired assumptions about the dimensions. They'll be a little harder to make dynamic. --- usr.sbin/sysinstall/termcap.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'usr.sbin/sysinstall/termcap.c') diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c index 834ea0f..8888ee9 100644 --- a/usr.sbin/sysinstall/termcap.c +++ b/usr.sbin/sysinstall/termcap.c @@ -23,11 +23,15 @@ #include "sysinstall.h" +#define VTY_STATUS_LINE 24 +#define TTY_STATUS_LINE 23 + int set_termcap(void) { char *term; int stat; + struct ttysize ts; OnVTY = FALSE; term = getenv("TERM"); @@ -76,5 +80,10 @@ set_termcap(void) } OnVTY = TRUE; } + if (ioctl(0, TIOCGSIZE, &ts) == -1) { + msgDebug("Unable to get terminal size - errno %d\n", errno); + ts.ts_lines = OnVTY ? VTY_STATUS_LINE : TTY_STATUS_LINE; + } + StatusLine = ts.ts_lines; return 0; } -- cgit v1.1