+$clusteraddr //= '127.0.0.1';
+$clusterport //= 27754;
+
+our $call = ""; # the callsign being used
+our $node = ""; # the node callsign being used
+our $conn = 0; # the connection object for the cluster
+our $lasttime = time; # lasttime something happened on the interface
+
+our $connsort = "local";
+our @kh = ();
+our @sh = ();
+our $kpos = 0;
+our $inbuf = "";
+our $idle = 0;
+our $inscroll = 0;
+
+my $top;
+my $bot;
+my $lines;
+my $scr;
+my $cols;
+my $pagel;
+my $has_colors;
+our $pos;
+our $lth;
+my $sh;
+
+our $spos = $pos = $lth = 0;
+
+
+
+#$SIG{WINCH} = sub {@time = gettimeofday};
+
+$DXDebug::no_stdout = 1;
+
+# do the screen initialisation
+sub do_initscr
+{
+ $scr = new Curses;
+ 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);
+ eval { assume_default_colors($foreground, $background) } unless $is_win;
+ }
+
+ $top = $scr->subwin($lines-4, $cols, 0, 0);
+ $top->intrflush(0);
+ $top->scrollok(0);
+ $top->idlok(1);
+ $top->meta(1);
+ $top->leaveok(1);
+ $top->clrtobot();
+# $top->setscrreg(0, $lines-5);
+
+ $bot = $scr->subwin(3, $cols, $lines-3, 0);
+ $bot->intrflush(0);
+ $bot->scrollok(1);
+ $bot->keypad(1);
+ $bot->move(1,0);
+ $bot->meta(1);
+ $bot->nodelay(1);
+ $bot->clrtobot();
+ $scr->refresh();
+
+
+ $pagel = $lines-4;
+ $mycallcolor = COLOR_PAIR(1) unless $mycallcolor;
+}