summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/termcap.c
diff options
context:
space:
mode:
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