Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!haven!udel!mmdf From: postmaster@att-in.att.com Newsgroups: comp.os.minix Subject: (none) Message-ID: <8398@nigel.udel.EDU> Date: 16 Jan 90 18:43:46 GMT Sender: mmdf@udel.EDU Lines: 100 Mail to `att.att.com!attmail!mhs!envoy!ics.test/pn=_test_group' alias `att!attmail!mhs!envoy!ics.test/pn=_test_group' from 'VM1.NoDak.EDU!INFO-MINIX%UDEL.EDU' failed. The error message was: destination unknown or forwarding disallowed The message began: Received: from NDSUVM1.BITNET by VM1.NoDak.EDU (IBM VM SMTP R1.2.1MX) with BSMTP id 9325; Tue, 16 Jan 90 12:27:53 CST Received: from NDSUVM1.BITNET by NDSUVM1.BITNET (Mailer R2.03B) with BSMTP id 9318; Tue, 16 Jan 90 12:27:51 CST Date: Tue, 16 Jan 90 15:16:16 MEZ Reply-To: INFO-MINIX%UDEL.EDU@VM1.NoDak.EDU Sender: Minix operating system From: Christoph van Wuellen Subject: elvis fixes To: Multiple recipients of list MINIX-L Here are two fixes for the recently posted vi-clone elvis: 1.) curses.c -- getting the screen size -- The program assumes that it can get the terminal size through the TIOCGWINSZ ioctl if it is defined. That may not be true (is not true on our Sun if you are on an external terminal). elvis gives up immedeately (and logged me out eventually!). While you are under a window manager, you have to use this ioctl, so it is not clear what to do. I decided to ask termcap about the size of the terminal if TIOCGWINSZ reports 0 columns and 0 rows. *** curses.c.orig Wed Jan 10 17:59:16 1990 --- curses.c Thu Jan 11 09:38:18 1990 *************** *** 259,268 **** /* get the window size, one way or another. */ #ifdef TIOCGWINSZ LINES = COLS = 0; ! if (ioctl(2, TIOCGWINSZ, &size) >= 0) { LINES = size.ws_row; COLS = size.ws_col; } #else LINES = tgetnum("li"); --- 259,274 ---- /* get the window size, one way or another. */ #ifdef TIOCGWINSZ LINES = COLS = 0; ! if (ioctl(2, TIOCGWINSZ, &size) >= 0 && ! size.ws_row>0 && size.ws_col>0) { LINES = size.ws_row; COLS = size.ws_col; + } + else + { + LINES = tgetnum("li"); + COLS = tgetnum("co"); } #else LINES = tgetnum("li"); 2.) (more serious) Nothing happened when the cursor was on the top line and I pressed the up-arrow key! In redraw(), the check on the availability of reverse scrolling is at the wrong place (yes, my terminal does not have reverse scrolling!). If there is no reverse scrolling, it should be the same procedure as moving to a distant line: *** redraw.c.orig Thu Jan 11 09:58:31 1990 --- redraw.c Thu Jan 11 10:04:14 1990 *************** *** 93,102 **** smartdrawtext(text, l); } } ! else if (l < topline && l > topline - LINES) { /* near top - scroll down */ ! if (!mustredraw && (SR || AL)) { move(0,0); while (l < topline) --- 93,102 ---- smartdrawtext(text, l); } } ! else if (l < topline && l > topline - LINES && (SR || AL)) { /* near top - scroll down */ ! if (!mustredraw) { move(0,0); while (l < topline) The first error only occurs when working at a window-workstation using only a terminal screen, the second error occurs with terminals that have no reverse scrolling. But it should be corrected! Now, it works, though vi works better with less intelligent terminals. Christoph van Wuellen.