+use Console;
+
+#
+# initialisation
+#
+
+$call = ""; # the callsign being used
+$conn = 0; # the connection object for the cluster
+$lasttime = time; # lasttime something happened on the interface
+
+$connsort = "local";
+@khistory = ();
+@shistory = ();
+$khistpos = 0;
+$spos = $pos = $lth = 0;
+$inbuf = "";
+
+# do the screen initialisation
+sub do_initscr
+{
+ $scr = new Curses;
+ raw();
+ noecho();
+ $has_colors = has_colors();
+
+ if ($has_colors) {
+ start_color();
+ init_pair("0", $foreground, $background);
+# init_pair(0, $background, $foreground);
+ init_pair(1, COLOR_RED, $background);
+ init_pair(2, COLOR_YELLOW, $background);
+ init_pair(3, COLOR_GREEN, $background);
+ init_pair(4, COLOR_CYAN, $background);
+ init_pair(5, COLOR_BLUE, $background);
+ init_pair(6, COLOR_MAGENTA, $background);
+ init_pair(7, COLOR_RED, COLOR_BLUE);
+ init_pair(8, COLOR_YELLOW, COLOR_BLUE);
+ init_pair(9, COLOR_GREEN, COLOR_BLUE);
+ init_pair(10, COLOR_CYAN, COLOR_BLUE);
+ init_pair(11, COLOR_BLUE, COLOR_RED);
+ init_pair(12, COLOR_MAGENTA, COLOR_BLUE);
+ init_pair(13, COLOR_YELLOW, COLOR_GREEN);
+ init_pair(14, COLOR_RED, COLOR_GREEN);
+ $scr->attrset(COLOR_PAIR(0));
+ }
+
+ $top = $scr->subwin(LINES()-4, COLS, 0, 0);
+ $top->intrflush(0);
+ $top->scrollok(1);
+ $scr->addstr(LINES()-4, 0, '-' x COLS);
+ $bot = $scr->subwin(3, COLS, LINES()-3, 0);
+ $bot->intrflush(0);
+ $bot->scrollok(1);
+ $bot->keypad(1);
+ $bot->move(1,0);
+ $scr->refresh();
+
+ $pagel = LINES()-4;
+ $mycallcolor = COLOR_PAIR(1) unless $mycallcolor;
+}
+
+sub do_resize
+{
+ undef $scr;
+ do_initscr();
+}