diff options
author | jkh <jkh@FreeBSD.org> | 1996-08-01 10:58:54 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-08-01 10:58:54 +0000 |
commit | af06a2d9e69e86a80a2559942d364be66f5dd707 (patch) | |
tree | afaaedec3fc4f42484fac5946e067d2a60975056 /release/sysinstall | |
parent | 8ff2c2006196d9a599bf8020a3c2b7c5b61f3b72 (diff) | |
download | FreeBSD-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 'release/sysinstall')
-rw-r--r-- | release/sysinstall/dmenu.c | 7 | ||||
-rw-r--r-- | release/sysinstall/globals.c | 3 | ||||
-rw-r--r-- | release/sysinstall/msg.c | 19 | ||||
-rw-r--r-- | release/sysinstall/sysinstall.h | 3 | ||||
-rw-r--r-- | release/sysinstall/system.c | 3 | ||||
-rw-r--r-- | release/sysinstall/termcap.c | 9 |
6 files changed, 28 insertions, 16 deletions
diff --git a/release/sysinstall/dmenu.c b/release/sysinstall/dmenu.c index 89f2edd..dcd742f 100644 --- a/release/sysinstall/dmenu.c +++ b/release/sysinstall/dmenu.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: dmenu.c,v 1.22 1996/07/05 08:35:53 jkh Exp $ + * $Id: dmenu.c,v 1.23 1996/07/11 18:37:47 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -171,7 +171,10 @@ menu_height(DMenu *menu, int n) int max; char *t; - for (t = menu->prompt, max = MAX_MENU; *t; t++) { + max = MAX_MENU; + if (StatusLine > 24) + max += StatusLine - 24; + for (t = menu->prompt; *t; t++) { if (*t == '\n') --max; } diff --git a/release/sysinstall/globals.c b/release/sysinstall/globals.c index 7e10877..e86491b 100644 --- a/release/sysinstall/globals.c +++ b/release/sysinstall/globals.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: globals.c,v 1.12 1996/04/13 13:31:38 jkh Exp $ + * $Id: globals.c,v 1.13 1996/04/28 20:53:58 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -50,6 +50,7 @@ Boolean OnVTY; /* Are we on a VTY? */ Variable *VarHead; /* The head of the variable chain */ Device *mediaDevice; /* Where we're installing from */ int BootMgr; /* Which boot manager we're using */ +int StatusLine; /* Where to stick our status messages */ /* * Yes, I know some of these are already automatically initialized as diff --git a/release/sysinstall/msg.c b/release/sysinstall/msg.c index 3369019..d1b6b18 100644 --- a/release/sysinstall/msg.c +++ b/release/sysinstall/msg.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: msg.c,v 1.37 1996/07/10 11:38:28 jkh Exp $ + * $Id: msg.c,v 1.38 1996/07/31 06:20:58 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -39,9 +39,6 @@ #include <sys/ioctl.h> #include <machine/console.h> -#define VTY_STATLINE 24 -#define TTY_STATLINE 23 - Boolean isDebug(void) { @@ -64,7 +61,7 @@ msgYap(char *fmt, ...) va_end(args); attrs = getattrs(stdscr); attrset(A_REVERSE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); + mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); } @@ -81,7 +78,7 @@ msgInfo(char *fmt, ...) attrs = getattrs(stdscr); /* NULL is a special convention meaning "erase the old stuff" */ if (!fmt) { - move(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0); + move(StatusLine, 0); clrtoeol(); return; } @@ -98,9 +95,9 @@ msgInfo(char *fmt, ...) } line[80] = '\0'; attrset(ATTR_TITLE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, line); + mvaddstr(StatusLine, 0, line); attrset(attrs); - move(OnVTY ? VTY_STATLINE : TTY_STATLINE, 79); + move(StatusLine, 79); refresh(); } @@ -120,7 +117,7 @@ msgWarn(char *fmt, ...) attrs = getattrs(stdscr); beep(); attrset(ATTR_TITLE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); + mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); if (OnVTY && isDebug()) @@ -143,7 +140,7 @@ msgError(char *fmt, ...) beep(); attrs = getattrs(stdscr); attrset(ATTR_TITLE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); + mvaddstr(StatusLine, 0, errstr); attrset(attrs); refresh(); if (OnVTY && isDebug()) @@ -166,7 +163,7 @@ msgFatal(char *fmt, ...) beep(); attrs = getattrs(stdscr); attrset(ATTR_TITLE); - mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr); + mvaddstr(StatusLine, 0, errstr); addstr(" - "); addstr("PRESS ANY KEY TO "); if (getpid() == 1) diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index 84c35fd..517a141 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.76 1996/07/31 06:20:59 jkh Exp $ + * $Id: sysinstall.h,v 1.77 1996/07/31 09:29:35 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -295,6 +295,7 @@ extern unsigned int XF86Dists; /* Which XFree86 dists we want */ extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ extern int BootMgr; /* Which boot manager to use */ +extern int StatusLine; /* Where to print our status messages */ extern DMenu MenuInitial; /* Initial installation menu */ extern DMenu MenuFixit; /* Fixit repair menu */ extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c index 3cb6e47..ad89994 100644 --- a/release/sysinstall/system.c +++ b/release/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.61 1996/07/08 08:54:34 jkh Exp $ + * $Id: system.c,v 1.62 1996/07/10 11:38:29 jkh Exp $ * * Jordan Hubbard * @@ -58,6 +58,7 @@ systemInitialize(int argc, char **argv) { int i; + signal(SIGINT, SIG_IGN); globalsInit(); diff --git a/release/sysinstall/termcap.c b/release/sysinstall/termcap.c index 834ea0f..8888ee9 100644 --- a/release/sysinstall/termcap.c +++ b/release/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; } |