diff -c xterm.orig/VTPrsTbl.c xterm/VTPrsTbl.c *** xterm.orig/VTPrsTbl.c Wed May 29 22:06:16 1991 --- xterm/VTPrsTbl.c Wed May 19 16:36:45 1993 *************** *** 508,517 **** CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_DECSTBM, ! CASE_GROUND_STATE, /* t u v w */ CASE_GROUND_STATE, ! CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_GROUND_STATE, /* x y z { */ --- 508,517 ---- CASE_GROUND_STATE, CASE_GROUND_STATE, CASE_DECSTBM, ! CASE_DECSC, /* t u v w */ CASE_GROUND_STATE, ! CASE_DECRC, CASE_GROUND_STATE, CASE_GROUND_STATE, /* x y z { */ diff -c xterm.orig/XTerm.ad xterm/XTerm.ad *** xterm.orig/XTerm.ad Mon Nov 9 08:34:25 1992 --- xterm/XTerm.ad Wed May 19 16:36:45 1993 *************** *** 79,88 **** ! default colours for color_xterm *VT100*color0: black ! *VT100*color1: red ! *VT100*color2: green ! *VT100*color3: yellow ! *VT100*color4: blue ! *VT100*color5: magenta ! *VT100*color6: cyan ! *VT100*color7: white --- 79,98 ---- ! default colours for color_xterm *VT100*color0: black ! *VT100*color1: red4 ! *VT100*color2: green4 ! *VT100*color3: yellow4 ! *VT100*color4: blue4 ! *VT100*color5: magenta4 ! *VT100*color6: cyan4 ! *VT100*color7: gray55 ! *VT100*color8: gray30 ! *VT100*color9: red ! *VT100*color10: green ! *VT100*color11: yellow ! *VT100*color12: blue ! *VT100*color13: magenta ! *VT100*color14: cyan ! *VT100*color15: white ! *VT100*colorBD: white ! *VT100*colorUL: yellow diff -c xterm.orig/charproc.c xterm/charproc.c *** xterm.orig/charproc.c Mon Oct 19 14:02:13 1992 --- xterm/charproc.c Wed May 19 16:36:46 1993 *************** *** 99,104 **** --- 99,114 ---- #define XtNcolor5 "color5" #define XtNcolor6 "color6" #define XtNcolor7 "color7" + #define XtNcolor8 "color8" + #define XtNcolor9 "color9" + #define XtNcolor10 "color10" + #define XtNcolor11 "color11" + #define XtNcolor12 "color12" + #define XtNcolor13 "color13" + #define XtNcolor14 "color14" + #define XtNcolor15 "color15" + #define XtNcolorBD "colorBD" + #define XtNcolorUL "colorUL" #define XtNcutNewline "cutNewline" #define XtNcutToBeginningOfLine "cutToBeginningOfLine" #define XtNeightBitInput "eightBitInput" *************** *** 132,137 **** --- 142,148 ---- #define XtNtekSmall "tekSmall" #define XtNtekStartup "tekStartup" #define XtNtiteInhibit "titeInhibit" + #define XtNunderLine "underLine" #define XtNvisualBell "visualBell" #define XtNallowSendEvents "allowSendEvents" *************** *** 170,175 **** --- 181,187 ---- #define XtCTekSmall "TekSmall" #define XtCTekStartup "TekStartup" #define XtCTiteInhibit "TiteInhibit" + #define XtCUnderLine "UnderLine" #define XtCVisualBell "VisualBell" #define XtCAllowSendEvents "AllowSendEvents" *************** *** 379,384 **** --- 391,426 ---- {XtNcolor7, XtCForeground, XtRPixel, sizeof(Pixel), XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_7]), XtRString, "XtDefaultForeground"}, + {XtNcolor8, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_8]), + XtRString, "XtDefaultForeground"}, + {XtNcolor9, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_9]), + XtRString, "XtDefaultForeground"}, + {XtNcolor10, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_10]), + XtRString, "XtDefaultForeground"}, + {XtNcolor11, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_11]), + XtRString, "XtDefaultForeground"}, + {XtNcolor12, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_12]), + XtRString, "XtDefaultForeground"}, + {XtNcolor13, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_13]), + XtRString, "XtDefaultForeground"}, + {XtNcolor14, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_14]), + XtRString, "XtDefaultForeground"}, + {XtNcolor15, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_15]), + XtRString, "XtDefaultForeground"}, + {XtNcolorBD, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_BD]), + XtRString, "XtDefaultForeground"}, + {XtNcolorUL, XtCForeground, XtRPixel, sizeof(Pixel), + XtOffsetOf(XtermWidgetRec, screen.colors[COLOR_UL]), + XtRString, "XtDefaultForeground"}, {XtNeightBitInput, XtCEightBitInput, XtRBoolean, sizeof(Boolean), XtOffsetOf(XtermWidgetRec, screen.input_eight_bits), XtRBoolean, (caddr_t) &defaultTRUE}, *************** *** 484,489 **** --- 526,534 ---- {XtNtiteInhibit, XtCTiteInhibit, XtRBoolean, sizeof(Boolean), XtOffsetOf(XtermWidgetRec, misc.titeInhibit), XtRBoolean, (caddr_t) &defaultFALSE}, + {XtNunderLine, XtCUnderLine, XtRBoolean, sizeof(Boolean), + XtOffsetOf(XtermWidgetRec, screen.underline), + XtRBoolean, (caddr_t) &defaultFALSE}, {XtNvisualBell, XtCVisualBell, XtRBoolean, sizeof(Boolean), XtOffsetOf(XtermWidgetRec, screen.visualbell), XtRBoolean, (caddr_t) &defaultFALSE}, *************** *** 783,788 **** --- 828,834 ---- case 2: ClearScreen(screen); + CursorSet(screen, 0, 0, term->flags); break; } parsestate = groundtable; *************** *** 888,893 **** --- 934,947 ---- case 1: case 5: /* Blink, really. */ term->flags |= BOLD; + if (!(term->flags & FG_COLOR) || + (term->cur_foreground==COLOR_UL)) { + term->flags |= FG_COLOR; + term->cur_foreground = COLOR_BD; + } + else /* Set highlight bit */ + if (term->cur_foreground < 8) + term->cur_foreground |= 8; break; case 2: term->flags |= DIM; *************** *** 894,899 **** --- 948,957 ---- break; case 4: /* Underscore */ term->flags |= UNDERLINE; + if (!(term->flags & FG_COLOR)) { + term->flags |= FG_COLOR; + term->cur_foreground = COLOR_UL; + } break; case 7: term->flags |= INVERSE; *************** *** 908,913 **** --- 966,974 ---- case 37: term->flags |= FG_COLOR; term->cur_foreground = param[row] - 30; + /* Set highlight bit if bold on */ + if (term->flags & BOLD) + term->cur_foreground |= 8; break; case 40: case 41: *************** *** 1539,1545 **** XDrawString(screen->display, TextWindow(screen), currentGC,cx + 1, cy, str, len); ! if(fgs & UNDERLINE) XDrawLine(screen->display, TextWindow(screen), currentGC, cx, cy+1, cx + len * FontWidth(screen), cy+1); --- 1600,1606 ---- XDrawString(screen->display, TextWindow(screen), currentGC,cx + 1, cy, str, len); ! if((fgs & UNDERLINE) && screen->underline) XDrawLine(screen->display, TextWindow(screen), currentGC, cx, cy+1, cx + len * FontWidth(screen), cy+1); *************** *** 2266,2271 **** --- 2327,2333 ---- new->screen.scrolllines = request->screen.scrolllines; new->screen.scrollttyoutput = request->screen.scrollttyoutput; new->screen.scrollkey = request->screen.scrollkey; + new->screen.underline = request->screen.underline; new->screen.visualbell = request->screen.visualbell; new->screen.TekEmu = request->screen.TekEmu; new->misc.re_verse = request->misc.re_verse; *************** *** 2653,2659 **** if((flags & BOLD) && screen->enbolden) /* no bold font */ XDrawString(screen->display, TextWindow(screen), currentGC, x + 1, y, (char *) &c, 1); ! if(flags & UNDERLINE) XDrawLine(screen->display, TextWindow(screen), currentGC, x, y+1, x + FontWidth(screen), y+1); if (!screen->select && !screen->always_highlight) { --- 2715,2721 ---- if((flags & BOLD) && screen->enbolden) /* no bold font */ XDrawString(screen->display, TextWindow(screen), currentGC, x + 1, y, (char *) &c, 1); ! if((flags & UNDERLINE) && screen->underline) XDrawLine(screen->display, TextWindow(screen), currentGC, x, y+1, x + FontWidth(screen), y+1); if (!screen->select && !screen->always_highlight) { *************** *** 2674,2680 **** { register TScreen *screen = &term->screen; GC currentGC; ! register int x, y, flags; char c; Boolean in_selection; --- 2736,2743 ---- { register TScreen *screen = &term->screen; GC currentGC; ! register int x, y, flags, fg, bg; ! register Pixel fg_pix, bg_pix; char c; Boolean in_selection; *************** *** 2682,2687 **** --- 2745,2757 ---- return; c = screen->buf[y = 4 * screen->cursor_row][x = screen->cursor_col]; flags = screen->buf[y + 1][x]; + fg = screen->buf[y + 2][x]; + bg = screen->buf[y + 3][x]; + + fg_pix = (flags&FG_COLOR) ? + screen->colors[fg] : screen->foreground; + bg_pix = (flags&BG_COLOR) ? + screen->colors[bg] : term->core.background_pixel; if (screen->cursor_row > screen->endHRow || (screen->cursor_row == screen->endHRow && *************** *** 2700,2705 **** --- 2770,2779 ---- } else { currentGC = screen->reverseGC; } + + XSetForeground(screen->display, currentGC, bg_pix); + XSetBackground(screen->display, currentGC, fg_pix); + } else { if(flags & BOLD) { currentGC = screen->normalboldGC; *************** *** 2706,2711 **** --- 2780,2789 ---- } else { currentGC = screen->normalGC; } + + XSetForeground(screen->display, currentGC, fg_pix); + XSetBackground(screen->display, currentGC, bg_pix); + } if (c == 0) *************** *** 2719,2725 **** if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), currentGC, x + 1, y, &c, 1); ! if(flags & UNDERLINE) XDrawLine(screen->display, TextWindow(screen), currentGC, x, y+1, x + FontWidth(screen), y+1); screen->cursor_state = OFF; --- 2797,2803 ---- if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), currentGC, x + 1, y, &c, 1); ! if((flags & UNDERLINE) && screen->underline) XDrawLine(screen->display, TextWindow(screen), currentGC, x, y+1, x + FontWidth(screen), y+1); screen->cursor_state = OFF; diff -c xterm.orig/ptyx.h xterm/ptyx.h *** xterm.orig/ptyx.h Mon Oct 19 13:59:36 1992 --- xterm/ptyx.h Wed May 19 16:36:46 1993 *************** *** 225,231 **** /***====================================================================***/ ! #define MAXCOLORS 8 #define COLOR_0 0 #define COLOR_1 1 #define COLOR_2 2 --- 225,231 ---- /***====================================================================***/ ! #define MAXCOLORS 18 #define COLOR_0 0 #define COLOR_1 1 #define COLOR_2 2 *************** *** 234,239 **** --- 234,249 ---- #define COLOR_5 5 #define COLOR_6 6 #define COLOR_7 7 + #define COLOR_8 8 + #define COLOR_9 9 + #define COLOR_10 10 + #define COLOR_11 11 + #define COLOR_12 12 + #define COLOR_13 13 + #define COLOR_14 14 + #define COLOR_15 15 + #define COLOR_BD 16 + #define COLOR_UL 17 typedef struct { /* These parameters apply to both windows */ *************** *** 345,350 **** --- 355,361 ---- int refresh_amt; /* amount to refresh */ Boolean jumpscroll; /* whether we should jumpscroll */ Boolean always_highlight; /* whether to highlight cursor */ + Boolean underline; /* whether to underline text */ /* Tektronix window parameters */ GC TnormalGC; /* normal painting */ diff -c xterm.orig/screen.c xterm/screen.c *** xterm.orig/screen.c Mon Nov 9 16:47:03 1992 --- xterm/screen.c Wed May 19 16:36:46 1993 *************** *** 438,444 **** if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), gc, x + 1, y, (char *) &chars[lastind], n); ! if(flags & UNDERLINE) XDrawLine(screen->display, TextWindow(screen), gc, x, y+1, x+n*FontWidth(screen), y+1); --- 438,444 ---- if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), gc, x + 1, y, (char *) &chars[lastind], n); ! if((flags & UNDERLINE) && screen->underline) XDrawLine(screen->display, TextWindow(screen), gc, x, y+1, x+n*FontWidth(screen), y+1); *************** *** 500,506 **** if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), gc, x + 1, y, (char *) &chars[lastind], n); ! if(flags & UNDERLINE) XDrawLine(screen->display, TextWindow(screen), gc, x, y+1, x + n * FontWidth(screen), y+1); } --- 500,506 ---- if((flags & BOLD) && screen->enbolden) XDrawString(screen->display, TextWindow(screen), gc, x + 1, y, (char *) &chars[lastind], n); ! if((flags & UNDERLINE) && screen->underline) XDrawLine(screen->display, TextWindow(screen), gc, x, y+1, x + n * FontWidth(screen), y+1); }