+
+ (void)signal(SIGHUP, onsig);
+ (void)signal(SIGINT, onsig);
+ (void)signal(SIGQUIT, onsig);
+ (void)signal(SIGSTOP, onsig);
+ (void)signal(SIGTSTP, onsig);
+ (void)signal(SIGTERM, onsig);
+
+ tputs(tgetstr("ti", &tcp), 1, fputchar);
+ tputs(tgetstr("cl", &tcp), 1, fputchar);
+ if (field) {
+ register char *p = field;
+
+ for (y = bottom; --y >= 0;) {
+ for (x = CO; --x >= 0;) {
+ fputchar(*p++);
+ if (!*p)
+ p = field;
+ }
+ if (!Wrap)
+ fputchar('\n');
+ (void)fflush(stdout);
+ }
+ if (Wrap) {
+ if (IM && !IN) {
+ for (x = last; --x > 0;) {
+ fputchar(*p++);
+ if (!*p)
+ p = field;
+ }
+ y = *p++;
+ if (!*p)
+ p = field;
+ fputchar(*p);
+ if (BC)
+ tputs(BC, 1, fputchar);
+ else
+ cursor(last - 1, bottom);
+ tputs(IM, 1, fputchar);
+ if (IC)
+ tputs(IC, 1, fputchar);
+ fputchar(y);
+ if (IP)
+ tputs(IP, 1, fputchar);
+ tputs(EI, 1, fputchar);
+ }
+ else if (SR || AL) {
+ if (HO)
+ tputs(HO, 1, fputchar);
+ else
+ cursor(0, 0);
+ if (SR)
+ tputs(SR, 1, fputchar);
+ else
+ tputs(AL, LI, fputchar);
+ for (x = CO; --x >= 0;) {
+ fputchar(*p++);
+ if (!*p)
+ p = field;
+ }
+ }
+ else for (x = last; --x >= 0;) {
+ fputchar(*p++);
+ if (!*p)
+ p = field;
+ }
+ }
+ else for (x = CO; --x >= 0;) {
+ fputchar(*p++);
+ if (!*p)
+ p = field;
+ }