summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/termcap.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-08-01 10:58:54 +0000
committerjkh <jkh@FreeBSD.org>1996-08-01 10:58:54 +0000
commitaf06a2d9e69e86a80a2559942d364be66f5dd707 (patch)
treeafaaedec3fc4f42484fac5946e067d2a60975056 /usr.sbin/sysinstall/termcap.c
parent8ff2c2006196d9a599bf8020a3c2b7c5b61f3b72 (diff)
downloadFreeBSD-src-af06a2d9e69e86a80a2559942d364be66f5dd707.zip
FreeBSD-src-af06a2d9e69e86a80a2559942d364be66f5dd707.tar.gz
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.
Diffstat (limited to 'usr.sbin/sysinstall/termcap.c')
-rw-r--r--usr.sbin/sysinstall/termcap.c9
1 files changed, 9 insertions, 0 deletions
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;
}
OpenPOWER on IntegriCloud