summaryrefslogtreecommitdiff
path: root/sysutils/whowatch/patches/patch-ab
blob: 4320573e4a188a8023ec9eb4865b480fa9ea4864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$NetBSD: patch-ab,v 1.3 2000/10/16 01:34:39 wiz Exp $

--- screen.c.orig	Tue Jun  6 20:53:24 2000
+++ screen.c
@@ -6,6 +6,7 @@
 struct window info_win;
 static chtype *curs_buf;
 extern int screen_cols;
+int old_cur_vis = 1; /* this is the cursor mode, set to normal as default */
 
 char *help_line[] = 
 	{
@@ -38,7 +39,7 @@
 	}
 
 	wattrset(users_list.wd, A_BOLD);
-        printf("\033[?25l");                    /* disable cursor */
+        old_cur_vis = curs_set(0);                    /* disable cursor */
 
         start_color();
 	init_pair(1,COLOR_CYAN,COLOR_BLACK);
@@ -58,6 +59,7 @@
 	
 	cbreak();
         nodelay(stdscr,TRUE);
+	keypad(info_win.wd, TRUE);
         scrollok(users_list.wd,TRUE);
         noecho();
 }				
@@ -67,7 +69,7 @@
 	werase(help_win.wd);
 	wrefresh(help_win.wd);
 	endwin();
-        printf("\033[?25h");            /* enable cursor */
+        curs_set(old_cur_vis);            /* enable cursor */
 }
 
 void cursor_on(struct window *w, int line)
@@ -116,7 +118,8 @@
 		if (i > w->cols) break;
 		if (*p < 17){
 			i--;
-			waddnstr(w->wd, q, p - q);
+			if (p - q != 0)
+				waddnstr(w->wd, q, p - q);
 			wattrset(w->wd, COLOR_PAIR(*p));
 			q = p + 1;
 		}