diff --git a/app/xterm/MANIFEST b/app/xterm/MANIFEST index d4d4430a0..cd7b2643b 100644 --- a/app/xterm/MANIFEST +++ b/app/xterm/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for xterm-330, version xterm-330 +MANIFEST for xterm-331, version xterm-331 -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode @@ -202,3 +202,4 @@ vttests/resize.pl translated resize.sh to perl since it is easy to vttests/resize.sh script to demonstrate resizing vttests/tcapquery.pl script to test tcap-query option vttests/title.sh test-script to show title of xterm in action +vttests/true-color.pl test script for true color diff --git a/app/xterm/NEWS b/app/xterm/NEWS index 70226940a..d83323b54 100644 --- a/app/xterm/NEWS +++ b/app/xterm/NEWS @@ -1,38 +1,121 @@ The NEWS file was generated from xterm.log.html, which serves as the changelog for xterm. -------------------------------------------------------------------------------- - Patch #330 - 2017/06/20 + Patch #331 - 2017/12/30 - * updates for ReGIS (Ross Combs): - + remove redundant text command error check which broke T(B) and - T(E). - + retain the loading alphabet number across multiple “L” - commands. - + add S(T) delay handler. - + fix some color handling error messages. - + add stubbed-out macrograph handling. - + use fragment_remaining() and fragment_consumed() instead of - manually checking position / length in various places. - + rename some local variables in string / extent / option - parsing - + wrap some long lines. - + move macrograph command handling out of the top-level. - * add a summary of the italic fonts loaded to -report-fonts option. - * modify the font-lookup for italics to allow for “-i-” if no match - is found with slant “-o-” (prompted by patch by Ben Wong). - * change default values for mkSamplePass and mkSampleSize to reflect - generally-improved locale support in various operating systems - (FreeBSD #219800). - * modify wcwidth.c to return -1 for non-Unicode values, and adjust a - couple of blocks to better match assumptions about ambiguous-width - characters in other implementations. Also modify wcwidth.c to - support configurable soft-hyphen, so there is no drawback to using - this version rather than a system wcwidth. - * amend change made in patch #328 for cursor-visibility to handle - case where an application is updating the reverse-video state - (FreeBSD #219800). - * update tables of combining and ambiguous-width characters in - wcwidth.c based on Unicode 10.0.0. - * build-fix for --enable-sixel-graphics without - --enable-regis-graphics (reports by Sven Joachim, FreeBSD #219945). + * add workaround for improper grayscale adjustments made in FreeType + library, exposed by changes to rounding in 2.8.1, which shows up as + a gap in line-drawing characters (Debian #880407). + * improve a special case where a non-Unicode font's line-drawing + characters were not used, when specifying it via the utf8Fonts + resource, e.g., + + -fs 15 \ + -xrm '*VT100.font:12x24' \ + -xrm '*VT100.boldFont:12x24' \ + -xrm '*VT100.utf8Fonts.font: 12x24' \ + -xrm '*VT100.utf8Fonts.boldFont: 12x24' \ + + * replace constant 10msec delay for next X event with new resource + nextEventDelay, and reduce that to 1msec to accommodate faster + machines than used when -hold was implemented in 1999 (Debian + #877628). + * add scroll-to action, which simplifies binding a key to scroll to + the beginning or end of the saved-lines (Debian #880120). + * add building blocks for alternate screen and/or title-stack + features in the terminfo file. + * improve calculations for cell-data size. + * change configure script to enable XHTML/SVG screen dumps by + default. + * change configure script to enable 256-colors by default. + * update config.guess, config.sub + * change configure script option for --with-man2html to use improved + script by default. + * add case for private mode 1044 in DECRQM, to report the + keepClipboard resource setting and corresponding menu entry. + * fix an inconsistency between private mode 12 (the AT&T 610 cursor + blink) and DECSCUSR: the former relied on having the cursorBlink + resource set initially to enable the escape sequence, while the + latter does not. + * add private modes 13 and 14, as well as resource cursorBlinkXOR to + allow better control over the cursor-blinking state (discussion + with Bram Moolenaar). + * modify the html and svg screen dumps to support direct color + * modify media copy (screen-printing) to support the same SGR codes + as DECRQSS, including 88/256 indexed color as well as direct color. + * improve options-parsing for query-status.pl script. + * modify parsing of SGR direct-color control making color space + identitier optional. The corresponding DECRQSS reply always returns + an empty (default) field for the identifier. + * add wide-attributes to DECRQSS reply for SGR. + * add private mode 1046 to help with scripting applications. + * correct expression used for readline-flags in DECRQM; to test the + current flag rather than information stacked within the same + variable. + * correct typo in ctlseqs.ms reference to ISO-8613-6 (patch by Mike + Frysinger). + * fix lintian warning for test-package. + * fix typo in DECRQSS for SGR 48, which printed the foreground value + for colors past 15. Also use colon delimiter for codes 38/48 in + response (report by Paul LeoNerd Evans). + * improve workaround for Debian #542434 by using the font's maximum + width when no ISO-8859-1 glyphs are provided (Debian #879936). + * work around a special case of Xft's mismanagement of its cached + data by adding a check before the -report-fonts option to ensure + that it does not use an XftPattern which may have been freed during + a call to XftFontOpenPattern. + * improve manual page description of regex option for onXClicks + resources (report by Lukas Mai). + * add directColor resource. + * additional manpage macro cleanup (Brandon Robinson, Debian + #880551). + * add optional support for direct-colors (adapted from patch by + anonymous “Nibby Nebbulous”). + * improve legacy/NRC character set mapping (patch by Thomas Wolff): + + enable alternate NRC set designators for French and French + Canadian, ‘9’ and ‘f’ respectively, as documented in ctlseqs. + (‘9’ is documented for VT510, ‘f’ is a Kermit feature). + + correct the Unicode value in the DEC Technical table to show + capital delta. + + referring to + + http://vt100.net/docs/vt220-rm/table2-3b.html + http://vt100.net/docs/vt320-uu/appendixe.html + add entries for the DEC Supplemental Graphics table to display + 0x28/0xa8 as ¤ and 0x5d/0xdd as Ÿ. + + referring to + + http://www.vt100.net/charsets/technical.html + alter the Unicode values used for 0x2b through 0x2c to use + curly braces to work with the “middle” parts displayed with + 0x2f and 0x30. + + modify the VT220 “Supplemental” table, giving a hint that it + was probably meant to be “Supplemental Graphics” and is the + same as VT320's table. + * quiet a few font-warnings when a derived fontname cannot be opened, + overlooked in refactoring of font resources in patch #328 + (initially reported on Cygwin mailing list, with followup). + * correct error response for DECRQSS broken in cleanup of Coverity + reports in patch #288 (reports by Bram Moolenaar and IWAMOTO + Kouichi). + * improve DECRPM responses by returning mode not recognized for modes + which may not be settable due to the selected decTerminalID + resource (report by IWAMOTO Kouichi). + * correct logic for print-immediate action, and enable corresponding + menu entry (patch by Lauri Tirkkonen). + * add configure option --with-pcre2 (patch by David Michael). + * fix a misspelled subsection title in ctlseqs.ms and add a note + regarding blink which was rendered as bold in X11R6. Blinking text + was implemented in Patch #60. + * fix typos in xterm.man (patches by Sven Joachim, Larry Hynes). + * fix typography in xterm.man (patch by Bjarni Ingi Gislason, Debian + #869248). + * fix typo in INSTALL (Larry Hynes). + * add xterm-direct terminal description based on changes introduced + in patch #277, and relying upon ncurses RGB extension. + * modify xterm-new terminal description to use ECMA-48 REP, + reflecting its use in xterm since patch #32 (1996). + * clarify comment in ctlseqs.ms regarding blink: it has been part of + xterm since patch #60 (1998). + * update ftp URLs in documentation. diff --git a/app/xterm/VTPrsTbl.c b/app/xterm/VTPrsTbl.c index f9868c48b..33683203f 100644 --- a/app/xterm/VTPrsTbl.c +++ b/app/xterm/VTPrsTbl.c @@ -1,7 +1,7 @@ -/* $XTermId: VTPrsTbl.c,v 1.81 2015/02/16 01:51:51 tom Exp $ */ +/* $XTermId: VTPrsTbl.c,v 1.82 2017/11/07 23:03:12 Thomas.Wolff Exp $ */ /* - * Copyright 1999-2014,2015 by Thomas E. Dickey + * Copyright 1999-2015,2017 by Thomas E. Dickey * * All Rights Reserved * @@ -6000,7 +6000,7 @@ CASE_GSETS, CASE_GSETS, /* 8 9 : ; */ CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GSETS, CASE_GROUND_STATE, CASE_GROUND_STATE, /* < = > ? */ @@ -6056,7 +6056,7 @@ CASE_GROUND_STATE, /* d e f g */ CASE_GROUND_STATE, CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GSETS, CASE_GROUND_STATE, /* h i j k */ CASE_GROUND_STATE, @@ -6160,7 +6160,7 @@ CASE_GSETS, CASE_GSETS, /* cedilla onesuperior masculine guillemotright */ CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GSETS, CASE_GROUND_STATE, CASE_GROUND_STATE, /* onequarter onehalf threequarters questiondown */ @@ -6216,7 +6216,7 @@ CASE_GROUND_STATE, /* adiaeresis aring ae ccedilla */ CASE_GROUND_STATE, CASE_GROUND_STATE, -CASE_GROUND_STATE, +CASE_GSETS, CASE_GROUND_STATE, /* egrave eacute ecircumflex ediaeresis */ CASE_GROUND_STATE, diff --git a/app/xterm/button.c b/app/xterm/button.c index 43ef7b0e3..ac1f74205 100644 --- a/app/xterm/button.c +++ b/app/xterm/button.c @@ -1,4 +1,4 @@ -/* $XTermId: button.c,v 1.524 2017/05/30 08:58:29 tom Exp $ */ +/* $XTermId: button.c,v 1.526 2017/12/01 00:47:35 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -79,6 +79,9 @@ button.c Handles button events in the terminal emulator. #include #if OPT_SELECT_REGEX +#ifdef HAVE_PCRE2POSIX_H +#include +#else #ifdef HAVE_PCREPOSIX_H #include #else /* POSIX regex.h */ @@ -86,6 +89,7 @@ button.c Handles button events in the terminal emulator. #include #endif #endif +#endif #if OPT_WIDE_CHARS #include @@ -5142,7 +5146,7 @@ formatVideoAttrs(XtermWidget xw, char *buffer, CELL *cell) } #if OPT_ISO_COLORS if (attribs & FG_COLOR) { - unsigned fg = extract_fg(xw, ld->color[cell->col], attribs); + Pixel fg = extract_fg(xw, ld->color[cell->col], attribs); if (fg < 8) { fg += 30; } else if (fg < 16) { @@ -5151,11 +5155,11 @@ formatVideoAttrs(XtermWidget xw, char *buffer, CELL *cell) buffer += sprintf(buffer, "%s38;5", delim); delim = ";"; } - buffer += sprintf(buffer, "%s%u", delim, fg); + buffer += sprintf(buffer, "%s%lu", delim, fg); delim = ";"; } if (attribs & BG_COLOR) { - unsigned bg = extract_bg(xw, ld->color[cell->col], attribs); + Pixel bg = extract_bg(xw, ld->color[cell->col], attribs); if (bg < 8) { bg += 40; } else if (bg < 16) { @@ -5164,7 +5168,7 @@ formatVideoAttrs(XtermWidget xw, char *buffer, CELL *cell) buffer += sprintf(buffer, "%s48;5", delim); delim = ";"; } - (void) sprintf(buffer, "%s%u", delim, bg); + (void) sprintf(buffer, "%s%lu", delim, bg); } #endif } diff --git a/app/xterm/charproc.c b/app/xterm/charproc.c index 31cd8bc69..91c10b7ca 100644 --- a/app/xterm/charproc.c +++ b/app/xterm/charproc.c @@ -1,4 +1,4 @@ -/* $XTermId: charproc.c,v 1.1492 2017/06/19 08:34:54 tom Exp $ */ +/* $XTermId: charproc.c,v 1.1517 2017/12/28 18:43:58 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -168,12 +168,14 @@ static void restoremodes(XtermWidget /* xw */ ); static void savemodes(XtermWidget /* xw */ ); static void window_ops(XtermWidget /* xw */ ); -#define DoStartBlinking(s) ((s)->cursor_blink ^ (s)->cursor_blink_esc) - #if OPT_BLINK_CURS || OPT_BLINK_TEXT -#define UpdateCursorBlink(screen) SetCursorBlink(screen, screen->cursor_blink) +#define SettableCursorBlink(screen) \ + (((screen)->cursor_blink != cbAlways) && \ + ((screen)->cursor_blink != cbNever)) +#define UpdateCursorBlink(screen) \ + SetCursorBlink(screen, screen->cursor_blink) static void SetCursorBlink(TScreen * /* screen */ , - Bool /* enable */ ); + BlinkOps /* enable */ ); static void HandleBlinking(XtPointer /* closure */ , XtIntervalId * /* id */ ); static void StartBlinking(TScreen * /* screen */ ); @@ -260,6 +262,7 @@ static XtActionsRec actionsList[] = { { "redraw", HandleRedraw }, { "scroll-back", HandleScrollBack }, { "scroll-forw", HandleScrollForward }, + { "scroll-to", HandleScrollTo }, { "secure", HandleSecure }, { "select-cursor-end", HandleKeyboardSelectEnd }, { "select-cursor-extend", HandleKeyboardSelectExtend }, @@ -491,6 +494,7 @@ static XtResource xterm_resources[] = Ires(XtNprinterControlMode, XtCPrinterControlMode, SPS.printer_controlmode, 0), Ires(XtNtitleModes, XtCTitleModes, screen.title_modes, DEF_TITLE_MODES), + Ires(XtNnextEventDelay, XtCNextEventDelay, screen.nextEventDelay, 1), Ires(XtNvisualBellDelay, XtCVisualBellDelay, screen.visualBellDelay, 100), Ires(XtNsaveLines, XtCSaveLines, screen.savelines, SAVELINES), Ires(XtNscrollBarBorder, XtCScrollBarBorder, screen.scrollBarBorder, 1), @@ -556,7 +560,8 @@ static XtResource xterm_resources[] = #endif /* NO_ACTIVE_ICON */ #if OPT_BLINK_CURS - Bres(XtNcursorBlink, XtCCursorBlink, screen.cursor_blink, False), + Bres(XtNcursorBlinkXOR, XtCCursorBlinkXOR, screen.cursor_blink_xor, True), + Sres(XtNcursorBlink, XtCCursorBlink, screen.cursor_blink_s, "false"), #endif Bres(XtNcursorUnderLine, XtCCursorUnderLine, screen.cursor_underline, False), @@ -626,6 +631,9 @@ static XtResource xterm_resources[] = #if OPT_WIDE_ATTRS Bres(XtNcolorITMode, XtCColorAttrMode, screen.colorITMode, False), #endif +#if OPT_DIRECT_COLOR + Bres(XtNdirectColor, XtCDirectColor, screen.direct_color, True), +#endif COLOR_RES("0", screen.Acolors[COLOR_0], DFT_COLOR("black")), COLOR_RES("1", screen.Acolors[COLOR_1], DFT_COLOR("red3")), @@ -889,6 +897,7 @@ xtermAddInput(Widget w) { "string", HandleStringEvent }, { "scroll-back", HandleScrollBack }, { "scroll-forw", HandleScrollForward }, + { "scroll-to", HandleScrollTo }, { "select-cursor-end", HandleKeyboardSelectEnd }, { "select-cursor-extend", HandleKeyboardSelectExtend }, { "select-cursor-start", HandleKeyboardSelectStart }, @@ -990,7 +999,7 @@ SGR_Foreground(XtermWidget xw, int color) } else { UIntClr(xw->flags, FG_COLOR); } - fg = getXtermForeground(xw, xw->flags, color); + fg = getXtermFG(xw, xw->flags, color); xw->cur_foreground = color; setCgsFore(xw, WhichVWin(screen), gcNorm, fg); @@ -1035,7 +1044,7 @@ SGR_Background(XtermWidget xw, int color) } else { UIntClr(xw->flags, BG_COLOR); } - bg = getXtermBackground(xw, xw->flags, color); + bg = getXtermBG(xw, xw->flags, color); xw->cur_background = color; setCgsBack(xw, WhichVWin(screen), gcNorm, bg); @@ -1065,7 +1074,7 @@ setExtendedFG(XtermWidget xw) */ #if OPT_PC_COLORS /* XXXJTL should be settable at runtime (resource or OSC?) */ if (TScreenOf(xw)->boldColors - && (!xw->sgr_extended) + && (!hasDirectFG(xw->flags)) && (fg >= 0) && (fg < 8) && (xw->flags & BOLD)) @@ -1096,7 +1105,7 @@ static void reset_SGR_Foreground(XtermWidget xw) { xw->sgr_foreground = -1; - xw->sgr_extended = False; + clrDirectFG(xw->flags); setExtendedFG(xw); } @@ -1104,6 +1113,7 @@ static void reset_SGR_Background(XtermWidget xw) { xw->sgr_background = -1; + clrDirectBG(xw->flags); setExtendedBG(xw); } @@ -1657,7 +1667,7 @@ param_has_subparams(int item) if (parms.has_subparams) { int n = subparam_index(item, 0); if (n >= 0 && parms.is_sub[n]) { - while (n++ < nparam && parms.is_sub[n - 1] < parms.is_sub[n]) { + while (++n < nparam && parms.is_sub[n - 1] < parms.is_sub[n]) { result++; } } @@ -1666,7 +1676,7 @@ param_has_subparams(int item) return result; } -#if OPT_256_COLORS || OPT_88_COLORS || OPT_ISO_COLORS +#if OPT_DIRECT_COLOR || OPT_256_COLORS || OPT_88_COLORS || OPT_ISO_COLORS /* * Given an index into the parameter array, return the corresponding parameter * number (starting from zero). @@ -1731,13 +1741,28 @@ get_subparam(int p, int s) * This function accepts either format (per request by Paul Leonerd Evans). * It also accepts * CSI 38 : 5 : 1 m - * according to Lars' original assumption. + * according to Lars' original assumption. While implementing that, I added + * support for Konsole's interpretation of "CSI 38 : 2" as a 24-bit RGB value. + * ISO-8613-6 documents that as "direct color". * - * By the way - all of the parameters are decimal integers. + * At the time in 2012, no one noticed (or commented) regarding ISO-8613-6's + * quirk in the description of direct color: it mentions a color space + * identifier parameter which should follow the "2" (as parameter 1). In the + * same section, ISO-8613-6 mentions a parameter 6 which can be ignored, as + * well as parameters 7 and 8. Like parameter 1, parameters 7 and 8 are not + * defined clearly in the standard, and a close reading indicates they are + * optional, saying they "may be used". This implementation ignores parameters + * 6 (and above), and provides for the color space identifier by checking the + * number of parameters: + * 3 after "2" (no color space identifier) + * 4 or more after "2" (color space identifier) + * + * By the way - all of the parameters are decimal integers, and missing + * parameters represent a default value. ISO-8613-6 is clear about that. */ #define extended_colors_limit(n) ((n) == 5 ? 1 : ((n) == 2 ? 3 : 0)) static Boolean -parse_extended_colors(XtermWidget xw, int *colorp, int *itemp) +parse_extended_colors(XtermWidget xw, int *colorp, int *itemp, Boolean *extended) { Boolean result = False; int item = *itemp; @@ -1761,7 +1786,7 @@ parse_extended_colors(XtermWidget xw, int *colorp, int *itemp) need = extended_colors_limit(code); next = item + have; for (n = 0; n < need && n < 3; ++n) { - values[n] = get_subparam(base, 2 + n); + values[n] = get_subparam(base, 2 + n + (have > 4)); } } else if (++item < nparam) { ++base; @@ -1772,7 +1797,7 @@ parse_extended_colors(XtermWidget xw, int *colorp, int *itemp) need = extended_colors_limit(code); next = base + have; for (n = 0; n < need && n < 3; ++n) { - values[n] = get_subparam(base, 1 + n); + values[n] = get_subparam(base, 1 + n + (have > 3)); } } else { /* accept CSI 38 ; 5 ; 1 m */ @@ -1787,13 +1812,24 @@ parse_extended_colors(XtermWidget xw, int *colorp, int *itemp) } item = next; + *extended = False; switch (code) { case 2: /* direct color in rgb space */ if ((values[0] >= 0 && values[0] < 256) && (values[1] >= 0 && values[1] < 256) && (values[2] >= 0 && values[2] < 256)) { - *colorp = xtermClosestColor(xw, values[0], values[1], values[2]); +#if OPT_DIRECT_COLOR + if (TScreenOf(xw)->direct_color && xw->has_rgb) { + *colorp = getDirectColor(xw, values[0], values[1], values[2]); + result = True; + *extended = True; + } else +#endif + { + *colorp = xtermClosestColor(xw, values[0], values[1], values[2]); + result = okIndexedColor(*colorp); + } } else { *colorp = -1; } @@ -1801,13 +1837,13 @@ parse_extended_colors(XtermWidget xw, int *colorp, int *itemp) case 5: /* indexed color */ *colorp = values[0]; + result = okIndexedColor(*colorp); break; default: *colorp = -1; break; } - result = (*colorp >= 0 && *colorp < NUM_ANSI_COLORS); TRACE(("...resulting color %d/%d %s\n", *colorp, NUM_ANSI_COLORS, result ? "OK" : "ERR")); @@ -1929,6 +1965,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) int laststate; int thischar = -1; XTermRect myRect; + Boolean extended; do { #if OPT_WIDE_CHARS @@ -3013,7 +3050,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case 37: if_OPT_ISO_COLORS(screen, { xw->sgr_foreground = (op - 30); - xw->sgr_extended = False; + clrDirectFG(xw->flags); setExtendedFG(xw); }); break; @@ -3022,9 +3059,10 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) * properly eat all the parameters for unsupported modes. */ if_OPT_ISO_COLORS(screen, { - if (parse_extended_colors(xw, &value, &item)) { + if (parse_extended_colors(xw, &value, &item, + &extended)) { xw->sgr_foreground = value; - xw->sgr_extended = True; + setDirectFG(xw->flags, extended); setExtendedFG(xw); } }); @@ -3051,13 +3089,16 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case 47: if_OPT_ISO_COLORS(screen, { xw->sgr_background = (op - 40); + clrDirectBG(xw->flags); setExtendedBG(xw); }); break; case 48: if_OPT_ISO_COLORS(screen, { - if (parse_extended_colors(xw, &value, &item)) { + if (parse_extended_colors(xw, &value, &item, + &extended)) { xw->sgr_background = value; + setDirectBG(xw->flags, extended); setExtendedBG(xw); } }); @@ -3084,7 +3125,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case 97: if_OPT_AIX_COLORS(screen, { xw->sgr_foreground = (op - 90 + 8); - xw->sgr_extended = False; + clrDirectFG(xw->flags); setExtendedFG(xw); }); break; @@ -3111,6 +3152,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case 107: if_OPT_AIX_COLORS(screen, { xw->sgr_background = (op - 100 + 8); + clrDirectBG(xw->flags); setExtendedBG(xw); }); break; @@ -3438,7 +3480,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) TRACE(("CASE_DECSCUSR\n")); { Boolean change = True; - Boolean blinks = screen->cursor_blink_esc; + int blinks = screen->cursor_blink_esc; HideCursor(); @@ -4132,13 +4174,13 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_RQM: TRACE(("CASE_RQM\n")); - do_rpm(xw, ParamPair(0)); + do_ansi_rqm(xw, ParamPair(0)); ResetState(sp); break; case CASE_DECRQM: TRACE(("CASE_DECRQM\n")); - do_decrpm(xw, ParamPair(0)); + do_dec_rqm(xw, ParamPair(0)); ResetState(sp); break; @@ -4175,10 +4217,6 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_S8C1T: TRACE(("CASE_S8C1T\n")); if (screen->vtXX_level >= 2) { -#if OPT_VT52_MODE - if (screen->vtXX_level <= 1) - break; -#endif show_8bit_control(True); ResetState(sp); } @@ -5299,10 +5337,29 @@ HandleStructNotify(Widget w GCC_UNUSED, #endif /* HANDLE_STRUCT_NOTIFY */ #if OPT_BLINK_CURS -static void -SetCursorBlink(TScreen *screen, Bool enable) +static int +DoStartBlinking(TScreen *screen) { - screen->cursor_blink = (Boolean) enable; + int actual = ((screen->cursor_blink == cbTrue || + screen->cursor_blink == cbAlways) + ? 1 + : 0); + int wanted = screen->cursor_blink_esc ? 1 : 0; + int result; + if (screen->cursor_blink_xor) { + result = actual ^ wanted; + } else { + result = actual | wanted; + } + return result; +} + +static void +SetCursorBlink(TScreen *screen, BlinkOps enable) +{ + if (SettableCursorBlink(screen)) { + screen->cursor_blink = enable; + } if (DoStartBlinking(screen)) { StartBlinking(screen); } else { @@ -5319,7 +5376,11 @@ SetCursorBlink(TScreen *screen, Bool enable) void ToggleCursorBlink(TScreen *screen) { - SetCursorBlink(screen, (Bool) (!(screen->cursor_blink))); + if (screen->cursor_blink == cbTrue) { + SetCursorBlink(screen, cbFalse); + } else if (screen->cursor_blink == cbFalse) { + SetCursorBlink(screen, cbTrue); + } } #endif @@ -5479,12 +5540,18 @@ dpmodes(XtermWidget xw, BitFunc func) break; #endif #if OPT_BLINK_CURS - case srm_ATT610_BLINK: /* att610: Start/stop blinking cursor */ - if (screen->cursor_blink_res) { + case srm_ATT610_BLINK: /* AT&T 610: Start/stop blinking cursor */ + if (SettableCursorBlink(screen)) { set_bool_mode(screen->cursor_blink_esc); UpdateCursorBlink(screen); } break; + case srm_CURSOR_BLINK_OPS: + /* intentionally ignored (this is user-preference) */ + break; + case srm_XOR_CURSOR_BLINKS: + /* intentionally ignored (this is user-preference) */ + break; #endif case srm_DECPFF: /* print form feed */ set_bool_mode(PrinterOf(screen).printer_formfeed); @@ -5724,7 +5791,16 @@ dpmodes(XtermWidget xw, BitFunc func) set_bool_mode(screen->keepClipboard); update_keepClipboard(); break; - case srm_TITE_INHIBIT: + case srm_ALLOW_ALTBUF: + if (IsSM()) { + xw->misc.titeInhibit = False; + } else if (!xw->misc.titeInhibit) { + xw->misc.titeInhibit = True; + FromAlternate(xw); + } + update_titeInhibit(); + break; + case srm_SAVE_CURSOR: if (!xw->misc.titeInhibit) { if (IsSM()) CursorSave(xw); @@ -5858,11 +5934,17 @@ savemodes(XtermWidget xw) break; #endif #if OPT_BLINK_CURS - case srm_ATT610_BLINK: /* att610: Start/stop blinking cursor */ - if (screen->cursor_blink_res) { + case srm_ATT610_BLINK: /* AT&T 610: Start/stop blinking cursor */ + if (SettableCursorBlink(screen)) { DoSM(DP_CRS_BLINK, screen->cursor_blink_esc); } break; + case srm_CURSOR_BLINK_OPS: + /* intentionally ignored (this is user-preference) */ + break; + case srm_XOR_CURSOR_BLINKS: + /* intentionally ignored (this is user-preference) */ + break; #endif case srm_DECPFF: /* print form feed */ DoSM(DP_PRN_FORMFEED, PrinterOf(screen).printer_formfeed); @@ -5913,7 +5995,7 @@ savemodes(XtermWidget xw) case srm_OPT_ALTBUF: /* FALLTHRU */ case srm_ALTBUF: /* alternate buffer */ - DoSM(DP_X_ALTSCRN, screen->whichBuf); + DoSM(DP_X_ALTBUF, screen->whichBuf); break; case srm_DECNKM: DoSM(DP_DECKPAM, xw->keyboard.flags & MODE_DECKPAM); @@ -6020,7 +6102,10 @@ savemodes(XtermWidget xw) case srm_LEGACY_FKEYS: DoSM(DP_KEYBOARD_TYPE, xw->keyboard.type); break; - case srm_TITE_INHIBIT: + case srm_ALLOW_ALTBUF: + DoSM(DP_ALLOW_ALTBUF, xw->misc.titeInhibit); + break; + case srm_SAVE_CURSOR: if (!xw->misc.titeInhibit) { CursorSave(xw); } @@ -6143,11 +6228,17 @@ restoremodes(XtermWidget xw) #endif #if OPT_BLINK_CURS case srm_ATT610_BLINK: /* Start/stop blinking cursor */ - if (screen->cursor_blink_res) { + if (SettableCursorBlink(screen)) { DoRM(DP_CRS_BLINK, screen->cursor_blink_esc); UpdateCursorBlink(screen); } break; + case srm_CURSOR_BLINK_OPS: + /* intentionally ignored (this is user-preference) */ + break; + case srm_XOR_CURSOR_BLINKS: + /* intentionally ignored (this is user-preference) */ + break; #endif case srm_DECPFF: /* print form feed */ DoRM(DP_PRN_FORMFEED, PrinterOf(screen).printer_formfeed); @@ -6219,12 +6310,12 @@ restoremodes(XtermWidget xw) /* FALLTHRU */ case srm_ALTBUF: /* alternate buffer */ if (!xw->misc.titeInhibit) { - if (screen->save_modes[DP_X_ALTSCRN]) + if (screen->save_modes[DP_X_ALTBUF]) ToAlternate(xw, False); else FromAlternate(xw); /* update_altscreen done by ToAlt and FromAlt */ - } else if (screen->save_modes[DP_X_ALTSCRN]) { + } else if (screen->save_modes[DP_X_ALTBUF]) { do_ti_xtra_scroll(xw); } break; @@ -6277,7 +6368,13 @@ restoremodes(XtermWidget xw) case srm_URXVT_EXT_MODE_MOUSE: DoRM(DP_X_EXT_MOUSE, screen->extend_coords); break; - case srm_TITE_INHIBIT: + case srm_ALLOW_ALTBUF: + DoRM(DP_ALLOW_ALTBUF, xw->misc.titeInhibit); + if (xw->misc.titeInhibit) + FromAlternate(xw); + update_titeInhibit(); + break; + case srm_SAVE_CURSOR: if (!xw->misc.titeInhibit) { CursorRestore(xw); } @@ -7708,6 +7805,18 @@ VTInitialize(Widget wrequest, #define DftBg(name) isDefaultBackground(Kolor(name)) #define DATA_END { NULL, -1 } + +#if OPT_BLINK_CURS +#define DATA(name) { #name, cb##name } + static const FlagList tblBlinkOps[] = + { + DATA(Always) + ,DATA(Never) + ,DATA_END + }; +#undef DATA +#endif + #define DATA(name) { #name, ec##name } static const FlagList tblColorOps[] = { @@ -7946,18 +8055,21 @@ VTInitialize(Widget wrequest, init_Bres(screen.move_sgr_ok); #endif #if OPT_BLINK_CURS - init_Bres(screen.cursor_blink); + init_Sres(screen.cursor_blink_s); + wnew->screen.cursor_blink = + extendedBoolean(wnew->screen.cursor_blink_s, + tblBlinkOps, cbLAST); + init_Bres(screen.cursor_blink_xor); init_Ires(screen.blink_on); init_Ires(screen.blink_off); - screen->cursor_blink_res = screen->cursor_blink; #endif init_Bres(screen.cursor_underline); /* resources allow for underline or block, not (yet) bar */ InitCursorShape(screen, TScreenOf(request)); #if OPT_BLINK_CURS - TRACE(("cursor_shape:%d blinks:%s\n", + TRACE(("cursor_shape:%d blinks:%d\n", screen->cursor_shape, - BtoS(screen->cursor_blink))); + screen->cursor_blink)); #endif #if OPT_BLINK_TEXT init_Ires(screen.blink_as_bold); @@ -8020,7 +8132,11 @@ VTInitialize(Widget wrequest, screen->vtXX_level = (screen->terminal_id / 100); init_Ires(screen.title_modes); - wnew->screen.title_modes0 = wnew->screen.title_modes; + screen->title_modes0 = screen->title_modes; + + init_Ires(screen.nextEventDelay); + if (screen->nextEventDelay <= 0) + screen->nextEventDelay = 1; init_Bres(screen.visualbell); init_Bres(screen.flash_line); @@ -8323,6 +8439,9 @@ VTInitialize(Widget wrequest, #if OPT_WIDE_ATTRS init_Bres(screen.colorITMode); #endif +#if OPT_DIRECT_COLOR + init_Bres(screen.direct_color); +#endif #if OPT_COLOR_RES2 TRACE(("...will fake resources for color%d to color%d\n", @@ -8399,7 +8518,8 @@ VTInitialize(Widget wrequest, } wnew->sgr_foreground = -1; wnew->sgr_background = -1; - wnew->sgr_extended = False; + clrDirectFG(wnew->flags); + clrDirectFG(wnew->flags); #endif /* OPT_ISO_COLORS */ /* @@ -8909,6 +9029,8 @@ cleanupInputMethod(XtermWidget xw) TRACE(("freed screen->xim\n")); } } +#else +#define cleanupInputMethod(xw) /* nothing */ #endif static void @@ -8937,7 +9059,9 @@ VTDestroy(Widget w GCC_UNUSED) free(last->windowName); free(last); } +#ifndef NO_ACTIVE_ICON TRACE_FREE_LEAK(xw->misc.active_icon_s); +#endif #if OPT_ISO_COLORS TRACE_FREE_LEAK(screen->cmap_data); for (n = 0; n < MAXCOLORS; n++) { @@ -9024,6 +9148,13 @@ VTDestroy(Widget w GCC_UNUSED) } if (screen->renderDraw) XftDrawDestroy(screen->renderDraw); + { + ListXftFonts *p; + while ((p = screen->list_xft_fonts) != 0) { + screen->list_xft_fonts = p->next; + free(p); + } + } #endif /* free things allocated via init_Sres or Init_Sres2 */ @@ -9066,7 +9197,9 @@ VTDestroy(Widget w GCC_UNUSED) #if OPT_RENDERFONT TRACE_FREE_LEAK(xw->misc.default_xft.f_n); +#if OPT_WIDE_CHARS TRACE_FREE_LEAK(xw->misc.default_xft.f_w); +#endif TRACE_FREE_LEAK(xw->misc.render_font_s); #endif @@ -10100,6 +10233,7 @@ VTSetValues(Widget cur, * Given a font-slot and information about selection/reverse, find the * corresponding cached-GC slot. */ +#if OPT_WIDE_ATTRS static int reverseCgs(XtermWidget xw, unsigned attr_flags, Bool hilite, int font) { @@ -10159,6 +10293,7 @@ reverseCgs(XtermWidget xw, unsigned attr_flags, Bool hilite, int font) } return result; } +#endif #define setGC(code) set_at = __LINE__, currentCgs = code @@ -10180,7 +10315,7 @@ ShowCursor(void) TScreen *screen = TScreenOf(xw); IChar base; unsigned flags; - CellColor fg_bg = 0; + CellColor fg_bg = initCColor; GC currentGC; GC outlineGC; CgsEnum currentCgs = gcMAX; @@ -10284,8 +10419,8 @@ ShowCursor(void) fg_bg = ld->color[cursor_col]; }); - fg_pix = getXtermForeground(xw, flags, (int) extract_fg(xw, fg_bg, flags)); - bg_pix = getXtermBackground(xw, flags, (int) extract_bg(xw, fg_bg, flags)); + fg_pix = getXtermFG(xw, flags, (int) extract_fg(xw, fg_bg, flags)); + bg_pix = getXtermBG(xw, flags, (int) extract_bg(xw, fg_bg, flags)); /* * If we happen to have the same foreground/background colors, choose @@ -10570,7 +10705,7 @@ HideCursor(void) int x, y; IChar base; unsigned flags; - CellColor fg_bg = 0; + CellColor fg_bg; Bool in_selection; #if OPT_WIDE_CHARS int my_col = 0; @@ -10640,7 +10775,7 @@ HideCursor(void) #endif #endif #if OPT_ISO_COLORS - fg_bg = 0; + fg_bg = initCColor; #endif /* @@ -10922,9 +11057,9 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved) screen->cursor_set = ON; InitCursorShape(screen, screen); #if OPT_BLINK_CURS - TRACE(("cursor_shape:%d blinks:%s\n", + TRACE(("cursor_shape:%d blinks:%d\n", screen->cursor_shape, - BtoS(screen->cursor_blink))); + screen->cursor_blink)); #endif /* reset scrolling region */ diff --git a/app/xterm/charsets.c b/app/xterm/charsets.c index fbad58a0c..6f8063fbe 100644 --- a/app/xterm/charsets.c +++ b/app/xterm/charsets.c @@ -1,7 +1,7 @@ -/* $XTermId: charsets.c,v 1.67 2013/12/01 16:38:13 tom Exp $ */ +/* $XTermId: charsets.c,v 1.71 2017/11/08 01:39:21 tom Exp $ */ /* - * Copyright 1998-2011,2013 by Thomas E. Dickey + * Copyright 1998-2013,2017 by Thomas E. Dickey * * All Rights Reserved * @@ -212,40 +212,11 @@ * argument to be made that these mappings "use" UTF-8, even though there is * a hidden step in the terminal emulator which relies upon UTF-8. */ -#define map_SCS_DEC_Supp(code,dft) \ - switch (code) { \ - XXX(0x24, 0x2e2e); \ - XXX(0x26, 0x2e2e); \ - XXX(0x2c, 0x2e2e); \ - XXX(0x2d, 0x2e2e); \ - XXX(0x2e, 0x2e2e); \ - XXX(0x2f, 0x2e2e); \ - XXX(0x34, 0x2e2e); \ - XXX(0x38, 0x2e2e); \ - XXX(0x3e, 0x2e2e); \ - UNI(0x47, 0x2426); \ - MAP(0x48, 0xc7); \ - MAP(0x49, 0xc8); \ - MAP(0x4a, 0xc9); \ - MAP(0x4b, 0xca); \ - MAP(0x4c, 0xcb); \ - MAP(0x4d, 0xcc); \ - MAP(0x4e, 0xcd); \ - MAP(0x4f, 0xce); \ - XXX(0x50, 0x2e2e); \ - UNI(0x57, 0x0152); \ - XXX(0x5e, 0x2e2e); \ - XXX(0x70, 0x2e2e); \ - UNI(0x77, 0x0153); \ - MAP(0x7d, 0xff); \ - XXX(0x7e, 0x2e2e); \ - default: dft; break; \ - } - #define map_SCS_DEC_Supp_Graphic(code,dft) \ switch (code) { \ XXX(0x24, 0x2e2e); \ XXX(0x26, 0x2e2e); \ + MAP(0x28, 0xa4); \ XXX(0x2c, 0x2e2e); \ XXX(0x2d, 0x2e2e); \ XXX(0x2e, 0x2e2e); \ @@ -255,6 +226,7 @@ XXX(0x3e, 0x2e2e); \ XXX(0x50, 0x2e2e); \ UNI(0x57, 0x0152); \ + MAP(0x5d, 0x0178); \ XXX(0x5e, 0x2e2e); \ XXX(0x70, 0x2e2e); \ UNI(0x77, 0x0153); \ @@ -278,10 +250,10 @@ UNI(0x28, 0x23a3); /* LEFT SQUARE BRACKET LOWER CORNER Joins vertically to 02/06, 02/07. Doesn't join to its right. */ \ UNI(0x29, 0x23a4); /* RIGHT SQUARE BRACKET UPPER CORNER Joins vertically to 026, 02a. Doesn't join to its left. */ \ UNI(0x2a, 0x23a6); /* RIGHT SQUARE BRACKET LOWER CORNER Joins vertically to 026, 029. Doesn't join to its left. */ \ - UNI(0x2b, 0x239b); /* LEFT PARENTHESIS UPPER HOOK Joins vertically to 026, 02c, 02/15. Doesn't join to its right. */ \ - UNI(0x2c, 0x239d); /* LEFT PARENTHESIS LOWER HOOK Joins vertically to 026, 02b, 02/15. Doesn't join to its right. */ \ - UNI(0x2d, 0x239e); /* RIGHT PARENTHESIS UPPER HOOK Joins vertically to 026, 02e, 03/00. Doesn't join to its left. */ \ - UNI(0x2e, 0x23a0); /* RIGHT PARENTHESIS LOWER HOOK Joins vertically to 026, 02d, 03/00. Doesn't join to its left. */ \ + UNI(0x2b, 0x23a7); /* LEFT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02c, 02/15. Doesn't join to its right. */ \ + UNI(0x2c, 0x23a9); /* LEFT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02b, 02/15. Doesn't join to its right. */ \ + UNI(0x2d, 0x23ab); /* RIGHT CURLY BRACKET UPPER HOOK Joins vertically to 026, 02e, 03/00. Doesn't join to its left. */ \ + UNI(0x2e, 0x23ad); /* RIGHT CURLY BRACKET LOWER HOOK Joins vertically to 026, 02d, 03/00. Doesn't join to its left. */ \ UNI(0x2f, 0x23a8); /* LEFT CURLY BRACKET MIDDLE PIECE Joins vertically to 026, 02b, 02c. */ \ UNI(0x30, 0x23ac); /* RIGHT CURLY BRACKET MIDDLE PIECE Joins vertically to 02/06, 02d, 02e. */ \ XXX(0x31, 0x2426); /* Top Left Sigma. Joins to right with 02/03, 03/05. Joins diagonally below right with 03/03, 03/07. */ \ @@ -303,7 +275,7 @@ UNI(0x41, 0x221d); /* PROPORTIONAL TO */ \ UNI(0x42, 0x221e); /* INFINITY */ \ UNI(0x43, 0x00f7); /* DIVISION SIGN */ \ - UNI(0x44, 0x039a); /* GREEK CAPITAL DELTA */ \ + UNI(0x44, 0x0394); /* GREEK CAPITAL DELTA */ \ UNI(0x45, 0x2207); /* NABLA */ \ UNI(0x46, 0x03a6); /* GREEK CAPITAL LETTER PHI */ \ UNI(0x47, 0x0393); /* GREEK CAPITAL LETTER GAMMA */ \ @@ -408,7 +380,7 @@ xtermCharSetIn(TScreen *screen, unsigned code, int charset) break; case nrc_DEC_Supp: - map_SCS_DEC_Supp(code, code &= 0x7f); + map_SCS_DEC_Supp_Graphic(code, code &= 0x7f); break; case nrc_DEC_Supp_Graphic: @@ -587,7 +559,7 @@ xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, int leftset) break; case nrc_DEC_Supp: - map_SCS_DEC_Supp(chr = seven, chr |= 0x80); + map_SCS_DEC_Supp_Graphic(chr = seven, chr |= 0x80); break; case nrc_DEC_Supp_Graphic: diff --git a/app/xterm/configure.in b/app/xterm/configure.in index 3c3f170a0..08ab27d64 100644 --- a/app/xterm/configure.in +++ b/app/xterm/configure.in @@ -1,12 +1,12 @@ -dnl $XTermId: configure.in,v 1.345 2017/05/31 08:38:47 tom Exp $ +dnl $XTermId: configure.in,v 1.353 2017/12/25 12:36:41 tom Exp $ dnl dnl ----------------------------------------------------------------------------- dnl this file is part of xterm dnl dnl Copyright 1997-2016,2017 by Thomas E. Dickey -dnl +dnl dnl All Rights Reserved -dnl +dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the dnl "Software"), to deal in the Software without restriction, including @@ -14,10 +14,10 @@ dnl without limitation the rights to use, copy, modify, merge, publish, dnl distribute, sublicense, and/or sell copies of the Software, and to dnl permit persons to whom the Software is furnished to do so, subject to dnl the following conditions: -dnl +dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or substantial portions of the Software. -dnl +dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -25,7 +25,7 @@ dnl IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY dnl CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, dnl TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE dnl SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -dnl +dnl dnl Except as contained in this notice, the name(s) of the above copyright dnl holders shall not be used in advertising or otherwise to promote the dnl sale, use or other dealings in this Software without prior written @@ -439,27 +439,42 @@ if test "$enable_ansi_color" = yes ; then test "$enable_16_color" = no && AC_DEFINE(OPT_AIX_COLORS,0,[Define to 0 to disable 16-color support]) AC_MSG_CHECKING(if you want 256 colors) - CF_ARG_ENABLE(256-color, - [ --enable-256-color enable 256-color support], - [enable_256_color=yes], - [enable_256_color=no]) + CF_ARG_DISABLE(256-color, + [ --disable-256-color disable 256-color support], + [enable_256_color=no], + [enable_256_color=yes]) AC_MSG_RESULT($enable_256_color) + if test "$enable_256_color" = yes ; then + CHARPROC_DEPS="$CHARPROC_DEPS 256colres.h" EXTRAHDRS="$EXTRAHDRS 256colres.h" AC_DEFINE(OPT_256_COLORS,1,[Define to 1 to enable 256-color support]) + + AC_MSG_CHECKING(if you want direct-color support) + CF_ARG_DISABLE(direct-color, + [ --disable-direct-color disable direct-color support], + [enable_direct_color=no], + [enable_direct_color=yes]) + AC_MSG_RESULT($enable_direct_color) + if test "$enable_direct_color" = yes ; then + AC_DEFINE(OPT_DIRECT_COLOR,1,[Define to 1 to enable direct-color support]) + fi + else - AC_MSG_CHECKING(if you want 88 colors) - CF_ARG_ENABLE(88-color, - [ --enable-88-color enable 88-color support], - [enable_88_color=yes], - [enable_88_color=no]) - AC_MSG_RESULT($enable_88_color) - if test "$enable_88_color" = yes ; then - CHARPROC_DEPS="$CHARPROC_DEPS 88colres.h" - EXTRAHDRS="$EXTRAHDRS 88colres.h" - AC_DEFINE(OPT_88_COLORS,1,[Define to 1 to enable 88-color support]) - fi + + AC_MSG_CHECKING(if you want 88 colors) + CF_ARG_DISABLE(88-color, + [ --disable-88-color disable 88-color support], + [enable_88_color=no], + [enable_88_color=yes]) + AC_MSG_RESULT($enable_88_color) + if test "$enable_88_color" = yes ; then + CHARPROC_DEPS="$CHARPROC_DEPS 88colres.h" + EXTRAHDRS="$EXTRAHDRS 88colres.h" + AC_DEFINE(OPT_88_COLORS,1,[Define to 1 to enable 88-color support]) + fi + fi fi @@ -596,7 +611,7 @@ if test "$enable_double_bfr" = yes ; then (*Xext*) ;; (*) - CF_X_EXT + CF_X_EXT ;; esac AC_DEFINE(OPT_DOUBLE_BUFFER,1,[Define to 1 to enable double-buffering]) @@ -774,11 +789,14 @@ CF_ARG_DISABLE(regex, [enable_regex=yes]) AC_MSG_RESULT($enable_regex) if test "$enable_regex" = yes ; then - CF_WITH_PCRE - if test "$with_pcre" = no ; then - CF_REGEX - if test "X$cf_cv_regex_hdrs" != "Xregex.h" ; then - AC_MSG_ERROR(Only POSIX or PCRE regular expressions are supported) + CF_WITH_PCRE2 + if test "$with_pcre2" = no ; then + CF_WITH_PCRE + if test "$with_pcre" = no ; then + CF_REGEX + if test "X$cf_cv_regex_hdrs" != "Xregex.h" ; then + AC_MSG_ERROR([Only POSIX, PCRE, or PCRE2 regular expressions are supported]) + fi fi fi AC_DEFINE(OPT_SELECT_REGEX,1,[Define to 1 to enable regular-expression selections]) @@ -873,6 +891,11 @@ CF_ARG_DISABLE(wide-attrs, [enable_wattr=yes]) AC_MSG_RESULT($enable_wattr) +if test $enable_wattr = no && test $enable_direct_color = yes ; then + AC_MSG_WARN(overriding wide-attributes to support direct color) + enable_wattr=yes +fi + AC_MSG_CHECKING(if you want wide-character support) CF_ARG_DISABLE(wide-chars, [ --disable-wide-chars disable wide-character support], @@ -943,10 +966,10 @@ if test "$enable_dec_locator" = yes ; then fi AC_MSG_CHECKING(if you want XHTML and SVG screen dump support) -CF_ARG_ENABLE(screen-dumps, - [ --enable-screen-dumps enable XHTML and SVG screen dumps], - [enable_screen_dumps=yes], - [enable_screen_dumps=no]) +CF_ARG_DISABLE(screen-dumps, + [ --disable-screen-dumps disable XHTML and SVG screen dumps], + [enable_screen_dumps=no], + [enable_screen_dumps=yes]) AC_MSG_RESULT($enable_screen_dumps) if test "$enable_screen_dumps" = yes ; then AC_DEFINE(OPT_SCREEN_DUMPS,1,[Define to 1 to enable XHTML and SVG screen dump support]) @@ -1054,7 +1077,7 @@ AC_MSG_RESULT($with_warnings) if test "$with_warnings" = yes then CF_GCC_ATTRIBUTES - CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum) + CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum Wno-cast-qual) fi fi diff --git a/app/xterm/ctlseqs.ms b/app/xterm/ctlseqs.ms index 55e9ad3c8..4210f8394 100644 --- a/app/xterm/ctlseqs.ms +++ b/app/xterm/ctlseqs.ms @@ -1,6 +1,6 @@ .\"#! troff -ms $1 -*- Nroff -*- .\" "Xterm Control Sequences" document -.\" $XTermId: ctlseqs.ms,v 1.345 2017/06/12 00:34:43 tom Exp $ +.\" $XTermId: ctlseqs.ms,v 1.366 2017/12/23 00:02:27 tom Exp $ .\" .\" .\" Copyright 1996-2016,2017 by Thomas E. Dickey @@ -69,8 +69,8 @@ .\" .ds XT XTerm .ds xt xterm -.ds LF Patch #329 -.ds RF 2017/06/11 +.ds LF Patch #331 +.ds RF 2017/12/22 .\" .if n .pl 9999v \" no page breaks in nroff .ND @@ -88,7 +88,8 @@ .. .\" Bulleted paragraph .de bP -.IP \(bu 0.2i +.ie n .IP \(bu 4 +.el .IP \(bu 2 .. .\" Normal leading paragraph .de lP @@ -507,11 +508,11 @@ Line Feed or New Line (NL). (\*(Lf is Ctrl-J). . .IP \\*(Si -Shift In (Ctrl-O) \(-> Switch to Standard Character Set. This invokes the +Shift In (Ctrl-O) \(-> Switch to \fIStandard Character Set\fP. This invokes the G0 character set (the default). . .IP \\*(So -Shift Out (Ctrl-N) \(-> Switch to Alternate Character Set. This invokes the +Shift Out (Ctrl-N) \(-> Switch to \fIAlternate Character Set\fP. This invokes the G1 character set. . .IP \\*(Sp @@ -988,7 +989,9 @@ and set VT100 mode. \*(Ps = \*9 \(-> Send Mouse X & Y on button press. See the section \fBMouse Tracking\fP. This is the X10 xterm mouse protocol. \*(Ps = \*1\*0 \(-> Show toolbar (rxvt). - \*(Ps = \*1\*2 \(-> Start Blinking Cursor (att610). + \*(Ps = \*1\*2 \(-> Start Blinking Cursor (AT&T 610). + \*(Ps = \*1\*3 \(-> Start Blinking Cursor (set only via resource or menu). + \*(Ps = \*1\*4 \(-> Enable XOR of Blinking Cursor control sequence and menu. \*(Ps = \*1\*8 \(-> Print form feed (DECPFF). \*(Ps = \*1\*9 \(-> Set print extent to full screen (DECPEX). \*(Ps = \*2\*5 \(-> Show Cursor (DECTCEM). @@ -996,13 +999,13 @@ See the section \fBMouse Tracking\fP. This is the X10 xterm mouse protocol. \*(Ps = \*3\*5 \(-> Enable font-shifting functions (rxvt). \*(Ps = \*3\*8 \(-> Enter Tektronix Mode (DECTEK). \*(Ps = \*4\*0 \(-> Allow 80 \z\(<-\(-> 132 Mode. - \*(Ps = \*4\*1 \(-> \fImore\fP(1) fix (see \fBcurses\fP resource). + \*(Ps = \*4\*1 \(-> \fBmore\fP(1) fix (see \fBcurses\fP(3) resource). \*(Ps = \*4\*2 \(-> Enable National Replacement Character sets (DECNRCM). \*(Ps = \*4\*4 \(-> Turn On Margin Bell. \*(Ps = \*4\*5 \(-> Reverse-wraparound Mode. \*(Ps = \*4\*6 \(-> Start Logging. This is normally disabled by a compile-time option. - \*(Ps = \*4\*7 \(-> Use Alternate Screen Buffer. + \*(Ps = \*4\*7 \(-> Use \fIAlternate Screen Buffer\fP. (This may be disabled by the \fBtiteInhibit\fP resource). \*(Ps = \*6\*6 \(-> Application keypad (DECNKM). \*(Ps = \*6\*7 \(-> Backarrow key sends backspace (DECBKM). @@ -1016,7 +1019,7 @@ See the section \fBMouse Tracking\fP. This is the X11 xterm mouse protocol. \*(Ps = \*1\*0\*0\*4 \(-> Send FocusIn/FocusOut events. \*(Ps = \*1\*0\*0\*5 \(-> Enable UTF-8 Mouse Mode. \*(Ps = \*1\*0\*0\*6 \(-> Enable SGR Mouse Mode. - \*(Ps = \*1\*0\*0\*7 \(-> Enable Alternate Scroll Mode, i.e., the \fBalternateScroll\fP resource. + \*(Ps = \*1\*0\*0\*7 \(-> Enable \fIAlternate Scroll Mode\fP, i.e., the \fBalternateScroll\fP resource. \*(Ps = \*1\*0\*1\*0 \(-> Scroll to bottom on tty output (rxvt). \*(Ps = \*1\*0\*1\*1 \(-> Scroll to bottom on key press (rxvt). \*(Ps = \*1\*0\*1\*5 \(-> Enable urxvt Mouse Mode. @@ -1039,12 +1042,14 @@ See the section \fBMouse Tracking\fP. This is the X11 xterm mouse protocol. (enables the \fBpopOnBell\fP resource). \*(Ps = \*1\*0\*4\*4 \(-> Reuse the most recent data copied to CLIPBOARD. (This enables the \fBkeepClipboard\fP resource). - \*(Ps = \*1\*0\*4\*7 \(-> Use Alternate Screen Buffer. (This may be + \*(Ps = \*1\*0\*4\*6 \(-> Enable switching to/from \fIAlternate Screen Buffer\fP. +This works for terminfo-based systems, updating the \fBtiteInhibit\fP resource. + \*(Ps = \*1\*0\*4\*7 \(-> Use \fIAlternate Screen Buffer\fP. (This may be disabled by the \fBtiteInhibit\fP resource). \*(Ps = \*1\*0\*4\*8 \(-> Save cursor as in DECSC. (This may be disabled by the \fBtiteInhibit\fP resource). \*(Ps = \*1\*0\*4\*9 \(-> Save cursor as in DECSC -and use Alternate Screen Buffer, clearing it first. (This may be +and use \fIAlternate Screen Buffer\fP, clearing it first. (This may be disabled by the \fBtiteInhibit\fP resource). This combines the effects of the \*1\*0\*4\*7 and \*1\*0\*4\*8 modes. Use this with terminfo-based applications rather than the \*4\*7 mode. @@ -1052,7 +1057,7 @@ Use this with terminfo-based applications rather than the \*4\*7 mode. \*(Ps = \*1\*0\*5\*1 \(-> Set Sun function-key mode. \*(Ps = \*1\*0\*5\*2 \(-> Set HP function-key mode. \*(Ps = \*1\*0\*5\*3 \(-> Set SCO function-key mode. - \*(Ps = \*1\*0\*6\*0 \(-> Set legacy keyboard emulation (X11R6). + \*(Ps = \*1\*0\*6\*0 \(-> Set legacy keyboard emulation (i.e, X11R6). \*(Ps = \*1\*0\*6\*1 \(-> Set VT220 keyboard emulation. \*(Ps = \*2\*0\*0\*4 \(-> Set bracketed paste mode. . @@ -1091,14 +1096,16 @@ DEC Private Mode Reset (DECRST). \*(Ps = \*8 \(-> No Auto-repeat Keys (DECARM). \*(Ps = \*9 \(-> Don't send Mouse X & Y on button press. \*(Ps = \*1\*0 \(-> Hide toolbar (rxvt). - \*(Ps = \*1\*2 \(-> Stop Blinking Cursor (att610). + \*(Ps = \*1\*2 \(-> Stop Blinking Cursor (AT&T 610). + \*(Ps = \*1\*3 \(-> Disable Blinking Cursor (reset only via resource or menu). + \*(Ps = \*1\*4 \(-> Disable XOR of Blinking Cursor control sequence and menu. \*(Ps = \*1\*8 \(-> Don't print form feed (DECPFF). \*(Ps = \*1\*9 \(-> Limit print to scrolling region (DECPEX). \*(Ps = \*2\*5 \(-> Hide Cursor (DECTCEM). \*(Ps = \*3\*0 \(-> Don't show scrollbar (rxvt). \*(Ps = \*3\*5 \(-> Disable font-shifting functions (rxvt). \*(Ps = \*4\*0 \(-> Disallow 80 \z\(<-\(-> 132 Mode. - \*(Ps = \*4\*1 \(-> No \fImore\fP(1) fix (see \fBcurses\fP resource). + \*(Ps = \*4\*1 \(-> No \fBmore\fP(1) fix (see \fBcurses\fP(3) resource). \*(Ps = \*4\*2 \(-> Disable National Replacement Character sets (DECNRCM). \*(Ps = \*4\*4 \(-> Turn Off Margin Bell. \*(Ps = \*4\*5 \(-> No Reverse-wraparound Mode. @@ -1118,7 +1125,7 @@ See the section \fBMouse Tracking\fP. \*(Ps = \*1\*0\*0\*4 \(-> Don't send FocusIn/FocusOut events. \*(Ps = \*1\*0\*0\*5 \(-> Disable UTF-8 Mouse Mode. \*(Ps = \*1\*0\*0\*6 \(-> Disable SGR Mouse Mode. - \*(Ps = \*1\*0\*0\*7 \(-> Disable Alternate Scroll Mode, i.e., the \fBalternateScroll\fP resource. + \*(Ps = \*1\*0\*0\*7 \(-> Disable \fIAlternate Scroll Mode\fP, i.e., the \fBalternateScroll\fP resource. \*(Ps = \*1\*0\*1\*0 \(-> Don't scroll to bottom on tty output (rxvt). \*(Ps = \*1\*0\*1\*1 \(-> Don't scroll to bottom on key press (rxvt). \*(Ps = \*1\*0\*1\*5 \(-> Disable urxvt Mouse Mode. @@ -1139,8 +1146,12 @@ See the section \fBMouse Tracking\fP. (This disables the \fBbellIsUrgent\fP resource). \*(Ps = \*1\*0\*4\*3 \(-> Disable raising of the window when Control-G is received. (This disables the \fBpopOnBell\fP resource). + \*(Ps = \*1\*0\*4\*6 \(-> Disable switching to/from \fIAlternate Screen Buffer\fP. +This works for terminfo-based systems, updating the \fBtiteInhibit\fP resource. +If currently using the \fIAlternate Screen Buffer\fP, +\fIxterm\fP switches to the Normal Screen Buffer. \*(Ps = \*1\*0\*4\*7 \(-> Use Normal Screen Buffer, clearing screen -first if in the Alternate Screen. (This may be +first if in the \fIAlternate Screen Buffer\fP. (This may be disabled by the \fBtiteInhibit\fP resource). \*(Ps = \*1\*0\*4\*8 \(-> Restore cursor as in DECRC. (This may be disabled by the \fBtiteInhibit\fP resource). @@ -1152,7 +1163,7 @@ Use this with terminfo-based applications rather than the \*4\*7 mode. \*(Ps = \*1\*0\*5\*1 \(-> Reset Sun function-key mode. \*(Ps = \*1\*0\*5\*2 \(-> Reset HP function-key mode. \*(Ps = \*1\*0\*5\*3 \(-> Reset SCO function-key mode. - \*(Ps = \*1\*0\*6\*0 \(-> Reset legacy keyboard emulation (X11R6). + \*(Ps = \*1\*0\*6\*0 \(-> Reset legacy keyboard emulation (i.e, X11R6). \*(Ps = \*1\*0\*6\*1 \(-> Reset keyboard emulation to Sun/PC style. \*(Ps = \*2\*0\*0\*4 \(-> Reset bracketed paste mode. . @@ -1163,7 +1174,7 @@ Character Attributes (SGR). \*(Ps = \*2 \(-> Faint, decreased intensity (ISO 6429). \*(Ps = \*3 \(-> Italicized (ISO 6429). \*(Ps = \*4 \(-> Underlined. - \*(Ps = \*5 \(-> Blink (appears as Bold). + \*(Ps = \*5 \(-> Blink (appears as Bold in X11R6 xterm). \*(Ps = \*7 \(-> Inverse. \*(Ps = \*8 \(-> Invisible, i.e., hidden (VT300). \*(Ps = \*9 \(-> Crossed-out characters (ISO 6429). @@ -1227,17 +1238,29 @@ All parameters are decimal integers. .bP RGB values range from zero (0) to 255. .bP -ISO-8613-3 can be interpreted in more than one way; -\fIxterm\fP allows the semicolons in this control to be replaced by colons +ISO-8613-6 has been interpreted in more than one way; +\fIxterm\fP allows the semicolons separating the subparameters +in this control to be replaced by colons (but after the first colon, colons must be used). .RE .sP -These ISO-8613-3 controls are supported: - \*(Pm = \*3\*8\*;\*2\*;\*(Pr\*;\*(Pg\*;\*(Pb \(-> Set foreground color to the closest match in \fIxterm\fP's palette for the given RGB \*(Pr/\*(Pg/\*(Pb. +These ISO-8613-6 controls are supported: + \*(Pm = \*3\*8\*;\*2\*;\*(Pi\*;\*(Pr\*;\*(Pg\*;\*(Pb \(-> Set foreground color to the closest match in \fIxterm\fP's palette for the given RGB \*(Pr/\*(Pg/\*(Pb. +The color space identifier \*(Pi is ignored. \*(Pm = \*3\*8\*;\*5\*;\*(Ps \(-> Set foreground color to \*(Ps. - \*(Pm = \*4\*8\*;\*2\*;\*(Pr\*;\*(Pg\*;\*(Pb \(-> Set background color to the closest match in \fIxterm\fP's palette for the given RGB \*(Pr/\*(Pg/\*(Pb. + \*(Pm = \*4\*8\*;\*2\*;\*(Pi\*;\*(Pr\*;\*(Pg\*;\*(Pb \(-> Set background color to the closest match in \fIxterm\fP's palette for the given RGB \*(Pr/\*(Pg/\*(Pb. +The color space identifier \*(Pi is ignored. \*(Pm = \*4\*8\*;\*5\*;\*(Ps \(-> Set background color to \*(Ps. .sp +This variation on ISO-8613-6 is supported for compatibility with KDE konsole: + \*(Pm = \*3\*8\*;\*2\*;\*(Pr\*;\*(Pg\*;\*(Pb \(-> Set foreground color to the closest match in \fIxterm\fP's palette for the given RGB \*(Pr/\*(Pg/\*(Pb. + \*(Pm = \*4\*8\*;\*2\*;\*(Pr\*;\*(Pg\*;\*(Pb \(-> Set background color to the closest match in \fIxterm\fP's palette for the given RGB \*(Pr/\*(Pg/\*(Pb. +.sp +If \fIxterm\fP is compiled with direct-color support, +and the resource \fBdirectColor\fP is true, then +rather than choosing the closest match, +\fIxterm\fP asks the X server to directly render a given color. +.sP . .IP \\*(Cs\\*>\\*(Ps\\*;\\*(Ps\\*s\\*m Set or reset resource-values used by \fIxterm\fP to decide whether to @@ -1324,7 +1347,7 @@ The last two parameters apply to VT400 & up, and denote keyboard ready and LK01 \*(Cs\*?\*5\*7\*;\*1\*n Mouse, if compiled-in, or \*(Cs\*?\*5\*7\*;\*0\*n Cannot identify, if not. \*(Ps = \*6\*2 \(-> Report macro space (DECMSR) as -\*(Cs\*(Pn\*s\\*\*s\*{. +\*(Cs\*(Pn\*s\**\*s\*{. \*(Ps = \*6\*3 \(-> Report memory checksum (DECCKSR) as \*(Dc\*(Pt\*s\*!x\*sx\*sx\*sx\*s\*(ST. .br @@ -1369,7 +1392,7 @@ For VT300 and up, reply is .br \*(Cs\*(Ps\*;\*(Pm\*$\*y .br -where \*(Ps is the mode number as in RM, +where \*(Ps is the mode number as in SM/RM, and \*(Pm is the mode value: .br 0 - not recognized @@ -1384,8 +1407,12 @@ For VT300 and up, reply is .br \*(Cs\*?\*(Ps\*;\*(Pm\*$\*y .br -where \*(Ps is the mode number as in DECSET, +where \*(Ps is the mode number as in DECSET/DECSET, \*(Pm is the mode value as in the ANSI DECRQM. +.br +Two private modes are read-only (i.e., \*1\*3 and \*1\*4), +provided only for reporting their values using this control sequence. +They correspond to the resources \fBcursorBlink\fP and \fBcursorBlinkXOR\fP. . .IP \\*(Cs\\*(Ps\\*s\\*q Load LEDs (DECLL). @@ -1428,7 +1455,7 @@ Change Attributes in Rectangular Area (DECCARA), VT400 and up. \*(Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7. . .IP \\*(Cs\\*(cs -Save cursor (ANSI.SYS), available only when DECLRMM is disabled. +Save cursor, available only when DECLRMM is disabled (SCOSC, also ANSI.SYS). . .IP \\*(Cs\\*(Pl\\*;\\*(Pr\\*s\\*(cs Set left and right margins (DECSLRM), available only when DECLRMM is enabled (VT420 and up). @@ -1516,7 +1543,7 @@ Reverse Attributes in Rectangular Area (DECRARA), VT400 and up. \*(Ps denotes the attributes to reverse, i.e., 1, 4, 5, 7. . .IP \\*(Cs\\*u -Restore cursor (ANSI.SYS). +Restore cursor (SCORC, also ANSI.SYS). . .IP \\*(Cs\\*(Ps\\*s\\*(Sp\\*u Set margin-bell volume (DECSMBV, VT520). @@ -2234,11 +2261,11 @@ See the xterm-hp terminfo entry for details. .Sh "The Alternate Screen Buffer" .LP \fIXterm\fP maintains two screen buffers. -The normal screen buffer allows you to scroll back to view saved lines +The Normal Screen Buffer allows you to scroll back to view saved lines of output up to the maximum set by the \fBsaveLines\fP resource. -The alternate screen buffer is exactly as large as the display, +The \fIAlternate Screen Buffer\fP is exactly as large as the display, contains no additional saved lines. -When the alternate screen buffer is active, +When the \fIAlternate Screen Buffer\fP is active, you cannot scroll back to view saved lines. \fIXterm\fP provides control sequences and menu entries for switching between the two. @@ -2254,12 +2281,12 @@ terminfo does not provide the whole text of the termcap data in one piece. It would not work for terminfo anyway, since terminfo data is not passed in environment variables; setting an environment variable in this manner would have no effect on -the application's ability to switch between normal and alternate screen -buffers. +the application's ability to switch +between \fINormal\fP and \fIAlternate Screen\fP buffers. Instead, the newer private mode controls (such as \*1\*0\*4\*9) -for switching between normal -and alternate screen buffers simply disable the switching. +for switching between \fINormal\fP +and \fIAlternate Screen\fP buffers simply disable the switching. They add other features such as clearing the display for the same reason: to make the details of switching independent of the application that requests the switch. @@ -2371,7 +2398,7 @@ For example, \*! specifies the value 1. The upper left character position on the terminal is denoted as 1,1. This scheme dates back to X10, though the normal mouse-tracking (from X11) is more elaborate. -.Ss X10 compatbility mode +.Ss X10 compatibility mode .lP X10 compatibility mode sends an escape sequence only on button press, encoding the location and the mouse button pressed. @@ -2401,7 +2428,7 @@ Note however that the shift and control bits are normally unavailable because \fIxterm\fP uses the control modifier with mouse for popup menus, and the shift modifier is used in the default translations for button events. The \fIMeta\fP modifier recognized by \fIxterm\fP is the \fImod1\fP mask, -and is not necessarily the "Meta" key (see \fIxmodmap\fP). +and is not necessarily the "Meta" key (see \fBxmodmap\fP(1)). .bP \*(Cx and \*(Cy are the x and y coordinates of the mouse event, encoded as in X10 mode. @@ -2417,10 +2444,10 @@ the wheel mouse events are translated to \fIscroll-back\fP and \fIscroll-forw\fP actions. Those actions normally scroll the whole window, as if the scrollbar was used. -However if Alternate Scroll mode is set, +However if \fIAlternate Scroll\fP mode is set, then cursor up/down controls are sent when the terminal is displaying -the alternate screen. -The initial state of Alternate Scroll mode is set +the \fIAlternate Screen Buffer\fP. +The initial state of \fIAlternate Scroll\fP mode is set using the \fBalternateScroll\fP resource. .Ss Highlight tracking .lP diff --git a/app/xterm/ctlseqs.txt b/app/xterm/ctlseqs.txt index 91916521f..35980a57a 100644 --- a/app/xterm/ctlseqs.txt +++ b/app/xterm/ctlseqs.txt @@ -21,7 +21,7 @@ Thomas Dickey XFree86 Project (1996-2006) invisible-island.net (2006-2017) - updated for XTerm Patch #329 (2017/06/11) + updated for XTerm Patch #331 (2017/12/22) @@ -50,48 +50,48 @@ occasional lapses to "characters" where the meaning cannot be mistaken. Controls (including the escape code 27) are processed once: -o This means that a C1 control can be mistaken for badly-formed UTF-8 - when the terminal runs in UTF-8 mode because C1 controls are valid - continuation bytes of a UTF-8 encoded (multibyte) value. +o This means that a C1 control can be mistaken for badly-formed UTF-8 + when the terminal runs in UTF-8 mode because C1 controls are valid + continuation bytes of a UTF-8 encoded (multibyte) value. -o It is not possible to use a C1 control obtained from decoding the - UTF-8 text, because that would require reprocessing the data. Conse- - quently there is no ambiguity in the way this document uses the term - "character" to refer to bytes in a control sequence. +o It is not possible to use a C1 control obtained from decoding the + UTF-8 text, because that would require reprocessing the data. Con- + sequently there is no ambiguity in the way this document uses the + term "character" to refer to bytes in a control sequence. The order of processing is a necessary consequence of the way ECMA-48 is designed: -o Each byte sent to the terminal can be unambiguously determined to fall - into one of a few categories (C0, C1 and graphic characters). +o Each byte sent to the terminal can be unambiguously determined to + fall into one of a few categories (C0, C1 and graphic characters). -o ECMA-48 is modal; once it starts processing a control sequence, the - terminal continues until the sequence is complete, or some byte is - found which is not allowed in the sequence. +o ECMA-48 is modal; once it starts processing a control sequence, the + terminal continues until the sequence is complete, or some byte is + found which is not allowed in the sequence. -o Intermediate, parameter and final bytes may use the same codes as - graphic characters, but they are processed as part of a control - sequence and are not actually graphic characters. +o Intermediate, parameter and final bytes may use the same codes as + graphic characters, but they are processed as part of a control + sequence and are not actually graphic characters. -o Eight-bit controls can have intermediate, etc., bytes in the range 160 - to 255. Those can be treated as their counterparts in the range 32 to - 127. +o Eight-bit controls can have intermediate, etc., bytes in the range + 160 to 255. Those can be treated as their counterparts in the range + 32 to 127. -o Single-byte controls can be handled separately from multi-byte control - sequences because ECMA-48's rules are unambiguous. +o Single-byte controls can be handled separately from multi-byte con- + trol sequences because ECMA-48's rules are unambiguous. - As a special case, ECMA-48 (section 9) mentions that the control func- - tions shift-in and shift-out are allowed to occur within a 7-bit - multibyte control sequence because those cannot alter the meaning of - the control sequence. + As a special case, ECMA-48 (section 9) mentions that the control + functions shift-in and shift-out are allowed to occur within a 7-bit + multibyte control sequence because those cannot alter the meaning of + the control sequence. -o Some controls (such as OSC ) introduce a string mode, which is ended - on a ST (string terminator). +o Some controls (such as OSC ) introduce a string mode, which is ended + on a ST (string terminator). - Again, the terminal should accept single-byte controls within the - string. However, xterm has a resource setting brokenLinuxOSC to allow - recovery from applications which rely upon malformed palette sequences - used by the Linux console. + Again, the terminal should accept single-byte controls within the + string. However, xterm has a resource setting brokenLinuxOSC to + allow recovery from applications which rely upon malformed palette + sequences used by the Linux console. C1 (8-Bit) Control Characters @@ -357,17 +357,17 @@ CSI ? Pi; Pa; Pv S On success, Pv represents the value read or set. Notes: - o The current implementation allows reading the graphics - sizes, but disallows modifying those sizes because that is - done once, using resource-values. - o Graphics geometry is not necessarily the same as "window - size" (see the dtterm window manipulation extensions). For - example, xterm limits the maximum graphics geometry at com- - pile time (1000x1000 as of version 328) although the window - size can be larger. - o While resizing a window will always change the current - graphics geometry, the reverse is not true. Setting graph- - ics geometry does not affect the window size. + o The current implementation allows reading the graphics + sizes, but disallows modifying those sizes because that is + done once, using resource-values. + o Graphics geometry is not necessarily the same as "window + size" (see the dtterm window manipulation extensions). For + example, xterm limits the maximum graphics geometry at + compile time (1000x1000 as of version 328) although the + window size can be larger. + o While resizing a window will always change the current + graphics geometry, the reverse is not true. Setting + graphics geometry does not affect the window size. CSI Ps T Scroll down Ps lines (default = 1) (SD). CSI Ps ; Ps ; Ps ; Ps ; Ps T Initiate highlight mouse tracking. Parameters are @@ -465,7 +465,11 @@ CSI ? Pm h Ps = 9 -> Send Mouse X & Y on button press. See the sec- tion Mouse Tracking. This is the X10 xterm mouse protocol. Ps = 1 0 -> Show toolbar (rxvt). - Ps = 1 2 -> Start Blinking Cursor (att610). + Ps = 1 2 -> Start Blinking Cursor (AT&T 610). + Ps = 1 3 -> Start Blinking Cursor (set only via resource or + menu). + Ps = 1 4 -> Enable XOR of Blinking Cursor control sequence + and menu. Ps = 1 8 -> Print form feed (DECPFF). Ps = 1 9 -> Set print extent to full screen (DECPEX). Ps = 2 5 -> Show Cursor (DECTCEM). @@ -473,7 +477,7 @@ CSI ? Pm h Ps = 3 5 -> Enable font-shifting functions (rxvt). Ps = 3 8 -> Enter Tektronix Mode (DECTEK). Ps = 4 0 -> Allow 80 -> 132 Mode. - Ps = 4 1 -> more(1) fix (see curses resource). + Ps = 4 1 -> more(1) fix (see curses(3) resource). Ps = 4 2 -> Enable National Replacement Character sets (DECNRCM). Ps = 4 4 -> Turn On Margin Bell. @@ -523,6 +527,9 @@ CSI ? Pm h is received. (enables the popOnBell resource). Ps = 1 0 4 4 -> Reuse the most recent data copied to CLIP- BOARD. (This enables the keepClipboard resource). + Ps = 1 0 4 6 -> Enable switching to/from Alternate Screen + Buffer. This works for terminfo-based systems, updating the + titeInhibit resource. Ps = 1 0 4 7 -> Use Alternate Screen Buffer. (This may be disabled by the titeInhibit resource). Ps = 1 0 4 8 -> Save cursor as in DECSC. (This may be dis- @@ -536,7 +543,7 @@ CSI ? Pm h Ps = 1 0 5 1 -> Set Sun function-key mode. Ps = 1 0 5 2 -> Set HP function-key mode. Ps = 1 0 5 3 -> Set SCO function-key mode. - Ps = 1 0 6 0 -> Set legacy keyboard emulation (X11R6). + Ps = 1 0 6 0 -> Set legacy keyboard emulation (i.e, X11R6). Ps = 1 0 6 1 -> Set VT220 keyboard emulation. Ps = 2 0 0 4 -> Set bracketed paste mode. CSI Pm i Media Copy (MC). @@ -569,14 +576,18 @@ CSI ? Pm l Ps = 8 -> No Auto-repeat Keys (DECARM). Ps = 9 -> Don't send Mouse X & Y on button press. Ps = 1 0 -> Hide toolbar (rxvt). - Ps = 1 2 -> Stop Blinking Cursor (att610). + Ps = 1 2 -> Stop Blinking Cursor (AT&T 610). + Ps = 1 3 -> Disable Blinking Cursor (reset only via + resource or menu). + Ps = 1 4 -> Disable XOR of Blinking Cursor control sequence + and menu. Ps = 1 8 -> Don't print form feed (DECPFF). Ps = 1 9 -> Limit print to scrolling region (DECPEX). Ps = 2 5 -> Hide Cursor (DECTCEM). Ps = 3 0 -> Don't show scrollbar (rxvt). Ps = 3 5 -> Disable font-shifting functions (rxvt). Ps = 4 0 -> Disallow 80 -> 132 Mode. - Ps = 4 1 -> No more(1) fix (see curses resource). + Ps = 4 1 -> No more(1) fix (see curses(3) resource). Ps = 4 2 -> Disable National Replacement Character sets (DECNRCM). Ps = 4 4 -> Turn Off Margin Bell. @@ -623,9 +634,13 @@ CSI ? Pm l resource). Ps = 1 0 4 3 -> Disable raising of the window when Control- G is received. (This disables the popOnBell resource). + Ps = 1 0 4 6 -> Disable switching to/from Alternate Screen + Buffer. This works for terminfo-based systems, updating the + titeInhibit resource. If currently using the Alternate Screen + Buffer, xterm switches to the Normal Screen Buffer. Ps = 1 0 4 7 -> Use Normal Screen Buffer, clearing screen - first if in the Alternate Screen. (This may be disabled by - the titeInhibit resource). + first if in the Alternate Screen Buffer. (This may be dis- + abled by the titeInhibit resource). Ps = 1 0 4 8 -> Restore cursor as in DECRC. (This may be disabled by the titeInhibit resource). Ps = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor @@ -637,7 +652,8 @@ CSI ? Pm l Ps = 1 0 5 1 -> Reset Sun function-key mode. Ps = 1 0 5 2 -> Reset HP function-key mode. Ps = 1 0 5 3 -> Reset SCO function-key mode. - Ps = 1 0 6 0 -> Reset legacy keyboard emulation (X11R6). + Ps = 1 0 6 0 -> Reset legacy keyboard emulation (i.e, + X11R6). Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style. Ps = 2 0 0 4 -> Reset bracketed paste mode. CSI Pm m Character Attributes (SGR). @@ -646,7 +662,7 @@ CSI Pm m Character Attributes (SGR). Ps = 2 -> Faint, decreased intensity (ISO 6429). Ps = 3 -> Italicized (ISO 6429). Ps = 4 -> Underlined. - Ps = 5 -> Blink (appears as Bold). + Ps = 5 -> Blink (appears as Bold in X11R6 xterm). Ps = 7 -> Inverse. Ps = 8 -> Invisible, i.e., hidden (VT300). Ps = 9 -> Crossed-out characters (ISO 6429). @@ -706,19 +722,34 @@ CSI Pm m Character Attributes (SGR). Xterm maintains a color palette whose entries are identified by an index beginning with zero. If 88- or 256-color support is compiled, the following apply: - o All parameters are decimal integers. - o RGB values range from zero (0) to 255. - o ISO-8613-3 can be interpreted in more than one way; xterm - allows the semicolons in this control to be replaced by - colons (but after the first colon, colons must be used). + o All parameters are decimal integers. + o RGB values range from zero (0) to 255. + o ISO-8613-6 has been interpreted in more than one way; + xterm allows the semicolons separating the subparameters + in this control to be replaced by colons (but after the + first colon, colons must be used). - These ISO-8613-3 controls are supported: + These ISO-8613-6 controls are supported: + Pm = 3 8 ; 2 ; Pi; Pr; Pg; Pb -> Set foreground color to the + closest match in xterm's palette for the given RGB Pr/Pg/Pb. + The color space identifier Pi is ignored. + Pm = 3 8 ; 5 ; Ps -> Set foreground color to Ps. + Pm = 4 8 ; 2 ; Pi; Pr; Pg; Pb -> Set background color to the + closest match in xterm's palette for the given RGB Pr/Pg/Pb. + The color space identifier Pi is ignored. + Pm = 4 8 ; 5 ; Ps -> Set background color to Ps. + + This variation on ISO-8613-6 is supported for compatibility + with KDE konsole: Pm = 3 8 ; 2 ; Pr; Pg; Pb -> Set foreground color to the closest match in xterm's palette for the given RGB Pr/Pg/Pb. - Pm = 3 8 ; 5 ; Ps -> Set foreground color to Ps. Pm = 4 8 ; 2 ; Pr; Pg; Pb -> Set background color to the closest match in xterm's palette for the given RGB Pr/Pg/Pb. - Pm = 4 8 ; 5 ; Ps -> Set background color to Ps. + + If xterm is compiled with direct-color support, and the + resource directColor is true, then rather than choosing the + closest match, xterm asks the X server to directly render a + given color. CSI > Ps; Ps m Set or reset resource-values used by xterm to decide whether @@ -784,7 +815,7 @@ CSI ? Ps n available, if compiled-in, or CSI ? 5 0 n No Locator, if not. Ps = 5 6 -> Report Locator type as CSI ? 5 7 ; 1 n Mouse, if compiled-in, or CSI ? 5 7 ; 0 n Cannot identify, if not. - Ps = 6 2 -> Report macro space (DECMSR) as CSI Pn \* { . + Ps = 6 2 -> Report macro space (DECMSR) as CSI Pn * { . Ps = 6 3 -> Report memory checksum (DECCKSR) as DCS Pt ! x x x x ST . Pt is the request id (from an optional parameter to the @@ -819,7 +850,7 @@ CSI Ps ; Ps " p CSI Ps $ p Request ANSI mode (DECRQM). For VT300 and up, reply is CSI Ps; Pm$ y - where Ps is the mode number as in RM, and Pm is the mode + where Ps is the mode number as in SM/RM, and Pm is the mode value: 0 - not recognized 1 - set @@ -829,8 +860,12 @@ CSI Ps $ p CSI ? Ps$ p Request DEC private mode (DECRQM). For VT300 and up, reply is CSI ? Ps; Pm$ y - where Ps is the mode number as in DECSET, Pm is the mode value - as in the ANSI DECRQM. + where Ps is the mode number as in DECSET/DECSET, Pm is the + mode value as in the ANSI DECRQM. + Two private modes are read-only (i.e., 1 3 and 1 4 ), pro- + vided only for reporting their values using this control + sequence. They correspond to the resources cursorBlink and + cursorBlinkXOR. CSI Ps q Load LEDs (DECLL). Ps = 0 -> Clear all LEDS (default). Ps = 1 -> Light Num Lock. @@ -864,8 +899,8 @@ CSI Pt; Pl; Pb; Pr; Ps$ r Change Attributes in Rectangular Area (DECCARA), VT400 and up. Pt; Pl; Pb; Pr denotes the rectangle. Ps denotes the SGR attributes to change: 0, 1, 4, 5, 7. -CSI s Save cursor (ANSI.SYS), available only when DECLRMM is dis- - abled. +CSI s Save cursor, available only when DECLRMM is disabled (SCOSC, + also ANSI.SYS). CSI Pl; Pr s Set left and right margins (DECSLRM), available only when DECLRMM is enabled (VT420 and up). @@ -943,7 +978,7 @@ CSI Pt; Pl; Pb; Pr; Ps$ t up. Pt; Pl; Pb; Pr denotes the rectangle. Ps denotes the attributes to reverse, i.e., 1, 4, 5, 7. -CSI u Restore cursor (ANSI.SYS). +CSI u Restore cursor (SCORC, also ANSI.SYS). CSI Ps SP u Set margin-bell volume (DECSMBV, VT520). Ps = 1 -> off. @@ -1526,11 +1561,11 @@ Similarly, xterm can be compiled to support HP keyboards. See the xterm-hp terminfo entry for details. The Alternate Screen Buffer -Xterm maintains two screen buffers. The normal screen buffer allows you +Xterm maintains two screen buffers. The Normal Screen Buffer allows you to scroll back to view saved lines of output up to the maximum set by -the saveLines resource. The alternate screen buffer is exactly as large -as the display, contains no additional saved lines. When the alternate -screen buffer is active, you cannot scroll back to view saved lines. +the saveLines resource. The Alternate Screen Buffer is exactly as large +as the display, contains no additional saved lines. When the Alternate +Screen Buffer is active, you cannot scroll back to view saved lines. Xterm provides control sequences and menu entries for switching between the two. @@ -1543,9 +1578,9 @@ built with terminfo libraries because terminfo does not provide the whole text of the termcap data in one piece. It would not work for ter- minfo anyway, since terminfo data is not passed in environment vari- ables; setting an environment variable in this manner would have no -effect on the application's ability to switch between normal and alter- -nate screen buffers. Instead, the newer private mode controls (such as -1 0 4 9 ) for switching between normal and alternate screen buffers sim- +effect on the application's ability to switch between Normal and Alter- +nate Screen buffers. Instead, the newer private mode controls (such as +1 0 4 9 ) for switching between Normal and Alternate Screen buffers sim- ply disable the switching. They add other features such as clearing the display for the same reason: to make the details of switching indepen- dent of the application that requests the switch. @@ -1593,8 +1628,8 @@ tion on button presses. These modes are typically used by editors and other full-screen applications that want to make use of the mouse. There are two sets of mutually exclusive modes: -o mouse protocol -o protocol encoding +o mouse protocol +o protocol encoding The mouse protocols include DEC Locator mode, enabled by the DECELR CSI Ps ; Ps ' z control sequence, and is not described here (control @@ -1629,32 +1664,33 @@ parameters in a single character as value+32. For example, ! specifies the value 1. The upper left character position on the terminal is denoted as 1,1. This scheme dates back to X10, though the normal mouse- tracking (from X11) is more elaborate. -X10 compatbility mode +X10 compatibility mode X10 compatibility mode sends an escape sequence only on button press, encoding the location and the mouse button pressed. It is enabled by specifying parameter 9 to DECSET. On button press, xterm sends CSI M CbCxCy (6 characters). -o Cb is button-1. -o Cx and Cy are the x and y coordinates of the mouse when the button was - pressed. +o Cb is button-1. +o Cx and Cy are the x and y coordinates of the mouse when the button + was pressed. Normal tracking mode Normal tracking mode sends an escape sequence on both button press and release. Modifier key (shift, ctrl, meta) information is also sent. It is enabled by specifying parameter 1000 to DECSET. On button press or release, xterm sends CSI M CbCxCy. -o The low two bits of Cb encode button information: 0=MB1 pressed, 1=MB2 - pressed, 2=MB3 pressed, 3=release. -o The next three bits encode the modifiers which were down when the but- - ton was pressed and are added together: 4=Shift, 8=Meta, 16=Control. - Note however that the shift and control bits are normally unavailable - because xterm uses the control modifier with mouse for popup menus, - and the shift modifier is used in the default translations for button - events. The Meta modifier recognized by xterm is the mod1 mask, and - is not necessarily the "Meta" key (see xmodmap). -o Cx and Cy are the x and y coordinates of the mouse event, encoded as - in X10 mode. +o The low two bits of Cb encode button information: 0=MB1 pressed, + 1=MB2 pressed, 2=MB3 pressed, 3=release. +o The next three bits encode the modifiers which were down when the + button was pressed and are added together: 4=Shift, 8=Meta, 16=Con- + trol. Note however that the shift and control bits are normally + unavailable because xterm uses the control modifier with mouse for + popup menus, and the shift modifier is used in the default transla- + tions for button events. The Meta modifier recognized by xterm is + the mod1 mask, and is not necessarily the "Meta" key (see + xmodmap(1)). +o Cx and Cy are the x and y coordinates of the mouse event, encoded as + in X10 mode. Wheel mice Wheel mice may return buttons 4 and 5. Those buttons are represented by @@ -1664,8 +1700,8 @@ reported. By default, the wheel mouse events are translated to scroll- back and scroll-forw actions. Those actions normally scroll the whole window, as if the scrollbar was used. However if Alternate Scroll mode is set, then cursor up/down controls are sent when the terminal is dis- -playing the alternate screen. The initial state of Alternate Scroll -mode is set using the alternateScroll resource. +playing the Alternate Screen Buffer. The initial state of Alternate +Scroll mode is set using the alternateScroll resource. Highlight tracking Mouse highlight tracking notifies a program of a button press, receives @@ -1689,15 +1725,15 @@ location tracks the mouse, but will never be above row firstrow and will always be above row lastrow. (The top of the screen is row 1.) When the button is released, xterm reports the ending position one of two ways: -o if the start and end coordinates are the same locations: - CSI t CxCy. -o otherwise: - CSI T CxCyCxCyCxCy. - The parameters are startx, starty, endx, endy, mousex, and mousey. - - startx, starty, endx, and endy give the starting and ending charac- - ter positions of the region. - - mousex and mousey give the location of the mouse at button up, which - may not be over a character. +o if the start and end coordinates are the same locations: + CSI t CxCy. +o otherwise: + CSI T CxCyCxCyCxCy. + The parameters are startx, starty, endx, endy, mousex, and mousey. + - startx, starty, endx, and endy give the starting and ending char- + acter positions of the region. + - mousex and mousey give the location of the mouse at button up, + which may not be over a character. Button-event tracking Button-event tracking is essentially the same as normal tracking, but @@ -1705,13 +1741,14 @@ xterm also reports button-motion events. Motion events are reported only if the mouse pointer has moved to a different character cell. It is enabled by specifying parameter 1002 to DECSET. On button press or release, xterm sends the same codes used by normal tracking mode. -o On button-motion events, xterm adds 32 to the event code (the third - character, Cb). -o The other bits of the event code specify button and modifier keys as - in normal mode. For example, motion into cell x,y with button 1 down - is reported as CSI M @ CxCy. ( @ = 32 + 0 (button 1) + 32 (motion - indicator) ). Similarly, motion with button 3 down is reported as CSI - M B CxCy. ( B = 32 + 2 (button 3) + 32 (motion indicator) ). +o On button-motion events, xterm adds 32 to the event code (the third + character, Cb). +o The other bits of the event code specify button and modifier keys as + in normal mode. For example, motion into cell x,y with button 1 + down is reported as CSI M @ CxCy. ( @ = 32 + 0 (button 1) + 32 + (motion indicator) ). Similarly, motion with button 3 down is + reported as CSI M B CxCy. ( B = 32 + 2 (button 3) + 32 (motion + indicator) ). Any-event tracking Any-event mode is the same as button-event mode, except that all motion @@ -1749,13 +1786,14 @@ SGR (1006) semicolon-separated encoded button value, the Cx and Cy ordi- nates and a final character which is M for button press and m for button release. - o The encoded button value in this case does not add 32 since - that was useful only in the X10 scheme for ensuring that the - byte containing the button value is a printable code. - o The modifiers are encoded in the same way. - o A different final character is used for button release to - resolve the X10 ambiguity regarding which button was - released. + o The encoded button value in this case does not add 32 + since that was useful only in the X10 scheme for ensuring + that the byte containing the button value is a printable + code. + o The modifiers are encoded in the same way. + o A different final character is used for button release to + resolve the X10 ambiguity regarding which button was + released. The highlight tracking responses are also modified to an SGR- like format, using the same SGR-style scheme and button-encod- ings. diff --git a/app/xterm/data.c b/app/xterm/data.c index a6b0423e4..deb835889 100644 --- a/app/xterm/data.c +++ b/app/xterm/data.c @@ -1,7 +1,7 @@ -/* $XTermId: data.c,v 1.96 2016/06/01 09:14:11 tom Exp $ */ +/* $XTermId: data.c,v 1.98 2017/12/18 23:38:05 tom Exp $ */ /* - * Copyright 2002-2013,2016 by Thomas E. Dickey + * Copyright 2002-2016,2017 by Thomas E. Dickey * * All Rights Reserved * @@ -119,3 +119,10 @@ int ice_fd = -1; #ifdef USE_IGNORE_RC int ignore_unused; #endif + +#if OPT_DIRECT_COLOR +CellColor initCColor = +{0, 0}; +#else +CellColor initCColor = 0; +#endif diff --git a/app/xterm/data.h b/app/xterm/data.h index dc1491caf..2b019d355 100644 --- a/app/xterm/data.h +++ b/app/xterm/data.h @@ -1,4 +1,4 @@ -/* $XTermId: data.h,v 1.130 2017/05/31 01:13:01 tom Exp $ */ +/* $XTermId: data.h,v 1.131 2017/11/09 01:22:18 tom Exp $ */ /* * Copyright 2002-2016,2017 by Thomas E. Dickey @@ -129,6 +129,8 @@ extern Arg ourTopLevelShellArgs[]; extern Cardinal number_ourTopLevelShellArgs; extern Atom wm_delete_window; +extern CellColor initCColor; + #if HANDLE_STRUCT_NOTIFY /* Flag icon name with "*** " on window output when iconified. * I'd like to do something like reverse video, but I don't diff --git a/app/xterm/error.h b/app/xterm/error.h index 4b3f999f7..d2aabd727 100644 --- a/app/xterm/error.h +++ b/app/xterm/error.h @@ -1,6 +1,34 @@ -/* $XTermId: error.h,v 1.25 2012/10/05 00:17:51 tom Exp $ */ +/* $XTermId: error.h,v 1.26 2012/10/05 00:17:51 tom Exp $ */ /* + * Copyright 1997-2011,2012 by Thomas E. Dickey + * + * All Rights Reserved + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name(s) of the above copyright + * holders shall not be used in advertising or otherwise to promote the + * sale, use or other dealings in this Software without prior written + * authorization. + * * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. * * All Rights Reserved diff --git a/app/xterm/fontutils.c b/app/xterm/fontutils.c index 6db575e4b..42dd3ba74 100644 --- a/app/xterm/fontutils.c +++ b/app/xterm/fontutils.c @@ -1,4 +1,4 @@ -/* $XTermId: fontutils.c,v 1.531 2017/06/20 09:10:19 tom Exp $ */ +/* $XTermId: fontutils.c,v 1.563 2017/12/30 15:04:01 tom Exp $ */ /* * Copyright 1998-2016,2017 by Thomas E. Dickey @@ -51,6 +51,8 @@ #include #include +#define NoFontWarning(data) (data)->warn = fwAlways + #define SetFontWidth(screen,dst,src) (dst)->f_width = (src) #define SetFontHeight(screen,dst,src) (dst)->f_height = dimRound((screen)->scale_height * (float) (src)) @@ -475,11 +477,12 @@ open_italic_font(XtermWidget xw, int n, FontNameProperties *fp, XTermFonts * dat "o", "i" }; - char *name; Cardinal pass; Boolean result = False; + NoFontWarning(data); for (pass = 0; pass < XtNumber(slant); ++pass) { + char *name; if ((name = italic_font_name(fp, slant[pass])) != 0) { TRACE(("open_italic_font %s %s\n", whichFontEnum((VTFontEnum) n), name)); @@ -902,7 +905,6 @@ cannotFont(XtermWidget xw, const char *who, const char *what, const char *where) case fwAlways: break; } - TRACE(("OOPS: cannot %s%s%s font \"%s\"\n", who, *what ? " " : "", what, where)); xtermWarning("cannot %s%s%s font \"%s\"\n", who, *what ? " " : "", what, where); } @@ -934,18 +936,17 @@ xtermOpenFont(XtermWidget xw, && !UsingRenderFont(xw) #endif ) { - TRACE(("OOPS: cannot load font %s\n", name)); cannotFont(xw, "load", "", name); } else { TRACE(("xtermOpenFont: cannot load font '%s'\n", name)); } if (force) { - result->warn = fwAlways; + NoFontWarning(result); code = xtermOpenFont(xw, DEFFONT, result, True); } } } - result->warn = fwAlways; + NoFontWarning(result); return code; } @@ -1121,8 +1122,8 @@ xtermUpdateFontGCs(XtermWidget xw, Bool italic) MyGetFont myfunc = getNormalFont; #endif VTwin *win = WhichVWin(screen); - Pixel new_normal = getXtermForeground(xw, xw->flags, xw->cur_foreground); - Pixel new_revers = getXtermBackground(xw, xw->flags, xw->cur_background); + Pixel new_normal = getXtermFG(xw, xw->flags, xw->cur_foreground); + Pixel new_revers = getXtermBG(xw, xw->flags, xw->cur_background); (void) italic; @@ -1226,6 +1227,7 @@ loadBoldFP(XtermWidget xw, fp = get_font_name_props(screen->display, infoRef->fs, &normal); if (fp != 0) { + NoFontWarning(infoOut); *nameOutP = bold_font_name(fp, fp->average_width); if (!xtermOpenFont(xw, *nameOutP, infoOut, False)) { free(*nameOutP); @@ -1335,6 +1337,7 @@ loadWBoldFP(XtermWidget xw, if (fp != 0) { *nameOutP = widebold_font_name(fp); derived = True; + NoFontWarning(infoOut); } } @@ -1537,7 +1540,7 @@ xtermLoadFont(XtermWidget xw, setupPackedFonts(xw); #endif screen->fnt_prop = (Boolean) (proportional && !(screen->force_packed)); - screen->fnt_boxes = True; + screen->fnt_boxes = 1; #if OPT_BOX_CHARS /* @@ -1550,7 +1553,7 @@ xtermLoadFont(XtermWidget xw, /* * FIXME: we shouldn't even be here if we're using Xft. */ - screen->fnt_boxes = False; + screen->fnt_boxes = 0; TRACE(("assume Xft missing line-drawing chars\n")); } else #endif @@ -1567,29 +1570,43 @@ xtermLoadFont(XtermWidget xw, #endif #endif - for (ch = 1; ch < 32; ch++) { - unsigned n = ch; #if OPT_WIDE_CHARS - if (screen->utf8_mode || screen->unicode_font) { - n = dec2ucs(ch); - if (n == UCS_REPL) - continue; + if (screen->utf8_mode || screen->unicode_font) { + UIntSet(screen->fnt_boxes, 2); + for (ch = 1; ch < 32; ch++) { + unsigned n = dec2ucs(ch); + if ((n != UCS_REPL) + && (n != ch) + && (screen->fnt_boxes & 2)) { + if (xtermMissingChar(n, &fnts[fNorm]) || + xtermMissingChar(n, &fnts[fBold])) { + UIntClr(screen->fnt_boxes, 2); + TRACE(("missing graphics character #%d, U+%04X\n", + ch, n)); + break; + } + } } + } #endif - if (IsXtermMissingChar(screen, n, &fnts[fNorm])) { - TRACE(("missing normal char #%d\n", n)); - screen->fnt_boxes = False; + + for (ch = 1; ch < 32; ch++) { + if (xtermMissingChar(ch, &fnts[fNorm])) { + TRACE(("missing normal char #%d\n", ch)); + UIntClr(screen->fnt_boxes, 1); break; } - if (IsXtermMissingChar(screen, n, &fnts[fBold])) { - TRACE(("missing bold char #%d\n", n)); - screen->fnt_boxes = False; + if (xtermMissingChar(ch, &fnts[fBold])) { + TRACE(("missing bold char #%d\n", ch)); + UIntClr(screen->fnt_boxes, 1); break; } } + + TRACE(("Will %suse internal line-drawing characters (mode %d)\n", + screen->fnt_boxes ? "not " : "", + screen->fnt_boxes)); } - TRACE(("Will %suse internal line-drawing characters\n", - screen->fnt_boxes ? "not " : "")); #endif if (screen->always_bold_mode) { @@ -2179,7 +2196,7 @@ xtermSetCursorBox(TScreen *screen) } #define CACHE_XFT(dst,src) if (src != 0) {\ - checkXft(xw, &(dst[fontnum]), src);\ + failed += checkXft(xw, &(dst[fontnum]), src);\ TRACE(("Xft metrics %s[%d] = %d (%d,%d)%s advance %d, actual %d%s\n",\ #dst,\ fontnum,\ @@ -2279,11 +2296,12 @@ dumpXft(XtermWidget xw, XTermXftFonts *data) #define DUMP_XFT(xw, data) /* nothing */ #endif -static void +static int checkXft(XtermWidget xw, XTermXftFonts *data, XftFont *xft) { FcChar32 c; Dimension width = 0; + int failed = 0; data->font = xft; data->map.min_width = 0; @@ -2308,8 +2326,19 @@ checkXft(XtermWidget xw, XTermXftFonts *data, XftFont *xft) } } } + /* + * Sometimes someone uses a symbol font which has no useful ASCII or + * Latin-1 characters. Allow that, in case they did it intentionally. + */ + if (width == 0) { + failed = 1; + if (xtermXftLastChar(xft) >= 256) { + width = data->map.max_width; + } + } data->map.min_width = width; data->map.mixed = (data->map.max_width >= (data->map.min_width + 1)); + return failed; } #if OPT_REPORT_FONTS @@ -2353,6 +2382,38 @@ reportXftFonts(XtermWidget xw, #define reportXftFonts(xw, result, name, tag, match) /* empty */ #endif /* OPT_REPORT_FONTS */ +/* + * Xft discards the pattern-match during open-pattern if the result happens to + * match a currently-open file, but provides no clue to the caller when it does + * this. That is, closing a font-file may leave the data in Xft's cache, while + * opening a file may free the data used for the match. + * + * Because of this problem, we cannot reliably refer to the pattern-match data + * if it may have been seen before. + */ +Boolean +maybeXftCache(XtermWidget xw, XftFont *font) +{ + Boolean result = False; + TScreen *screen = TScreenOf(xw); + ListXftFonts *p; + for (p = screen->list_xft_fonts; p != 0; p = p->next) { + if (p->font == font) { + result = True; + break; + } + } + if (!result) { + p = TypeXtMalloc(ListXftFonts); + if (p != 0) { + p->font = font; + p->next = screen->list_xft_fonts; + screen->list_xft_fonts = p; + } + } + return result; +} + static XftFont * xtermOpenXft(XtermWidget xw, const char *name, XftPattern *pat, const char *tag) { @@ -2367,19 +2428,19 @@ xtermOpenXft(XtermWidget xw, const char *name, XftPattern *pat, const char *tag) result = XftFontOpenPattern(dpy, match); if (result != 0) { TRACE(("...matched %s font\n", tag)); - reportXftFonts(xw, result, name, tag, match); + if (!maybeXftCache(xw, result)) { + reportXftFonts(xw, result, name, tag, match); + } } else { - TRACE(("...could did not open %s font\n", tag)); + TRACE(("...could not open %s font\n", tag)); XftPatternDestroy(match); if (xw->misc.fontWarnings >= fwAlways) { - TRACE(("OOPS cannot open %s font \"%s\"\n", tag, name)); cannotFont(xw, "open", tag, name); } } } else { TRACE(("...did not match %s font\n", tag)); if (xw->misc.fontWarnings >= fwResource) { - TRACE(("OOPS: cannot match %s font \"%s\"\n", tag, name)); cannotFont(xw, "match", tag, name); } } @@ -2414,29 +2475,268 @@ dimSquareRoot(double value) } #endif +#if OPT_WIDE_CHARS +#define MY_UCS(code,high,wide,name) { code, high, wide, #name } +static const struct { + unsigned code, high, wide; + const char *name; +} unicode_boxes[] = { + + MY_UCS(0x2500, 0, 1, box drawings light horizontal), + MY_UCS(0x2502, 1, 0, box drawings light vertical), + MY_UCS(0x250c, 2, 2, box drawings light down and right), + MY_UCS(0x2510, 2, 2, box drawings light down and left), + MY_UCS(0x2514, 2, 2, box drawings light up and right), + MY_UCS(0x2518, 2, 2, box drawings light up and left), + MY_UCS(0x251c, 1, 2, box drawings light vertical and right), + MY_UCS(0x2524, 1, 2, box drawings light vertical and left), + MY_UCS(0x252c, 2, 1, box drawings light down and horizontal), + MY_UCS(0x2534, 2, 1, box drawings light up and horizontal), + MY_UCS(0x253c, 1, 1, box drawings light vertical and horizontal), + { + 0, 0, 0, NULL + } +}; + +#undef MY_UCS +#endif /* OPT_WIDE_CHARS */ + +#ifdef DEBUG_XFT +static void +trace_xft_glyph(TScreen *screen, XftFont *font, FT_Face face, int code, const char *name) +{ + if (!XftGlyphExists(screen->display, font, code)) { + TRACE(("Xft glyph U+%04X missing :%s\n", code, name)); + } else if (FT_Load_Char(face, code, FT_LOAD_RENDER) == 0) { + FT_GlyphSlot g = face->glyph; + TRACE(("Xft glyph U+%04X size(%3d,%3d) at(%3d,%3d) :%s\n", + code, + g->bitmap.rows, g->bitmap.width, + g->bitmap_top, g->bitmap_left, + name)); + } +} + +#if OPT_WIDE_CHARS +static void +trace_xft_line_drawing(TScreen *screen, XftFont *font, FT_Face face) +{ + int n; + for (n = 0; unicode_boxes[n].code != 0; ++n) { + trace_xft_glyph(screen, font, face, unicode_boxes[n].code, + unicode_boxes[n].name); + } +} +#else +#define trace_xft_line_drawing(screen, font, face) /* nothing */ +#endif +#endif + +static void +setBrokenBoxChars(XtermWidget xw, Bool state) +{ + term->work.broken_box_chars = (Boolean) state; + TScreenOf(xw)->broken_box_chars = (Boolean) state; + update_font_boxchars(); +} + +/* + * Check if the line-drawing characters do not fill the bounding box. If so, + * they're not useful. + */ +static void +linedrawing_gaps(XtermWidget xw, XftFont *font) +{ + Boolean broken; + +#if OPT_WIDE_CHARS + TScreen *screen = TScreenOf(xw); + int n; + FT_Face face; + face = XftLockFace(font); + broken = False; + for (n = 0; unicode_boxes[n].code; ++n) { + unsigned code = unicode_boxes[n].code; + + if (!XftGlyphExists(screen->display, font, code)) { + TRACE(("Xft glyph U+%04X is missing\n", code)); + broken = True; + break; + } + + if (FT_Load_Char(face, code, FT_LOAD_RENDER) == 0) { + FT_GlyphSlot g = face->glyph; + TRACE(("Xft glyph U+%04X size(%3d,%3d) at(%3d,%3d) :%s\n", + code, + g->bitmap.rows, g->bitmap.width, + g->bitmap_top, g->bitmap_left, + unicode_boxes[n].name)); + /* + * While it is possible for badly-designed fonts to have line + * drawing characters which do not meet, FreeType aggravates the + * situation with its rounding. Check for an obvious case where + * the weights at the ends of a vertical line do not add up. That + * shows up as two under-weight rows at the beginning/end of the + * bitmap. + */ + if (code == 0x2502) { + unsigned r, c; + unsigned mids = 0, ends = 0; + unsigned char *data = g->bitmap.buffer; + + switch (g->bitmap.pixel_mode) { + case FT_PIXEL_MODE_MONO: + /* FALLTHRU */ + case FT_PIXEL_MODE_GRAY: + for (r = 0; r < (unsigned) g->bitmap.rows; ++r) { + unsigned k = r * (unsigned) g->bitmap.pitch; + unsigned sum = 0; + for (c = 0; c < (unsigned) g->bitmap.width; ++c) { + unsigned xx = 0; + switch (g->bitmap.pixel_mode) { + case FT_PIXEL_MODE_MONO: + xx = (data[k + (c / 8)] >> (c % 8)) & 1; + break; + case FT_PIXEL_MODE_GRAY: + xx = data[k + c]; + break; + } + sum += xx; + TRACE2((" %2x", xx)); + } + TRACE2((" = %u\n", sum)); + if (r > 0 && (r + 1) < (unsigned) g->bitmap.rows) { + mids = sum; + } else { + ends += sum; + } + } + TRACE(("...compare middle %u vs ends %u\n", mids, ends)); + if ((mids > ends) && (g->bitmap.rows < 16)) + broken = True; + break; + default: + TRACE(("FIXME pixel_mode %d not handled\n", + g->bitmap.pixel_mode)); + break; + } + if (broken) + break; + } + switch (unicode_boxes[n].high) { + case 1: + if ((unsigned) g->bitmap.rows < (unsigned) FontHeight(screen)) { + broken = True; + } + break; + case 2: + if ((unsigned) (g->bitmap.rows * 2) < (unsigned) FontHeight(screen)) { + broken = True; + } + break; + } + switch (unicode_boxes[n].wide) { + case 1: + if ((unsigned) g->bitmap.width < (unsigned) FontWidth(screen)) { + broken = True; + } + break; + case 2: + if ((unsigned) (g->bitmap.width * 2) < (unsigned) FontWidth(screen)) { + broken = True; + } + break; + } + if (broken) + break; + } + } + XftUnlockFace(font); +#else + broken = True; +#endif + + if (broken) { + TRACE(("Xft line-drawing would leave gaps\n")); + setBrokenBoxChars(xw, True); + } +} + /* * Given the Xft font metrics, determine the actual font size. This is used * for each font to ensure that normal, bold and italic fonts follow the same * rule. */ static void -setRenderFontsize(TScreen *screen, VTwin *win, XftFont *font, const char *tag) +setRenderFontsize(XtermWidget xw, VTwin *win, XftFont *font, const char *tag) { if (font != 0) { + TScreen *screen = TScreenOf(xw); int width, height, ascent, descent; +#ifdef DEBUG_XFT + int n; + FT_Face face; + FT_Size size; + FT_Size_Metrics metrics; + Boolean scalable; + Boolean is_fixed; + Boolean debug_xft = False; - (void) screen; + face = XftLockFace(font); + size = face->size; + metrics = size->metrics; + is_fixed = FT_IS_FIXED_WIDTH(face); + scalable = FT_IS_SCALABLE(face); + trace_xft_line_drawing(screen, font, face); + for (n = 32; n < 127; ++n) { + char name[80]; + sprintf(name, "letter \"%c\"", n); + trace_xft_glyph(screen, font, face, n, name); + } + XftUnlockFace(font); + + /* freetype's inconsistent for this sign */ + metrics.descender = -metrics.descender; + +#define TR_XFT "Xft metrics: " +#define D_64(name) ((double)(metrics.name)/64.0) +#define M_64(a,b) ((font->a * 64) != metrics.b) +#define BOTH(a,b) D_64(b), M_64(a,b) ? "*" : "" + + debug_xft = (M_64(ascent, ascender) + || M_64(descent, descender) + || M_64(height, height) + || M_64(max_advance_width, max_advance)); + + TRACE(("Xft font is %sscalable, %sfixed-width\n", + is_fixed ? "" : "not ", + scalable ? "" : "not ")); + + if (debug_xft) { + TRACE(("Xft font size %d+%d vs %d by %d\n", + font->ascent, + font->descent, + font->height, + font->max_advance_width)); + TRACE((TR_XFT "ascender %6.2f%s\n", BOTH(ascent, ascender))); + TRACE((TR_XFT "descender %6.2f%s\n", BOTH(descent, descender))); + TRACE((TR_XFT "height %6.2f%s\n", BOTH(height, height))); + TRACE((TR_XFT "max_advance %6.2f%s\n", BOTH(max_advance_width, max_advance))); + } else { + TRACE((TR_XFT "matches font\n")); + } +#endif width = font->max_advance_width; height = font->height; ascent = font->ascent; descent = font->descent; if (height < ascent + descent) { - TRACE(("...increase height from %d\n", height)); + TRACE(("...increase height from %d to %d\n", height, ascent + descent)); height = ascent + descent; } if (is_double_width_font_xft(screen->display, font)) { - TRACE(("...reduced width from %d\n", width)); + TRACE(("...reduce width from %d to %d\n", width, width >> 1)); width >>= 1; } if (tag == 0) { @@ -2462,16 +2762,20 @@ setRenderFontsize(TScreen *screen, VTwin *win, XftFont *font, const char *tag) } else { TRACE(("setRenderFontsize %s unchanged\n", tag)); } + if (!screen->broken_box_chars && (tag == 0)) { + linedrawing_gaps(xw, font); + } } } #endif static void -checkFontInfo(int value, const char *tag) +checkFontInfo(int value, const char *tag, int failed) { - if (value == 0) { + if (value == 0 || failed) { xtermWarning("Selected font has no non-zero %s for ISO-8859-1 encoding\n", tag); - exit(1); + if (value == 0) + exit(1); } } @@ -2542,6 +2846,7 @@ xtermComputeFontInfo(XtermWidget xw, #if OPT_RENDERFONT int fontnum = screen->menu_font_number; #endif + int failed = 0; #if OPT_RENDERFONT /* @@ -2629,7 +2934,7 @@ xtermComputeFontInfo(XtermWidget xw, * graphics characters. */ if (screen->fnt_boxes) { - screen->fnt_boxes = False; + screen->fnt_boxes = 0; TRACE(("Xft opened - will %suse internal line-drawing characters\n", screen->fnt_boxes ? "not " : "")); } @@ -2709,9 +3014,10 @@ xtermComputeFontInfo(XtermWidget xw, update_font_renderfont(); /* now we will fall through into the bitmap fonts */ } else { - setRenderFontsize(screen, win, norm, NULL); - setRenderFontsize(screen, win, bold, "bold"); - setRenderFontsize(screen, win, ital, "ital"); + setBrokenBoxChars(xw, False); + setRenderFontsize(xw, win, norm, NULL); + setRenderFontsize(xw, win, bold, "bold"); + setRenderFontsize(xw, win, ital, "ital"); #if OPT_BOX_CHARS setupPackedFonts(xw); @@ -2762,8 +3068,8 @@ xtermComputeFontInfo(XtermWidget xw, win->f_ascent, win->f_descent)); - checkFontInfo(win->f_height, "height"); - checkFontInfo(win->f_width, "width"); + checkFontInfo(win->f_height, "height", failed); + checkFontInfo(win->f_width, "width", failed); } /* save this information as a side-effect for double-sized characters */ @@ -3085,16 +3391,16 @@ xtermDrawBoxChar(XtermWidget xw, #endif && (ch > 127) && (ch != UCS_REPL)) { + int which = (attr_flags & BOLD) ? fBold : fNorm; unsigned n; for (n = 1; n < 32; n++) { - if (dec2ucs(n) == ch - && !((attr_flags & BOLD) - ? IsXtermMissingChar(screen, n, getNormalFont(screen, fBold)) - : IsXtermMissingChar(screen, n, getNormalFont(screen, fNorm)))) { - TRACE(("...use xterm-style linedrawing\n")); - ch = n; - break; - } + if (xtermMissingChar(n, getNormalFont(screen, which))) + continue; + if (dec2ucs(n) != ch) + continue; + TRACE(("...use xterm-style linedrawing U+%04X ->%d\n", ch, n)); + ch = n; + break; } } #endif @@ -4041,7 +4347,7 @@ save2FontList(XtermWidget xw, } if (success) { size_t limit = use_ttf ? MAX_XFT_FONTS : MAX_XLFD_FONTS; - if (count > limit && !IsEmpty(value)) { + if (count > limit && *x_skip_blanks(value)) { fprintf(stderr, "%s: too many fonts for %s, ignoring %s\n", ProgramName, whichFontEnum(which), @@ -4074,7 +4380,7 @@ allocFontList(XtermWidget xw, char *blob; blob = x_strdup(source); - if (!IsEmpty(blob)) { + if (blob != 0) { int n; int pass; char **list = 0; diff --git a/app/xterm/fontutils.h b/app/xterm/fontutils.h index 188cca507..b1b346ef3 100644 --- a/app/xterm/fontutils.h +++ b/app/xterm/fontutils.h @@ -1,4 +1,4 @@ -/* $XTermId: fontutils.h,v 1.119 2017/06/19 08:31:10 tom Exp $ */ +/* $XTermId: fontutils.h,v 1.120 2017/12/14 01:28:08 tom Exp $ */ /* * Copyright 1998-2016,2017 by Thomas E. Dickey @@ -135,6 +135,7 @@ extern void xtermSaveVTFonts (XtermWidget /* xw */); #define xtermIsDecGraphic(ch) ((ch) > 0 && (ch) < 32) #if OPT_RENDERFONT +extern Boolean maybeXftCache(XtermWidget /* xw */, XftFont * /* font */); extern Bool xtermXftMissing (XtermWidget /* xw */, XftFont * /* font */, unsigned /* wc */); extern XTermXftFonts *getMyXftFont (XtermWidget /* xw */, int /* which */, int /* fontnum */); extern XftFont *getXftFont (XtermWidget /* xw */, VTFontEnum /* which */, int /* fontnum */); diff --git a/app/xterm/graphics_regis.c b/app/xterm/graphics_regis.c index ce52b4942..57664649d 100644 --- a/app/xterm/graphics_regis.c +++ b/app/xterm/graphics_regis.c @@ -1,4 +1,4 @@ -/* $XTermId: graphics_regis.c,v 1.96 2017/06/21 01:15:19 tom Exp $ */ +/* $XTermId: graphics_regis.c,v 1.101 2017/12/30 15:06:36 tom Exp $ */ /* * Copyright 2014-2016,2017 by Ross Combs @@ -41,8 +41,7 @@ #include #endif -#include -#include +#include #include #include @@ -1742,11 +1741,14 @@ get_xft_glyph_dimensions(Display *display, XftFont *font, unsigned *w, * maxw and maxh without overstepping either dimension. */ static XftFont * -find_best_xft_font_size(Display *display, Screen *screen, char const *fontname, +find_best_xft_font_size(XtermWidget xw, + char const *fontname, unsigned maxw, unsigned maxh, unsigned max_pixels, unsigned *w, unsigned *h, unsigned *xmin, unsigned *ymin) { + Display *display = XtDisplay(xw); + Screen *screen = XtScreen(xw); XftFont *font; unsigned targeth; unsigned ii, cacheindex; @@ -1832,6 +1834,7 @@ find_best_xft_font_size(Display *display, Screen *screen, char const *fontname, XScreenNumberOfScreen(screen), pat, &status))) { font = XftFontOpenPattern(display, match); + maybeXftCache(xw, font); } } } @@ -1977,12 +1980,12 @@ get_xft_bitmap_of_character(RegisGraphicsContext const *context, * - resuse the font where possible */ #ifdef XRENDERFONT - Display *display = XtDisplay(context->destination_graphic->xw); - Screen *screen = XtScreen(context->destination_graphic->xw); + XtermWidget xw = context->destination_graphic->xw; + Display *display = XtDisplay(xw); XftFont *font; unsigned xmin = 0U, ymin = 0U; - if (!(font = find_best_xft_font_size(display, screen, fontname, maxw, maxh, + if (!(font = find_best_xft_font_size(xw, fontname, maxw, maxh, max_pixels, w, h, &xmin, &ymin))) { TRACE(("Unable to find suitable Xft font\n")); return 0; @@ -5644,13 +5647,16 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) /* FIXME: verify no leading char or button sequence */ TRACE(("sending one-shot input report with %c at %d,%d\n", ch, x, y)); +#if 0 /* FIXME - dead code */ if (ch == '\r') { /* Return only reports the location. */ sprintf(reply, "[%d,%d]\r", x, y); } else if (ch == '\177') { /* DEL exits locator mode reporting nothing. */ sprintf(reply, "\r"); - } else { + } else +#endif + { sprintf(reply, "%c[%d,%d]\r", ch, x, y); } unparseputs(context->display_graphic->xw, reply); @@ -6587,7 +6593,7 @@ parse_regis_option(RegisParseState *state, RegisGraphicsContext *context) TRACE(("found begin unbounded position stack \"%s\"\n", fragment_to_tempstr(&optionarg))); skip_regis_whitespace(&optionarg); - if (!(fragment_consumed(&optionarg) > 0U)) { + if (!fragment_consumed(&optionarg)) { TRACE(("DATA_ERROR: ignoring unexpected arguments to vector option '%c' arg \"%s\"\n", state->option, fragment_to_tempstr(&optionarg))); } @@ -7182,7 +7188,6 @@ parse_regis_items(RegisParseState *state, RegisGraphicsContext *context) char temp[MAX_MACROGRAPH_LEN]; char name; char prev = '\0'; - char next; int len = 0; name = pop_fragment(input); @@ -7195,7 +7200,7 @@ parse_regis_items(RegisParseState *state, RegisGraphicsContext *context) return 1; } for (;;) { - next = peek_fragment(input); + char next = peek_fragment(input); if (prev == '@' && next == ';') { /* FIXME: parse, handle :; */ pop_fragment(input); diff --git a/app/xterm/html.c b/app/xterm/html.c index 087e50001..7ba2c0c7f 100644 --- a/app/xterm/html.c +++ b/app/xterm/html.c @@ -1,7 +1,8 @@ -/* $XTermId: html.c,v 1.6 2017/05/30 09:14:55 tom Exp $ */ +/* $XTermId: html.c,v 1.11 2017/12/30 14:46:50 tom Exp $ */ /* - * Copyright 2015 Jens Schweikhardt + * Copyright 2015,2017 Jens Schweikhardt + * Copyright 2017 Thomas E. Dickey * * All Rights Reserved * @@ -32,8 +33,13 @@ #include #include -#define NO_COLOR ((unsigned)-1) -#define RGBPCT(c) c.red / 655.35, c.green / 655.35, c.blue / 655.35 +#define MakeDim(color) \ + color = (unsigned short) ((2 * (unsigned) color) / 3) + +#define RGBPCT(c) \ + ((double)c.red / 655.35), \ + ((double)c.green / 655.35), \ + ((double)c.blue / 655.35) #define DUMP_PREFIX "xterm" #define DUMP_SUFFIX ".xhtml" @@ -176,12 +182,22 @@ dumpHtmlLine(XtermWidget xw, int row, FILE *fp) bgcolor.pixel = xw->old_background; #if OPT_ISO_COLORS if (ld->attribs[col] & FG_COLOR) { - unsigned fg = extract_fg(xw, ld->color[col], ld->attribs[col]); - fgcolor.pixel = s->Acolors[fg].value; + Pixel fg = extract_fg(xw, ld->color[col], ld->attribs[col]); +#if OPT_DIRECT_COLOR + if (ld->attribs[col] & ATR_DIRECT_FG) + fgcolor.pixel = fg; + else +#endif + fgcolor.pixel = s->Acolors[fg].value; } if (ld->attribs[col] & BG_COLOR) { - unsigned bg = extract_bg(xw, ld->color[col], ld->attribs[col]); - bgcolor.pixel = s->Acolors[bg].value; + Pixel bg = extract_bg(xw, ld->color[col], ld->attribs[col]); +#if OPT_DIRECT_COLOR + if (ld->attribs[col] & ATR_DIRECT_BG) + bgcolor.pixel = bg; + else +#endif + bgcolor.pixel = s->Acolors[bg].value; } #endif @@ -195,9 +211,9 @@ dumpHtmlLine(XtermWidget xw, int row, FILE *fp) } #if OPT_WIDE_ATTRS if (ld->attribs[col] & ATR_FAINT) { - fgcolor.red = (unsigned short) ((2 * fgcolor.red) / 3); - fgcolor.green = (unsigned short) ((2 * fgcolor.green) / 3); - fgcolor.blue = (unsigned short) ((2 * fgcolor.blue) / 3); + MakeDim(fgcolor.red); + MakeDim(fgcolor.green); + MakeDim(fgcolor.blue); } #endif if (ld->attribs[col] & INVERSE) { diff --git a/app/xterm/linedata.c b/app/xterm/linedata.c index 0ad26e7ea..3d5dc9523 100644 --- a/app/xterm/linedata.c +++ b/app/xterm/linedata.c @@ -1,7 +1,7 @@ -/* $XTermId: linedata.c,v 1.85 2014/11/13 01:17:59 tom Exp $ */ +/* $XTermId: linedata.c,v 1.90 2017/12/25 17:12:00 tom Exp $ */ /* - * Copyright 2009-2013,2014 by Thomas E. Dickey + * Copyright 2009-2014,2017 by Thomas E. Dickey * * All Rights Reserved * @@ -31,6 +31,7 @@ */ #include +#include #include @@ -61,18 +62,6 @@ getLineData(TScreen *screen, int row) } if (row >= 0 && row <= max_row) { result = (LineData *) scrnHeadAddr(screen, buffer, (unsigned) row); - if (result != 0) { -#if 1 /* FIXME - these should be done in setupLineData, etc. */ - result->lineSize = (Dimension) MaxCols(screen); -#if OPT_WIDE_CHARS - if (screen->wide_chars) { - result->combSize = (Char) screen->max_combining; - } else { - result->combSize = 0; - } -#endif -#endif /* FIXME */ - } } return result; @@ -133,7 +122,7 @@ copyLineData(LineData *dst, CLineData *src) for (col = limit; col < dst->lineSize; ++col) { dst->attribs[col] = 0; #if OPT_ISO_COLORS - dst->color[col] = 0; + dst->color[col] = initCColor; #endif dst->charData[col] = 0; #if OPT_WIDE_CHARS @@ -147,12 +136,25 @@ copyLineData(LineData *dst, CLineData *src) #if OPT_WIDE_CHARS #define initLineExtra(screen) \ - screen->lineExtra = ((size_t) (screen->max_combining) * sizeof(IChar *)) + screen->lineExtra = ((size_t) (screen->max_combining) * sizeof(IChar *)); \ + screen->cellExtra = ((size_t) (screen->max_combining) * sizeof(IChar)) #else #define initLineExtra(screen) \ - screen->lineExtra = 0 + screen->lineExtra = 0; \ + screen->cellExtra = 0 #endif +/* + * CellData size depends on the "combiningChars" resource. + */ +#define CellDataSize(screen) (SizeOfCellData + screen->cellExtra) + +#define CellDataAddr(screen, data, cell) \ + ( (CellData *)(void *) ((char *)data + (cell * CellDataSize(screen))) ) +#define ConstCellDataAddr(screen, data, cell) \ + ( (const CellData *)(const void *) ( \ + (const char *)data + (cell * CellDataSize(screen))) ) + void initLineData(XtermWidget xw) { @@ -160,37 +162,50 @@ initLineData(XtermWidget xw) initLineExtra(screen); - TRACE(("initLineData %lu\n", (unsigned long) screen->lineExtra)); - TRACE(("...sizeof(LineData) %lu\n", (unsigned long) sizeof(LineData))); -#if OPT_ISO_COLORS - TRACE(("...sizeof(CellColor) %lu\n", (unsigned long) sizeof(CellColor))); -#endif - TRACE(("...sizeof(RowData) %lu\n", (unsigned long) sizeof(RowData))); - TRACE(("...offset(lineSize) %lu\n", (unsigned long) offsetof(LineData, lineSize))); - TRACE(("...offset(bufHead) %lu\n", (unsigned long) offsetof(LineData, bufHead))); + TRACE(("initLineData %lu (%d combining chars)\n", + (unsigned long) screen->lineExtra, screen->max_combining)); + + /* + * Per-line size/offsets. + */ + TRACE(("** sizeof(LineData) %lu\n", (unsigned long) sizeof(LineData))); + TRACE((" offset(lineSize) %lu\n", (unsigned long) offsetof(LineData, lineSize))); + TRACE((" offset(bufHead) %lu\n", (unsigned long) offsetof(LineData, bufHead))); #if OPT_WIDE_CHARS - TRACE(("...offset(combSize) %lu\n", (unsigned long) offsetof(LineData, combSize))); + TRACE((" offset(combSize) %lu\n", (unsigned long) offsetof(LineData, combSize))); #endif - TRACE(("...offset(attribs) %lu\n", (unsigned long) offsetof(LineData, attribs))); + TRACE((" offset(*attribs) %lu\n", (unsigned long) offsetof(LineData, attribs))); #if OPT_ISO_COLORS - TRACE(("...offset(color) %lu\n", (unsigned long) offsetof(LineData, color))); + TRACE((" offset(*color) %lu\n", (unsigned long) offsetof(LineData, color))); #endif - TRACE(("...offset(charData) %lu\n", (unsigned long) offsetof(LineData, charData))); - TRACE(("...offset(combData) %lu\n", (unsigned long) offsetof(LineData, combData))); + TRACE((" offset(*charData) %lu\n", (unsigned long) offsetof(LineData, charData))); + TRACE((" offset(*combData) %lu\n", (unsigned long) offsetof(LineData, combData))); + + /* + * Per-cell size/offsets. + */ + TRACE(("** sizeof(CellData) %lu\n", (unsigned long) CellDataSize(screen))); + TRACE((" offset(attribs) %lu\n", (unsigned long) offsetof(CellData, attribs))); +#if OPT_WIDE_CHARS + TRACE((" offset(combSize) %lu\n", (unsigned long) offsetof(CellData, combSize))); +#endif +#if OPT_ISO_COLORS + TRACE((" offset(color) %lu\n", (unsigned long) offsetof(CellData, color))); +#endif + TRACE((" offset(charData) %lu\n", (unsigned long) offsetof(CellData, charData))); + TRACE((" offset(combData) %lu\n", (unsigned long) offsetof(CellData, combData))); + + /* + * Data-type sizes. + */ +#if OPT_ISO_COLORS + TRACE(("** sizeof(CellColor) %lu\n", (unsigned long) sizeof(CellColor))); +#endif + TRACE(("** sizeof(IAttr) %lu\n", (unsigned long) sizeof(IAttr))); + TRACE(("** sizeof(IChar) %lu\n", (unsigned long) sizeof(IChar))); + TRACE(("** sizeof(RowData) %lu\n", (unsigned long) sizeof(RowData))); } -/* - * CellData size depends on the "combiningChars" resource. - * FIXME - revise this to reduce arithmetic... - */ -#define CellDataSize(screen) (SizeOfCellData + screen->lineExtra) - -#define CellDataAddr(screen, data, cell) \ - ( (CellData *)(void *) ((char *)data + (cell * CellDataSize(screen))) ) -#define ConstCellDataAddr(screen, data, cell) \ - ( (const CellData *)(const void *) ( \ - (const char *)data + (cell * CellDataSize(screen))) ) - CellData * newCellData(XtermWidget xw, Cardinal count) { diff --git a/app/xterm/main.c b/app/xterm/main.c index c7c135bc0..d13151fac 100644 --- a/app/xterm/main.c +++ b/app/xterm/main.c @@ -1,4 +1,4 @@ -/* $XTermId: main.c,v 1.807 2017/06/20 22:59:13 tom Exp $ */ +/* $XTermId: main.c,v 1.809 2017/12/20 01:17:24 tom Exp $ */ /* * Copyright 2002-2016,2017 by Thomas E. Dickey @@ -928,215 +928,217 @@ static String fallback_resources[] = /* Command line options table. Only resources are entered here...there is a pass over the remaining options after XrmParseCommand is let loose. */ /* *INDENT-OFF* */ +#define DATA(option,pattern,type,value) { (char *) option, (char *) pattern, type, (XPointer) value } static XrmOptionDescRec optionDescList[] = { -{"-geometry", "*vt100.geometry",XrmoptionSepArg, (XPointer) NULL}, -{"-132", "*c132", XrmoptionNoArg, (XPointer) "on"}, -{"+132", "*c132", XrmoptionNoArg, (XPointer) "off"}, -{"-ah", "*alwaysHighlight", XrmoptionNoArg, (XPointer) "on"}, -{"+ah", "*alwaysHighlight", XrmoptionNoArg, (XPointer) "off"}, -{"-aw", "*autoWrap", XrmoptionNoArg, (XPointer) "on"}, -{"+aw", "*autoWrap", XrmoptionNoArg, (XPointer) "off"}, +DATA("-geometry", "*vt100.geometry",XrmoptionSepArg, NULL), +DATA("-132", "*c132", XrmoptionNoArg, "on"), +DATA("+132", "*c132", XrmoptionNoArg, "off"), +DATA("-ah", "*alwaysHighlight", XrmoptionNoArg, "on"), +DATA("+ah", "*alwaysHighlight", XrmoptionNoArg, "off"), +DATA("-aw", "*autoWrap", XrmoptionNoArg, "on"), +DATA("+aw", "*autoWrap", XrmoptionNoArg, "off"), #ifndef NO_ACTIVE_ICON -{"-ai", "*activeIcon", XrmoptionNoArg, (XPointer) "off"}, -{"+ai", "*activeIcon", XrmoptionNoArg, (XPointer) "on"}, +DATA("-ai", "*activeIcon", XrmoptionNoArg, "off"), +DATA("+ai", "*activeIcon", XrmoptionNoArg, "on"), #endif /* NO_ACTIVE_ICON */ -{"-b", "*internalBorder",XrmoptionSepArg, (XPointer) NULL}, -{"-bc", "*cursorBlink", XrmoptionNoArg, (XPointer) "on"}, -{"+bc", "*cursorBlink", XrmoptionNoArg, (XPointer) "off"}, -{"-bcf", "*cursorOffTime",XrmoptionSepArg, (XPointer) NULL}, -{"-bcn", "*cursorOnTime",XrmoptionSepArg, (XPointer) NULL}, -{"-bdc", "*colorBDMode", XrmoptionNoArg, (XPointer) "off"}, -{"+bdc", "*colorBDMode", XrmoptionNoArg, (XPointer) "on"}, -{"-cb", "*cutToBeginningOfLine", XrmoptionNoArg, (XPointer) "off"}, -{"+cb", "*cutToBeginningOfLine", XrmoptionNoArg, (XPointer) "on"}, -{"-cc", "*charClass", XrmoptionSepArg, (XPointer) NULL}, -{"-cm", "*colorMode", XrmoptionNoArg, (XPointer) "off"}, -{"+cm", "*colorMode", XrmoptionNoArg, (XPointer) "on"}, -{"-cn", "*cutNewline", XrmoptionNoArg, (XPointer) "off"}, -{"+cn", "*cutNewline", XrmoptionNoArg, (XPointer) "on"}, -{"-cr", "*cursorColor", XrmoptionSepArg, (XPointer) NULL}, -{"-cu", "*curses", XrmoptionNoArg, (XPointer) "on"}, -{"+cu", "*curses", XrmoptionNoArg, (XPointer) "off"}, -{"-dc", "*dynamicColors",XrmoptionNoArg, (XPointer) "off"}, -{"+dc", "*dynamicColors",XrmoptionNoArg, (XPointer) "on"}, -{"-fb", "*boldFont", XrmoptionSepArg, (XPointer) NULL}, -{"-fbb", "*freeBoldBox", XrmoptionNoArg, (XPointer)"off"}, -{"+fbb", "*freeBoldBox", XrmoptionNoArg, (XPointer)"on"}, -{"-fbx", "*forceBoxChars", XrmoptionNoArg, (XPointer)"off"}, -{"+fbx", "*forceBoxChars", XrmoptionNoArg, (XPointer)"on"}, +DATA("-b", "*internalBorder",XrmoptionSepArg, NULL), +DATA("-bc", "*cursorBlink", XrmoptionNoArg, "on"), +DATA("+bc", "*cursorBlink", XrmoptionNoArg, "off"), +DATA("-bcf", "*cursorOffTime",XrmoptionSepArg, NULL), +DATA("-bcn", "*cursorOnTime",XrmoptionSepArg, NULL), +DATA("-bdc", "*colorBDMode", XrmoptionNoArg, "off"), +DATA("+bdc", "*colorBDMode", XrmoptionNoArg, "on"), +DATA("-cb", "*cutToBeginningOfLine", XrmoptionNoArg, "off"), +DATA("+cb", "*cutToBeginningOfLine", XrmoptionNoArg, "on"), +DATA("-cc", "*charClass", XrmoptionSepArg, NULL), +DATA("-cm", "*colorMode", XrmoptionNoArg, "off"), +DATA("+cm", "*colorMode", XrmoptionNoArg, "on"), +DATA("-cn", "*cutNewline", XrmoptionNoArg, "off"), +DATA("+cn", "*cutNewline", XrmoptionNoArg, "on"), +DATA("-cr", "*cursorColor", XrmoptionSepArg, NULL), +DATA("-cu", "*curses", XrmoptionNoArg, "on"), +DATA("+cu", "*curses", XrmoptionNoArg, "off"), +DATA("-dc", "*dynamicColors",XrmoptionNoArg, "off"), +DATA("+dc", "*dynamicColors",XrmoptionNoArg, "on"), +DATA("-fb", "*boldFont", XrmoptionSepArg, NULL), +DATA("-fbb", "*freeBoldBox", XrmoptionNoArg, "off"), +DATA("+fbb", "*freeBoldBox", XrmoptionNoArg, "on"), +DATA("-fbx", "*forceBoxChars", XrmoptionNoArg, "off"), +DATA("+fbx", "*forceBoxChars", XrmoptionNoArg, "on"), #ifndef NO_ACTIVE_ICON -{"-fi", "*iconFont", XrmoptionSepArg, (XPointer) NULL}, +DATA("-fi", "*iconFont", XrmoptionSepArg, NULL), #endif /* NO_ACTIVE_ICON */ #if OPT_RENDERFONT -{"-fa", "*faceName", XrmoptionSepArg, (XPointer) NULL}, -{"-fd", "*faceNameDoublesize", XrmoptionSepArg, (XPointer) NULL}, -{"-fs", "*faceSize", XrmoptionSepArg, (XPointer) NULL}, +DATA("-fa", "*faceName", XrmoptionSepArg, NULL), +DATA("-fd", "*faceNameDoublesize", XrmoptionSepArg, NULL), +DATA("-fs", "*faceSize", XrmoptionSepArg, NULL), #endif #if OPT_WIDE_ATTRS && OPT_ISO_COLORS -{"-itc", "*colorITMode", XrmoptionNoArg, (XPointer) "off"}, -{"+itc", "*colorITMode", XrmoptionNoArg, (XPointer) "on"}, +DATA("-itc", "*colorITMode", XrmoptionNoArg, "off"), +DATA("+itc", "*colorITMode", XrmoptionNoArg, "on"), #endif #if OPT_WIDE_CHARS -{"-fw", "*wideFont", XrmoptionSepArg, (XPointer) NULL}, -{"-fwb", "*wideBoldFont", XrmoptionSepArg, (XPointer) NULL}, +DATA("-fw", "*wideFont", XrmoptionSepArg, NULL), +DATA("-fwb", "*wideBoldFont", XrmoptionSepArg, NULL), #endif #if OPT_INPUT_METHOD -{"-fx", "*ximFont", XrmoptionSepArg, (XPointer) NULL}, +DATA("-fx", "*ximFont", XrmoptionSepArg, NULL), #endif #if OPT_HIGHLIGHT_COLOR -{"-hc", "*highlightColor", XrmoptionSepArg, (XPointer) NULL}, -{"-hm", "*highlightColorMode", XrmoptionNoArg, (XPointer) "on"}, -{"+hm", "*highlightColorMode", XrmoptionNoArg, (XPointer) "off"}, -{"-selfg", "*highlightTextColor", XrmoptionSepArg, (XPointer) NULL}, -{"-selbg", "*highlightColor", XrmoptionSepArg, (XPointer) NULL}, +DATA("-hc", "*highlightColor", XrmoptionSepArg, NULL), +DATA("-hm", "*highlightColorMode", XrmoptionNoArg, "on"), +DATA("+hm", "*highlightColorMode", XrmoptionNoArg, "off"), +DATA("-selfg", "*highlightTextColor", XrmoptionSepArg, NULL), +DATA("-selbg", "*highlightColor", XrmoptionSepArg, NULL), #endif #if OPT_HP_FUNC_KEYS -{"-hf", "*hpFunctionKeys",XrmoptionNoArg, (XPointer) "on"}, -{"+hf", "*hpFunctionKeys",XrmoptionNoArg, (XPointer) "off"}, +DATA("-hf", "*hpFunctionKeys",XrmoptionNoArg, "on"), +DATA("+hf", "*hpFunctionKeys",XrmoptionNoArg, "off"), #endif -{"-hold", "*hold", XrmoptionNoArg, (XPointer) "on"}, -{"+hold", "*hold", XrmoptionNoArg, (XPointer) "off"}, +DATA("-hold", "*hold", XrmoptionNoArg, "on"), +DATA("+hold", "*hold", XrmoptionNoArg, "off"), #if OPT_INITIAL_ERASE -{"-ie", "*ptyInitialErase", XrmoptionNoArg, (XPointer) "on"}, -{"+ie", "*ptyInitialErase", XrmoptionNoArg, (XPointer) "off"}, +DATA("-ie", "*ptyInitialErase", XrmoptionNoArg, "on"), +DATA("+ie", "*ptyInitialErase", XrmoptionNoArg, "off"), #endif -{"-j", "*jumpScroll", XrmoptionNoArg, (XPointer) "on"}, -{"+j", "*jumpScroll", XrmoptionNoArg, (XPointer) "off"}, +DATA("-j", "*jumpScroll", XrmoptionNoArg, "on"), +DATA("+j", "*jumpScroll", XrmoptionNoArg, "off"), #if OPT_C1_PRINT -{"-k8", "*allowC1Printable", XrmoptionNoArg, (XPointer) "on"}, -{"+k8", "*allowC1Printable", XrmoptionNoArg, (XPointer) "off"}, +DATA("-k8", "*allowC1Printable", XrmoptionNoArg, "on"), +DATA("+k8", "*allowC1Printable", XrmoptionNoArg, "off"), #endif -{"-kt", "*keyboardType", XrmoptionSepArg, (XPointer) NULL}, +DATA("-kt", "*keyboardType", XrmoptionSepArg, NULL), /* parse logging options anyway for compatibility */ -{"-l", "*logging", XrmoptionNoArg, (XPointer) "on"}, -{"+l", "*logging", XrmoptionNoArg, (XPointer) "off"}, -{"-lf", "*logFile", XrmoptionSepArg, (XPointer) NULL}, -{"-ls", "*loginShell", XrmoptionNoArg, (XPointer) "on"}, -{"+ls", "*loginShell", XrmoptionNoArg, (XPointer) "off"}, -{"-mb", "*marginBell", XrmoptionNoArg, (XPointer) "on"}, -{"+mb", "*marginBell", XrmoptionNoArg, (XPointer) "off"}, -{"-mc", "*multiClickTime", XrmoptionSepArg, (XPointer) NULL}, -{"-mesg", "*messages", XrmoptionNoArg, (XPointer) "off"}, -{"+mesg", "*messages", XrmoptionNoArg, (XPointer) "on"}, -{"-ms", "*pointerColor",XrmoptionSepArg, (XPointer) NULL}, -{"-nb", "*nMarginBell", XrmoptionSepArg, (XPointer) NULL}, -{"-nul", "*underLine", XrmoptionNoArg, (XPointer) "off"}, -{"+nul", "*underLine", XrmoptionNoArg, (XPointer) "on"}, -{"-pc", "*boldColors", XrmoptionNoArg, (XPointer) "on"}, -{"+pc", "*boldColors", XrmoptionNoArg, (XPointer) "off"}, -{"-rw", "*reverseWrap", XrmoptionNoArg, (XPointer) "on"}, -{"+rw", "*reverseWrap", XrmoptionNoArg, (XPointer) "off"}, -{"-s", "*multiScroll", XrmoptionNoArg, (XPointer) "on"}, -{"+s", "*multiScroll", XrmoptionNoArg, (XPointer) "off"}, -{"-sb", "*scrollBar", XrmoptionNoArg, (XPointer) "on"}, -{"+sb", "*scrollBar", XrmoptionNoArg, (XPointer) "off"}, +DATA("-l", "*logging", XrmoptionNoArg, "on"), +DATA("+l", "*logging", XrmoptionNoArg, "off"), +DATA("-lf", "*logFile", XrmoptionSepArg, NULL), +DATA("-ls", "*loginShell", XrmoptionNoArg, "on"), +DATA("+ls", "*loginShell", XrmoptionNoArg, "off"), +DATA("-mb", "*marginBell", XrmoptionNoArg, "on"), +DATA("+mb", "*marginBell", XrmoptionNoArg, "off"), +DATA("-mc", "*multiClickTime", XrmoptionSepArg, NULL), +DATA("-mesg", "*messages", XrmoptionNoArg, "off"), +DATA("+mesg", "*messages", XrmoptionNoArg, "on"), +DATA("-ms", "*pointerColor",XrmoptionSepArg, NULL), +DATA("-nb", "*nMarginBell", XrmoptionSepArg, NULL), +DATA("-nul", "*underLine", XrmoptionNoArg, "off"), +DATA("+nul", "*underLine", XrmoptionNoArg, "on"), +DATA("-pc", "*boldColors", XrmoptionNoArg, "on"), +DATA("+pc", "*boldColors", XrmoptionNoArg, "off"), +DATA("-rw", "*reverseWrap", XrmoptionNoArg, "on"), +DATA("+rw", "*reverseWrap", XrmoptionNoArg, "off"), +DATA("-s", "*multiScroll", XrmoptionNoArg, "on"), +DATA("+s", "*multiScroll", XrmoptionNoArg, "off"), +DATA("-sb", "*scrollBar", XrmoptionNoArg, "on"), +DATA("+sb", "*scrollBar", XrmoptionNoArg, "off"), #if OPT_REPORT_CCLASS -{"-report-charclass","*reportCClass", XrmoptionNoArg, (XPointer) "on"}, +DATA("-report-charclass","*reportCClass", XrmoptionNoArg, "on"), #endif #if OPT_REPORT_COLORS -{"-report-colors","*reportColors", XrmoptionNoArg, (XPointer) "on"}, +DATA("-report-colors", "*reportColors", XrmoptionNoArg, "on"), #endif #if OPT_REPORT_FONTS -{"-report-fonts","*reportFonts", XrmoptionNoArg, (XPointer) "on"}, +DATA("-report-fonts", "*reportFonts", XrmoptionNoArg, "on"), #endif #ifdef SCROLLBAR_RIGHT -{"-leftbar", "*rightScrollBar", XrmoptionNoArg, (XPointer) "off"}, -{"-rightbar", "*rightScrollBar", XrmoptionNoArg, (XPointer) "on"}, +DATA("-leftbar", "*rightScrollBar", XrmoptionNoArg, "off"), +DATA("-rightbar", "*rightScrollBar", XrmoptionNoArg, "on"), #endif -{"-rvc", "*colorRVMode", XrmoptionNoArg, (XPointer) "off"}, -{"+rvc", "*colorRVMode", XrmoptionNoArg, (XPointer) "on"}, -{"-sf", "*sunFunctionKeys", XrmoptionNoArg, (XPointer) "on"}, -{"+sf", "*sunFunctionKeys", XrmoptionNoArg, (XPointer) "off"}, -{"-sh", "*scaleHeight", XrmoptionSepArg, (XPointer) NULL}, -{"-si", "*scrollTtyOutput", XrmoptionNoArg, (XPointer) "off"}, -{"+si", "*scrollTtyOutput", XrmoptionNoArg, (XPointer) "on"}, -{"-sk", "*scrollKey", XrmoptionNoArg, (XPointer) "on"}, -{"+sk", "*scrollKey", XrmoptionNoArg, (XPointer) "off"}, -{"-sl", "*saveLines", XrmoptionSepArg, (XPointer) NULL}, +DATA("-rvc", "*colorRVMode", XrmoptionNoArg, "off"), +DATA("+rvc", "*colorRVMode", XrmoptionNoArg, "on"), +DATA("-sf", "*sunFunctionKeys", XrmoptionNoArg, "on"), +DATA("+sf", "*sunFunctionKeys", XrmoptionNoArg, "off"), +DATA("-sh", "*scaleHeight", XrmoptionSepArg, NULL), +DATA("-si", "*scrollTtyOutput", XrmoptionNoArg, "off"), +DATA("+si", "*scrollTtyOutput", XrmoptionNoArg, "on"), +DATA("-sk", "*scrollKey", XrmoptionNoArg, "on"), +DATA("+sk", "*scrollKey", XrmoptionNoArg, "off"), +DATA("-sl", "*saveLines", XrmoptionSepArg, NULL), #if OPT_SUNPC_KBD -{"-sp", "*sunKeyboard", XrmoptionNoArg, (XPointer) "on"}, -{"+sp", "*sunKeyboard", XrmoptionNoArg, (XPointer) "off"}, +DATA("-sp", "*sunKeyboard", XrmoptionNoArg, "on"), +DATA("+sp", "*sunKeyboard", XrmoptionNoArg, "off"), #endif #if OPT_TEK4014 -{"-t", "*tekStartup", XrmoptionNoArg, (XPointer) "on"}, -{"+t", "*tekStartup", XrmoptionNoArg, (XPointer) "off"}, +DATA("-t", "*tekStartup", XrmoptionNoArg, "on"), +DATA("+t", "*tekStartup", XrmoptionNoArg, "off"), #endif -{"-ti", "*decTerminalID",XrmoptionSepArg, (XPointer) NULL}, -{"-tm", "*ttyModes", XrmoptionSepArg, (XPointer) NULL}, -{"-tn", "*termName", XrmoptionSepArg, (XPointer) NULL}, +DATA("-ti", "*decTerminalID",XrmoptionSepArg, NULL), +DATA("-tm", "*ttyModes", XrmoptionSepArg, NULL), +DATA("-tn", "*termName", XrmoptionSepArg, NULL), #if OPT_WIDE_CHARS -{"-u8", "*utf8", XrmoptionNoArg, (XPointer) "2"}, -{"+u8", "*utf8", XrmoptionNoArg, (XPointer) "0"}, +DATA("-u8", "*utf8", XrmoptionNoArg, "2"), +DATA("+u8", "*utf8", XrmoptionNoArg, "0"), #endif #if OPT_LUIT_PROG -{"-lc", "*locale", XrmoptionNoArg, (XPointer) "on"}, -{"+lc", "*locale", XrmoptionNoArg, (XPointer) "off"}, -{"-lcc", "*localeFilter",XrmoptionSepArg, (XPointer) NULL}, -{"-en", "*locale", XrmoptionSepArg, (XPointer) NULL}, +DATA("-lc", "*locale", XrmoptionNoArg, "on"), +DATA("+lc", "*locale", XrmoptionNoArg, "off"), +DATA("-lcc", "*localeFilter",XrmoptionSepArg, NULL), +DATA("-en", "*locale", XrmoptionSepArg, NULL), #endif -{"-uc", "*cursorUnderLine", XrmoptionNoArg, (XPointer) "on"}, -{"+uc", "*cursorUnderLine", XrmoptionNoArg, (XPointer) "off"}, -{"-ulc", "*colorULMode", XrmoptionNoArg, (XPointer) "off"}, -{"+ulc", "*colorULMode", XrmoptionNoArg, (XPointer) "on"}, -{"-ulit", "*italicULMode", XrmoptionNoArg, (XPointer) "off"}, -{"+ulit", "*italicULMode", XrmoptionNoArg, (XPointer) "on"}, -{"-ut", "*utmpInhibit", XrmoptionNoArg, (XPointer) "on"}, -{"+ut", "*utmpInhibit", XrmoptionNoArg, (XPointer) "off"}, -{"-im", "*useInsertMode", XrmoptionNoArg, (XPointer) "on"}, -{"+im", "*useInsertMode", XrmoptionNoArg, (XPointer) "off"}, -{"-vb", "*visualBell", XrmoptionNoArg, (XPointer) "on"}, -{"+vb", "*visualBell", XrmoptionNoArg, (XPointer) "off"}, -{"-pob", "*popOnBell", XrmoptionNoArg, (XPointer) "on"}, -{"+pob", "*popOnBell", XrmoptionNoArg, (XPointer) "off"}, +DATA("-uc", "*cursorUnderLine", XrmoptionNoArg, "on"), +DATA("+uc", "*cursorUnderLine", XrmoptionNoArg, "off"), +DATA("-ulc", "*colorULMode", XrmoptionNoArg, "off"), +DATA("+ulc", "*colorULMode", XrmoptionNoArg, "on"), +DATA("-ulit", "*italicULMode", XrmoptionNoArg, "off"), +DATA("+ulit", "*italicULMode", XrmoptionNoArg, "on"), +DATA("-ut", "*utmpInhibit", XrmoptionNoArg, "on"), +DATA("+ut", "*utmpInhibit", XrmoptionNoArg, "off"), +DATA("-im", "*useInsertMode", XrmoptionNoArg, "on"), +DATA("+im", "*useInsertMode", XrmoptionNoArg, "off"), +DATA("-vb", "*visualBell", XrmoptionNoArg, "on"), +DATA("+vb", "*visualBell", XrmoptionNoArg, "off"), +DATA("-pob", "*popOnBell", XrmoptionNoArg, "on"), +DATA("+pob", "*popOnBell", XrmoptionNoArg, "off"), #if OPT_WIDE_CHARS -{"-wc", "*wideChars", XrmoptionNoArg, (XPointer) "on"}, -{"+wc", "*wideChars", XrmoptionNoArg, (XPointer) "off"}, -{"-mk_width", "*mkWidth", XrmoptionNoArg, (XPointer) "on"}, -{"+mk_width", "*mkWidth", XrmoptionNoArg, (XPointer) "off"}, -{"-cjk_width", "*cjkWidth", XrmoptionNoArg, (XPointer) "on"}, -{"+cjk_width", "*cjkWidth", XrmoptionNoArg, (XPointer) "off"}, +DATA("-wc", "*wideChars", XrmoptionNoArg, "on"), +DATA("+wc", "*wideChars", XrmoptionNoArg, "off"), +DATA("-mk_width", "*mkWidth", XrmoptionNoArg, "on"), +DATA("+mk_width", "*mkWidth", XrmoptionNoArg, "off"), +DATA("-cjk_width", "*cjkWidth", XrmoptionNoArg, "on"), +DATA("+cjk_width", "*cjkWidth", XrmoptionNoArg, "off"), #endif -{"-wf", "*waitForMap", XrmoptionNoArg, (XPointer) "on"}, -{"+wf", "*waitForMap", XrmoptionNoArg, (XPointer) "off"}, +DATA("-wf", "*waitForMap", XrmoptionNoArg, "on"), +DATA("+wf", "*waitForMap", XrmoptionNoArg, "off"), #if OPT_ZICONBEEP -{"-ziconbeep", "*zIconBeep", XrmoptionSepArg, (XPointer) NULL}, +DATA("-ziconbeep", "*zIconBeep", XrmoptionSepArg, NULL), #endif #if OPT_SAME_NAME -{"-samename", "*sameName", XrmoptionNoArg, (XPointer) "on"}, -{"+samename", "*sameName", XrmoptionNoArg, (XPointer) "off"}, +DATA("-samename", "*sameName", XrmoptionNoArg, "on"), +DATA("+samename", "*sameName", XrmoptionNoArg, "off"), #endif #if OPT_SESSION_MGT -{"-sm", "*sessionMgt", XrmoptionNoArg, (XPointer) "on"}, -{"+sm", "*sessionMgt", XrmoptionNoArg, (XPointer) "off"}, +DATA("-sm", "*sessionMgt", XrmoptionNoArg, "on"), +DATA("+sm", "*sessionMgt", XrmoptionNoArg, "off"), #endif #if OPT_TOOLBAR -{"-tb", "*"XtNtoolBar, XrmoptionNoArg, (XPointer) "on"}, -{"+tb", "*"XtNtoolBar, XrmoptionNoArg, (XPointer) "off"}, +DATA("-tb", "*"XtNtoolBar, XrmoptionNoArg, "on"), +DATA("+tb", "*"XtNtoolBar, XrmoptionNoArg, "off"), #endif #if OPT_MAXIMIZE -{"-maximized", "*maximized", XrmoptionNoArg, (XPointer) "on"}, -{"+maximized", "*maximized", XrmoptionNoArg, (XPointer) "off"}, -{"-fullscreen", "*fullscreen", XrmoptionNoArg, (XPointer) "on"}, -{"+fullscreen", "*fullscreen", XrmoptionNoArg, (XPointer) "off"}, +DATA("-maximized", "*maximized", XrmoptionNoArg, "on"), +DATA("+maximized", "*maximized", XrmoptionNoArg, "off"), +DATA("-fullscreen", "*fullscreen", XrmoptionNoArg, "on"), +DATA("+fullscreen", "*fullscreen", XrmoptionNoArg, "off"), #endif /* options that we process ourselves */ -{"-help", NULL, XrmoptionSkipNArgs, (XPointer) NULL}, -{"-version", NULL, XrmoptionSkipNArgs, (XPointer) NULL}, -{"-baudrate", NULL, XrmoptionSkipArg, (XPointer) NULL}, -{"-class", NULL, XrmoptionSkipArg, (XPointer) NULL}, -{"-e", NULL, XrmoptionSkipLine, (XPointer) NULL}, -{"-into", NULL, XrmoptionSkipArg, (XPointer) NULL}, +DATA("-help", NULL, XrmoptionSkipNArgs, NULL), +DATA("-version", NULL, XrmoptionSkipNArgs, NULL), +DATA("-baudrate", NULL, XrmoptionSkipArg, NULL), +DATA("-class", NULL, XrmoptionSkipArg, NULL), +DATA("-e", NULL, XrmoptionSkipLine, NULL), +DATA("-into", NULL, XrmoptionSkipArg, NULL), /* bogus old compatibility stuff for which there are standard XtOpenApplication options now */ -{"%", "*tekGeometry", XrmoptionStickyArg, (XPointer) NULL}, -{"#", ".iconGeometry",XrmoptionStickyArg, (XPointer) NULL}, -{"-T", ".title", XrmoptionSepArg, (XPointer) NULL}, -{"-n", "*iconName", XrmoptionSepArg, (XPointer) NULL}, -{"-r", "*reverseVideo",XrmoptionNoArg, (XPointer) "on"}, -{"+r", "*reverseVideo",XrmoptionNoArg, (XPointer) "off"}, -{"-rv", "*reverseVideo",XrmoptionNoArg, (XPointer) "on"}, -{"+rv", "*reverseVideo",XrmoptionNoArg, (XPointer) "off"}, -{"-w", ".borderWidth", XrmoptionSepArg, (XPointer) NULL}, +DATA("%", "*tekGeometry", XrmoptionStickyArg, NULL), +DATA("#", ".iconGeometry",XrmoptionStickyArg, NULL), +DATA("-T", ".title", XrmoptionSepArg, NULL), +DATA("-n", "*iconName", XrmoptionSepArg, NULL), +DATA("-r", "*reverseVideo",XrmoptionNoArg, "on"), +DATA("+r", "*reverseVideo",XrmoptionNoArg, "off"), +DATA("-rv", "*reverseVideo",XrmoptionNoArg, "on"), +DATA("+rv", "*reverseVideo",XrmoptionNoArg, "off"), +DATA("-w", ".borderWidth", XrmoptionSepArg, NULL), +#undef DATA }; static OptionHelp xtermOptions[] = { @@ -1449,7 +1451,7 @@ parseArg(int *num, char **argv, char **valuep) { /* table adapted from XtInitialize, used here to improve abbreviations */ /* *INDENT-OFF* */ -#define DATA(option,kind) { option, NULL, kind, (XtPointer) NULL } +#define DATA(option,kind) { (char *) option, NULL, kind, (XtPointer) NULL } static XrmOptionDescRec opTable[] = { DATA("+synchronous", XrmoptionNoArg), DATA("-background", XrmoptionSepArg), @@ -2619,7 +2621,7 @@ main(int argc, char *argv[]ENVP_ARG) command_length_with_luit = x_countargv(command_to_exec_with_luit); if (count_exec) { static char *fixup_shell[] = - {"sh", "-c", 0}; + {(char *) "sh", (char *) "-c", 0}; char *delimiter[2]; delimiter[0] = x_strdup("--"); delimiter[1] = 0; @@ -3205,7 +3207,7 @@ HsSysError(int error) handshake.status = PTY_FATALERROR; handshake.error = errno; handshake.fatal_error = error; - strncpy(handshake.buffer, ttydev, sizeof(handshake.buffer)); + strncpy(handshake.buffer, ttydev, sizeof(handshake.buffer) - 1); if (resource.ptyHandshake && (cp_pipe[1] >= 0)) { TRACE(("HsSysError errno=%d, error=%d device \"%s\"\n", diff --git a/app/xterm/menu.c b/app/xterm/menu.c index b69aa22ef..fe6214222 100644 --- a/app/xterm/menu.c +++ b/app/xterm/menu.c @@ -1,4 +1,4 @@ -/* $XTermId: menu.c,v 1.344 2017/01/02 23:46:03 tom Exp $ */ +/* $XTermId: menu.c,v 1.350 2017/12/29 20:54:09 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -476,15 +476,17 @@ typedef struct { } MenuHeader; /* This table is ordered to correspond with MenuIndex */ +#define DATA(name) { (char *)#name, name ## Entries, XtNumber(name ## Entries ) } static const MenuHeader menu_names[] = { - { "mainMenu", mainMenuEntries, XtNumber(mainMenuEntries) }, - { "vtMenu", vtMenuEntries, XtNumber(vtMenuEntries) }, - { "fontMenu", fontMenuEntries, XtNumber(fontMenuEntries) }, + DATA( mainMenu), + DATA( vtMenu), + DATA( fontMenu), #if OPT_TEK4014 - { "tekMenu", tekMenuEntries, XtNumber(tekMenuEntries) }, + DATA( tekMenu), #endif - { 0, 0, 0 }, + { NULL, 0, 0 }, }; +#undef DATA /* *INDENT-ON* */ /* @@ -788,7 +790,7 @@ domenu(Widget w, update_keyboard_type(); #ifdef OPT_PRINT_ON_EXIT screen->write_error = !IsEmpty(resource.printFileOnXError); - SetItemSensitivity(mainMenuEntries[mainMenu_write_now].widget, False); + SetItemSensitivity(mainMenuEntries[mainMenu_write_now].widget, True); SetItemSensitivity(mainMenuEntries[mainMenu_write_error].widget, screen->write_error); #endif } @@ -837,9 +839,6 @@ domenu(Widget w, update_menu_allowBoldFonts(); #if OPT_BOX_CHARS update_font_boxchars(); - SetItemSensitivity( - fontMenuEntries[fontMenu_font_boxchars].widget, - True); update_font_packed(); SetItemSensitivity( fontMenuEntries[fontMenu_font_packedfont].widget, @@ -1600,8 +1599,7 @@ do_cursorblink(Widget gw GCC_UNUSED, XtPointer closure GCC_UNUSED, XtPointer data GCC_UNUSED) { - TScreen *screen = TScreenOf(term); - ToggleCursorBlink(screen); + ToggleCursorBlink(TScreenOf(term)); } #endif @@ -2603,7 +2601,6 @@ HandleCursorBlink(Widget w, String *params, Cardinal *param_count) { - /* eventually want to see if sensitive or not */ handle_vt_toggle(do_cursorblink, TScreenOf(term)->cursor_blink, params, *param_count, w); } @@ -3615,10 +3612,17 @@ update_marginbell(void) void update_cursorblink(void) { + BlinkOps check = TScreenOf(term)->cursor_blink; + + if (check == cbAlways || + check == cbNever) { + SetItemSensitivity(vtMenuEntries[vtMenu_cursorblink].widget, False); + } UpdateCheckbox("update_cursorblink", vtMenuEntries, vtMenu_cursorblink, - TScreenOf(term)->cursor_blink); + (check == cbTrue || + check == cbAlways)); } #endif @@ -3679,10 +3683,13 @@ update_font_doublesize(void) void update_font_boxchars(void) { + SetItemSensitivity(fontMenuEntries[fontMenu_font_boxchars].widget, + !TScreenOf(term)->broken_box_chars); UpdateCheckbox("update_font_boxchars", fontMenuEntries, fontMenu_font_boxchars, - TScreenOf(term)->force_box_chars); + TScreenOf(term)->force_box_chars || + TScreenOf(term)->broken_box_chars); } void @@ -3716,6 +3723,14 @@ update_font_renderfont(void) (term->work.render_font == True)); SetItemSensitivity(fontMenuEntries[fontMenu_render_font].widget, !IsEmpty(CurrentXftFont(term))); + + if (term->work.render_font) { + TScreenOf(term)->broken_box_chars = term->work.broken_box_chars; + } else { + TScreenOf(term)->broken_box_chars = False; + } + update_font_boxchars(); + update_fontmenu(term); } #endif diff --git a/app/xterm/misc.c b/app/xterm/misc.c index 5ec503f01..643c2a131 100644 --- a/app/xterm/misc.c +++ b/app/xterm/misc.c @@ -1,4 +1,4 @@ -/* $XTermId: misc.c,v 1.757 2017/06/20 08:52:18 tom Exp $ */ +/* $XTermId: misc.c,v 1.785 2017/12/26 11:42:24 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -126,6 +126,9 @@ (event.xcrossing.window == XtWindow(XtParent(xw)))) #endif +#define VB_DELAY screen->visualBellDelay +#define EVENT_DELAY TScreenOf(term)->nextEventDelay + static Boolean xtermAllocColor(XtermWidget, XColor *, const char *); static Cursor make_hidden_cursor(XtermWidget); @@ -562,7 +565,7 @@ xtermAppPending(void) * this case, to avoid max'ing the CPU. */ if (hold_screen && caught_intr && !found) { - Sleep(10); + Sleep(EVENT_DELAY); } return result; } @@ -613,7 +616,7 @@ xevents(void) * this function, e.g., those handled in in_put(). */ if (screen->waitingForTrackInfo) { - Sleep(10); + Sleep(EVENT_DELAY); return; } XtAppNextEvent(app_con, &event); @@ -1241,8 +1244,6 @@ Bell(XtermWidget xw, int which, int percent) } } -#define VB_DELAY screen->visualBellDelay - static void flashWindow(TScreen *screen, Window window, GC visualGC, unsigned width, unsigned height) { @@ -1311,7 +1312,14 @@ xtermWarning(const char *fmt,...) va_list ap; fflush(stdout); - TRACE(("xtermWarning fmt='%s'\n", fmt)); + +#if OPT_TRACE + va_start(ap, fmt); + Trace("xtermWarning: "); + TraceVA(fmt, ap); + va_end(ap); +#endif + fprintf(stderr, "%s: ", ProgramName); va_start(ap, fmt); vfprintf(stderr, fmt, ap); @@ -1329,7 +1337,14 @@ xtermPerror(const char *fmt,...) va_list ap; fflush(stdout); - TRACE(("xtermPerror fmt='%s', msg='%s'\n", fmt, NonNull(msg))); + +#if OPT_TRACE + va_start(ap, fmt); + Trace("xtermPerror: "); + TraceVA(fmt, ap); + va_end(ap); +#endif + fprintf(stderr, "%s: ", ProgramName); va_start(ap, fmt); vfprintf(stderr, fmt, ap); @@ -2195,6 +2210,19 @@ FlushLog(XtermWidget xw) /***====================================================================***/ +static unsigned +maskToShift(unsigned long mask) +{ + unsigned result = 0; + if (mask != 0) { + while ((mask & 1) == 0) { + mask >>= 1; + ++result; + } + } + return result; +} + int getVisualInfo(XtermWidget xw) { @@ -2224,10 +2252,25 @@ rgb masks (%04lx/%04lx/%04lx)\n" if ((xw->visInfo != 0) && (xw->numVisuals > 0)) { XVisualInfo *vi = xw->visInfo; + xw->rgb_shifts[0] = maskToShift(vi->red_mask); + xw->rgb_shifts[1] = maskToShift(vi->green_mask); + xw->rgb_shifts[2] = maskToShift(vi->blue_mask); + + xw->has_rgb = ((vi->red_mask != 0) && + (vi->green_mask != 0) && + (vi->blue_mask != 0) && + ((vi->red_mask & vi->green_mask) == 0) && + ((vi->green_mask & vi->blue_mask) == 0) && + ((vi->blue_mask & vi->red_mask) == 0)); + if (resource.reportColors) { printf(MYFMT, MYARG); } TRACE((MYFMT, MYARG)); + TRACE(("...shifts %u/%u/%u\n", + xw->rgb_shifts[0], + xw->rgb_shifts[1], + xw->rgb_shifts[2])); } } return (xw->visInfo != 0) && (xw->numVisuals > 0); @@ -2892,6 +2935,100 @@ xtermClosestColor(XtermWidget xw, int find_red, int find_green, int find_blue) return result; } +#if OPT_DIRECT_COLOR +int +getDirectColor(XtermWidget xw, int red, int green, int blue) +{ +#define nRGB(name,shift) \ + ((unsigned long)(name << xw->rgb_shifts[shift]) \ + & xw->visInfo->name ##_mask) + MyPixel result = (MyPixel) (nRGB(red, 0) | nRGB(green, 1) | nRGB(blue, 2)); + return (int) result; +} + +static void +formatDirectColor(char *target, XtermWidget xw, unsigned value) +{ +#define fRGB(name, shift) \ + (value & xw->visInfo->name ## _mask) >> xw->rgb_shifts[shift] + sprintf(target, "%lu:%lu:%lu", fRGB(red, 0), fRGB(green, 1), fRGB(blue, 2)); +} +#endif /* OPT_DIRECT_COLOR */ + +#define fg2SGR(n) \ + (n) >= 8 ? 9 : 3, \ + (n) >= 8 ? (n) - 8 : (n) +#define bg2SGR(n) \ + (n) >= 8 ? 10 : 4, \ + (n) >= 8 ? (n) - 8 : (n) + +#define EndOf(s) (s) + strlen(s) + +char * +xtermFormatSGR(XtermWidget xw, char *target, unsigned attr, int fg, int bg) +{ + TScreen *screen = TScreenOf(xw); + char *msg = target; + + strcpy(target, "0"); + if (attr & BOLD) + strcat(msg, ";1"); + if (attr & UNDERLINE) + strcat(msg, ";4"); + if (attr & BLINK) + strcat(msg, ";5"); + if (attr & INVERSE) + strcat(msg, ";7"); + if (attr & INVISIBLE) + strcat(msg, ";8"); +#if OPT_WIDE_ATTRS + if (attr & ATR_FAINT) + strcat(msg, ";2"); + if (attr & ATR_ITALIC) + strcat(msg, ";3"); + if (attr & ATR_STRIKEOUT) + strcat(msg, ";9"); + if (attr & ATR_DBL_UNDER) + strcat(msg, ";21"); +#endif +#if OPT_256_COLORS || OPT_88_COLORS + if_OPT_ISO_COLORS(screen, { + if (attr & FG_COLOR) { + if_OPT_DIRECT_COLOR2(screen, hasDirectFG(attr), { + strcat(msg, ";38:2::"); + formatDirectColor(EndOf(msg), xw, (unsigned) fg); + } else + )if (fg >= 16) { + sprintf(EndOf(msg), ";38:5:%d", fg); + } else { + sprintf(EndOf(msg), ";%d%d", fg2SGR(fg)); + } + } + if (attr & BG_COLOR) { + if_OPT_DIRECT_COLOR2(screen, hasDirectBG(attr), { + strcat(msg, ";48:2::"); + formatDirectColor(EndOf(msg), xw, (unsigned) bg); + } else + )if (bg >= 16) { + sprintf(EndOf(msg), ";48:5:%d", bg); + } else { + sprintf(EndOf(msg), ";%d%d", bg2SGR(bg)); + } + } + }); +#elif OPT_ISO_COLORS + if_OPT_ISO_COLORS(screen, { + if (attr & FG_COLOR) { + sprintf(EndOf(msg), ";%d%d", fg2SGR(fg)); + } + if (attr & BG_COLOR) { + sprintf(EndOf(msg), ";%d%d", bg2SGR(bg)); + } + }); +#endif + return target; +} + #if OPT_PASTE64 static void ManipulateSelectionData(XtermWidget xw, TScreen *screen, char *buf, int final) @@ -4079,6 +4216,7 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) cp++; if (*cp++ == 'q') { if (!strcmp(cp, "\"q")) { /* DECSCA */ + TRACE(("DECRQSS -> DECSCA\n")); sprintf(reply, "%d%s", (screen->protected_mode == DEC_PROTECT) && (xw->flags & PROTECTED) ? 1 : 0, @@ -4088,6 +4226,7 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) /* actually none of DECRQSS is valid for vt100's */ break; } + TRACE(("DECRQSS -> DECSCL\n")); sprintf(reply, "%d%s%s", (screen->vtXX_level ? screen->vtXX_level : 1) + 60, @@ -4097,11 +4236,13 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) : "", cp); } else if (!strcmp(cp, "r")) { /* DECSTBM */ + TRACE(("DECRQSS -> DECSTBM\n")); sprintf(reply, "%d;%dr", screen->top_marg + 1, screen->bot_marg + 1); } else if (!strcmp(cp, "s")) { /* DECSLRM */ if (screen->vtXX_level >= 4) { /* VT420 */ + TRACE(("DECRQSS -> DECSLRM\n")); sprintf(reply, "%d;%ds", screen->lft_marg + 1, screen->rgt_marg + 1); @@ -4109,62 +4250,8 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) okay = False; } } else if (!strcmp(cp, "m")) { /* SGR */ - strcpy(reply, "0"); - if (xw->flags & BOLD) - strcat(reply, ";1"); - if (xw->flags & UNDERLINE) - strcat(reply, ";4"); - if (xw->flags & BLINK) - strcat(reply, ";5"); - if (xw->flags & INVERSE) - strcat(reply, ";7"); - if (xw->flags & INVISIBLE) - strcat(reply, ";8"); -#if OPT_256_COLORS || OPT_88_COLORS - if_OPT_ISO_COLORS(screen, { - if (xw->flags & FG_COLOR) { - if (xw->cur_foreground >= 16) - sprintf(reply + strlen(reply), - ";38;5;%d", xw->cur_foreground); - else - sprintf(reply + strlen(reply), - ";%d%d", - xw->cur_foreground >= 8 ? 9 : 3, - xw->cur_foreground >= 8 ? - xw->cur_foreground - 8 : - xw->cur_foreground); - } - if (xw->flags & BG_COLOR) { - if (xw->cur_background >= 16) - sprintf(reply + strlen(reply), - ";48;5;%d", xw->cur_foreground); - else - sprintf(reply + strlen(reply), - ";%d%d", - xw->cur_background >= 8 ? 10 : 4, - xw->cur_background >= 8 ? - xw->cur_background - 8 : - xw->cur_background); - } - }); -#elif OPT_ISO_COLORS - if_OPT_ISO_COLORS(screen, { - if (xw->flags & FG_COLOR) - sprintf(reply + strlen(reply), - ";%d%d", - xw->cur_foreground >= 8 ? 9 : 3, - xw->cur_foreground >= 8 ? - xw->cur_foreground - 8 : - xw->cur_foreground); - if (xw->flags & BG_COLOR) - sprintf(reply + strlen(reply), - ";%d%d", - xw->cur_background >= 8 ? 10 : 4, - xw->cur_background >= 8 ? - xw->cur_background - 8 : - xw->cur_background); - }); -#endif + TRACE(("DECRQSS -> SGR\n")); + xtermFormatSGR(xw, reply, xw->flags, xw->cur_foreground, xw->cur_background); strcat(reply, "m"); } else if (!strcmp(cp, " q")) { /* DECSCUSR */ int code = STEADY_BLOCK; @@ -4176,21 +4263,19 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen) if (screen->cursor_blink_esc != 0) code -= 1; #endif + TRACE(("reply DECSCUSR\n")); sprintf(reply, "%d%s", code, cp); - } else - okay = False; - - if (okay) { - unparseputc1(xw, ANSI_DCS); - unparseputc(xw, '1'); - unparseputc(xw, '$'); - unparseputc(xw, 'r'); - cp = reply; - unparseputs(xw, cp); - unparseputc1(xw, ANSI_ST); } else { - unparseputc(xw, ANSI_CAN); + okay = False; } + + unparseputc1(xw, ANSI_DCS); + unparseputc(xw, okay ? '1' : '0'); + unparseputc(xw, '$'); + unparseputc(xw, 'r'); + cp = reply; + unparseputs(xw, cp); + unparseputc1(xw, ANSI_ST); } else { unparseputc(xw, ANSI_CAN); } @@ -4337,17 +4422,18 @@ enum { * Only one mode can be reported at a time. */ void -do_rpm(XtermWidget xw, int nparams, int *params) +do_ansi_rqm(XtermWidget xw, int nparams, int *params) { ANSI reply; int count = 0; - TRACE(("do_rpm %d:%d\n", nparams, params[0])); + TRACE(("do_ansi_rqm %d:%d\n", nparams, params[0])); memset(&reply, 0, sizeof(reply)); if (nparams >= 1) { - int result = 0; + int result = mdUnknown; + /* DECRQM can only ask about one mode at a time */ switch (params[0]) { case 1: /* GATM */ result = mdAlwaysReset; @@ -4394,19 +4480,20 @@ do_rpm(XtermWidget xw, int nparams, int *params) } void -do_decrpm(XtermWidget xw, int nparams, int *params) +do_dec_rqm(XtermWidget xw, int nparams, int *params) { ANSI reply; int count = 0; - TRACE(("do_decrpm %d:%d\n", nparams, params[0])); + TRACE(("do_dec_rqm %d:%d\n", nparams, params[0])); memset(&reply, 0, sizeof(reply)); if (nparams >= 1) { TScreen *screen = TScreenOf(xw); - int result = 0; + int result = mdUnknown; - switch (params[0]) { + /* DECRQM can only ask about one mode at a time */ + switch ((DECSET_codes) params[0]) { case srm_DECCKM: result = MdFlag(xw->keyboard.flags, MODE_DECCKM); break; @@ -4444,8 +4531,31 @@ do_decrpm(XtermWidget xw, int nparams, int *params) break; #endif #if OPT_BLINK_CURS - case srm_ATT610_BLINK: /* att610: Start/stop blinking cursor */ - result = MdBool(screen->cursor_blink_res); + case srm_ATT610_BLINK: /* AT&T 610: Start/stop blinking cursor */ + result = MdBool(screen->cursor_blink_esc); + break; + case srm_CURSOR_BLINK_OPS: + switch (screen->cursor_blink) { + case cbTrue: + result = mdMaybeSet; + break; + case cbFalse: + result = mdMaybeReset; + break; + case cbAlways: + result = mdAlwaysSet; + break; + case cbLAST: + /* FALLTHRU */ + case cbNever: + result = mdAlwaysReset; + break; + } + break; + case srm_XOR_CURSOR_BLINKS: + result = (screen->cursor_blink_xor + ? mdAlwaysSet + : mdAlwaysReset); break; #endif case srm_DECPFF: /* print form feed */ @@ -4477,7 +4587,11 @@ do_decrpm(XtermWidget xw, int nparams, int *params) result = MdBool(screen->curses); break; case srm_DECNRCM: /* national charset (VT220) */ - result = MdFlag(xw->flags, NATIONAL); + if (screen->vtXX_level >= 2) { + result = MdFlag(xw->flags, NATIONAL); + } else { + result = 0; + } break; case srm_MARGIN_BELL: /* margin bell */ result = MdBool(screen->marginbell); @@ -4506,7 +4620,11 @@ do_decrpm(XtermWidget xw, int nparams, int *params) result = MdFlag(xw->keyboard.flags, MODE_DECBKM); break; case srm_DECLRMM: - result = MdFlag(xw->flags, LEFT_RIGHT); + if (screen->vtXX_level >= 4) { /* VT420 */ + result = MdFlag(xw->flags, LEFT_RIGHT); + } else { + result = 0; + } break; #if OPT_SIXEL_GRAPHICS case srm_DECSDM: @@ -4514,7 +4632,11 @@ do_decrpm(XtermWidget xw, int nparams, int *params) break; #endif case srm_DECNCSM: - result = MdFlag(xw->flags, NOCLEAR_COLM); + if (screen->vtXX_level >= 5) { /* VT510 */ + result = MdFlag(xw->flags, NOCLEAR_COLM); + } else { + result = 0; + } break; case srm_VT200_MOUSE: /* xterm bogus sequence */ result = MdBool(screen->send_mouse_pos == VT200_MOUSE); @@ -4580,7 +4702,13 @@ do_decrpm(XtermWidget xw, int nparams, int *params) case srm_POP_ON_BELL: result = MdBool(screen->poponbell); break; - case srm_TITE_INHIBIT: + case srm_KEEP_CLIPBOARD: + result = MdBool(screen->keepClipboard); + break; + case srm_ALLOW_ALTBUF: + result = MdBool(xw->misc.titeInhibit); + break; + case srm_SAVE_CURSOR: result = MdBool(screen->sc[screen->whichBuf].saved); break; #if OPT_TCAP_FKEYS @@ -4613,22 +4741,22 @@ do_decrpm(XtermWidget xw, int nparams, int *params) #endif #if OPT_READLINE case srm_BUTTON1_MOVE_POINT: - result = MdBool(screen->click1_moves); + result = MdBool(SCREEN_FLAG(screen, click1_moves)); break; case srm_BUTTON2_MOVE_POINT: - result = MdBool(screen->paste_moves); + result = MdBool(SCREEN_FLAG(screen, paste_moves)); break; case srm_DBUTTON3_DELETE: - result = MdBool(screen->dclick3_deletes); + result = MdBool(SCREEN_FLAG(screen, dclick3_deletes)); break; case srm_PASTE_IN_BRACKET: - result = MdBool(screen->paste_brackets); + result = MdBool(SCREEN_FLAG(screen, paste_brackets)); break; case srm_PASTE_QUOTE: - result = MdBool(screen->paste_quotes); + result = MdBool(SCREEN_FLAG(screen, paste_quotes)); break; case srm_PASTE_LITERAL_NL: - result = MdBool(screen->paste_literal_nl); + result = MdBool(SCREEN_FLAG(screen, paste_literal_nl)); break; #endif /* OPT_READLINE */ #if OPT_SIXEL_GRAPHICS @@ -5262,7 +5390,7 @@ NormalExit(void) hold_screen = 2; while (hold_screen) { xevents(); - Sleep(10); + Sleep(EVENT_DELAY); } } #if OPT_SESSION_MGT diff --git a/app/xterm/package/debian/changelog b/app/xterm/package/debian/changelog index d234bee5a..c6eba89b6 100644 --- a/app/xterm/package/debian/changelog +++ b/app/xterm/package/debian/changelog @@ -4,6 +4,12 @@ xterm-dev (331) unstable; urgency=low -- Thomas E. Dickey Tue, 08 Aug 2017 19:08:43 -0400 +xterm-dev (331) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Tue, 08 Aug 2017 19:08:43 -0400 + xterm-dev (330) unstable; urgency=low * maintenance updates diff --git a/app/xterm/package/freebsd/Makefile b/app/xterm/package/freebsd/Makefile index aec6da132..a9dc2de83 100644 --- a/app/xterm/package/freebsd/Makefile +++ b/app/xterm/package/freebsd/Makefile @@ -5,9 +5,9 @@ # and "make makesum". PORTNAME= xterm -PORTVERSION= 330 +PORTVERSION= 331 CATEGORIES= x11 -MASTER_SITES= ftp://invisible-island.net/xterm/ \ +MASTER_SITES= ftp://ftp.invisible-island.net/xterm/ \ CRITICAL PKGNAMESUFFIX= -dev EXTRACT_SUFX= .tgz @@ -29,7 +29,7 @@ LIBS+= -L${LOCALBASE}/lib ICONVERSION= 1 -OPTIONS_DEFINE= WCHAR LUIT DECTERM PCRE DABBREV 256COLOR SIXEL GNOME LOGGING TOOLBAR +OPTIONS_DEFINE= WCHAR LUIT DECTERM PCRE PCRE2 DABBREV 256COLOR SIXEL GNOME LOGGING TOOLBAR OPTIONS_RADIO= 3D OPTIONS_RADIO_3D= XAW3D XAW3DXFT NEXTAW @@ -54,6 +54,8 @@ WCHAR_CONFIGURE_ENABLE= wide-chars DECTERM_CONFIGURE_ENABLE= dec-locator PCRE_CONFIGURE_WITH= pcre PCRE_LIB_DEPENDS= libpcre.so:${PORTSDIR}/devel/pcre +PCRE2_CONFIGURE_WITH= pcre2 +PCRE2_LIB_DEPENDS= libpcre2-8.so:${PORTSDIR}/devel/pcre2 DABBREV_CONFIGURE_ENABLE= dabbrev SIXEL_CONFIGURE_ENABLE= sixel-graphics GNOME_USES= desktop-file-utils diff --git a/app/xterm/print.c b/app/xterm/print.c index 5b42ff3a4..5040dbe72 100644 --- a/app/xterm/print.c +++ b/app/xterm/print.c @@ -1,4 +1,4 @@ -/* $XTermId: print.c,v 1.161 2017/06/19 08:11:13 tom Exp $ */ +/* $XTermId: print.c,v 1.166 2017/12/19 23:47:15 tom Exp $ */ /* * Copyright 1997-2016,2017 by Thomas E. Dickey @@ -75,18 +75,21 @@ static void stringToPrinter(XtermWidget /* xw */ , const char * /*str */ ); static void -closePrinter(XtermWidget xw GCC_UNUSED) +closePrinter(XtermWidget xw) { - if (xtermHasPrinter(xw) != 0) { - TScreen *screen = TScreenOf(xw); + TScreen *screen = TScreenOf(xw); + if (SPS.fp != 0) { + if (SPS.toFile) { + fclose(SPS.fp); + SPS.fp = 0; + } else if (xtermHasPrinter(xw) != 0) { #ifdef VMS - char pcommand[256]; - (void) sprintf(pcommand, "%s %s;", - SPS.printer_command, - VMS_TEMP_PRINT_FILE); + char pcommand[256]; + (void) sprintf(pcommand, "%s %s;", + SPS.printer_command, + VMS_TEMP_PRINT_FILE); #endif - if (SPS.fp != 0) { DEBUG_MSG("closePrinter\n"); pclose(SPS.fp); TRACE(("closed printer, waiting...\n")); @@ -116,8 +119,6 @@ printCursorLine(XtermWidget xw) printLine(xw, screen->cur_row, '\n', getPrinterFlags(xw, NULL, 0)); } -#define NO_COLOR ((unsigned)-1) - /* * DEC's manual doesn't document whether trailing blanks are removed, or what * happens with a line that is entirely blank. This function prints the @@ -133,11 +134,11 @@ printLine(XtermWidget xw, int row, unsigned chr, PrinterFlags *p) #if OPT_ISO_COLORS && OPT_PRINT_COLORS #define ColorOf(ld,col) (ld->color[col]) #endif - unsigned fg = NO_COLOR; - unsigned bg = NO_COLOR; + Pixel fg = NO_COLOR; + Pixel bg = NO_COLOR; #if OPT_PRINT_COLORS - unsigned last_fg = NO_COLOR; - unsigned last_bg = NO_COLOR; + Pixel last_fg = NO_COLOR; + Pixel last_bg = NO_COLOR; #endif ld = getLineData(screen, inx); @@ -179,19 +180,19 @@ printLine(XtermWidget xw, int row, unsigned chr, PrinterFlags *p) } } #endif - if ((((ld->attribs[col] & SGR_MASK) != attr) + if ((((ld->attribs[col] & ATTRIBUTES) != attr) #if OPT_PRINT_COLORS || (last_fg != fg) || (last_bg != bg) #endif ) && ch) { - attr = ld->attribs[col] & SGR_MASK; + attr = (IAttr) (ld->attribs[col] & ATTRIBUTES); #if OPT_PRINT_COLORS last_fg = fg; last_bg = bg; #endif if (p->print_attributes) - send_SGR(xw, attr, fg, bg); + send_SGR(xw, attr, (unsigned) fg, (unsigned) bg); } if (ch == 0) @@ -383,38 +384,16 @@ send_SGR(XtermWidget xw, unsigned attr, unsigned fg, unsigned bg) { char msg[80]; - strcpy(msg, "\033[0"); - if (attr & BOLD) - strcat(msg, ";1"); -#if OPT_WIDE_ATTRS - if (attr & ATR_FAINT) - strcat(msg, ";2"); - if (attr & ATR_ITALIC) - strcat(msg, ";3"); -#endif - if (attr & UNDERLINE) - strcat(msg, ";4"); /* typo? DEC documents this as '2' */ - if (attr & BLINK) - strcat(msg, ";5"); - if (attr & INVERSE) /* typo? DEC documents this as invisible */ - strcat(msg, ";7"); -#if OPT_PRINT_COLORS - if (bg != NO_COLOR) { - sprintf(msg + strlen(msg), ";%u", (bg < 8) ? (40 + bg) : (92 + bg)); - } - if (fg != NO_COLOR) { -#if OPT_PC_COLORS +#if OPT_ISO_COLORS && OPT_PC_COLORS + if ((attr & FG_COLOR) && (fg != NO_COLOR)) { if (TScreenOf(xw)->boldColors && fg > 8 && (attr & BOLD) != 0) fg -= 8; -#endif - sprintf(msg + strlen(msg), ";%u", (fg < 8) ? (30 + fg) : (82 + fg)); } -#else - (void) bg; - (void) fg; #endif + strcpy(msg, "\033["); + xtermFormatSGR(xw, msg + strlen(msg), attr, (int) fg, (int) bg); strcat(msg, "m"); stringToPrinter(xw, msg); } @@ -427,7 +406,7 @@ charToPrinter(XtermWidget xw, unsigned chr) { TScreen *screen = TScreenOf(xw); - if (!SPS.isOpen && xtermHasPrinter(xw)) { + if (!SPS.isOpen && (SPS.toFile || xtermHasPrinter(xw))) { switch (SPS.toFile) { /* * write to a pipe. diff --git a/app/xterm/ptyx.h b/app/xterm/ptyx.h index d1cfa158e..380f9db63 100644 --- a/app/xterm/ptyx.h +++ b/app/xterm/ptyx.h @@ -1,4 +1,4 @@ -/* $XTermId: ptyx.h,v 1.854 2017/05/29 00:49:11 tom Exp $ */ +/* $XTermId: ptyx.h,v 1.879 2017/12/30 14:42:05 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -80,7 +80,7 @@ #include -#ifdef HAVE_STDINT_H +#if defined(HAVE_STDINT_H) || !defined(HAVE_CONFIG_H) #include #define DECONST(type,s) ((type *)(intptr_t)(const type *)(s)) #else @@ -615,6 +615,10 @@ typedef struct { #define OPT_ISO_COLORS 1 /* true if xterm is configured with ISO colors */ #endif +#ifndef OPT_DIRECT_COLOR +#define OPT_DIRECT_COLOR 0 /* true if xterm is configured with direct-colors */ +#endif + #ifndef OPT_256_COLORS #define OPT_256_COLORS 0 /* true if xterm is configured with 256 colors */ #endif @@ -1018,7 +1022,7 @@ typedef enum { /* * Use this enumerated type to check consistency among dpmodes(), savemodes() - * restoremodes() and do_decrpm(). + * restoremodes() and do_dec_rqm(). */ typedef enum { srm_DECCKM = 1 @@ -1035,6 +1039,8 @@ typedef enum { #endif #if OPT_BLINK_CURS ,srm_ATT610_BLINK = 12 + ,srm_CURSOR_BLINK_OPS = 13 + ,srm_XOR_CURSOR_BLINKS = 14 #endif ,srm_DECPFF = 18 ,srm_DECPEX = 19 @@ -1054,8 +1060,6 @@ typedef enum { #ifdef ALLOWLOGGING ,srm_ALLOWLOGGING = 46 #endif - ,srm_OPT_ALTBUF_CURSOR = 1049 - ,srm_OPT_ALTBUF = 1047 ,srm_ALTBUF = 47 ,srm_DECNKM = 66 ,srm_DECBKM = 67 @@ -1091,7 +1095,10 @@ typedef enum { ,srm_BELL_IS_URGENT = 1042 ,srm_POP_ON_BELL = 1043 ,srm_KEEP_CLIPBOARD = 1044 - ,srm_TITE_INHIBIT = 1048 + ,srm_ALLOW_ALTBUF = 1046 + ,srm_OPT_ALTBUF = 1047 + ,srm_SAVE_CURSOR = 1048 + ,srm_OPT_ALTBUF_CURSOR = 1049 #if OPT_TCAP_FKEYS ,srm_TCAP_FKEYS = 1050 #endif @@ -1138,6 +1145,16 @@ typedef enum { ,NSELECTUNITS } SelectUnit; +#if OPT_BLINK_CURS +typedef enum { + cbFalse = 0 + , cbTrue + , cbAlways + , cbNever + , cbLAST +} BlinkOps; +#endif + typedef enum { ecSetColor = 1 , ecGetColor @@ -1261,6 +1278,8 @@ typedef enum { # define NUM_ANSI_COLORS MIN_ANSI_COLORS #endif +#define okIndexedColor(n) ((n) >= 0 && (n) < NUM_ANSI_COLORS) + #if NUM_ANSI_COLORS > MIN_ANSI_COLORS # define OPT_EXT_COLORS 1 #else @@ -1322,6 +1341,14 @@ typedef enum { # define if_OPT_ISO_COLORS(screen, code) /* nothing */ #endif +#if OPT_DIRECT_COLOR +# define if_OPT_DIRECT_COLOR(screen, code) if (screen->direct_color) code +# define if_OPT_DIRECT_COLOR2(screen, test, code) if (screen->direct_color && (test)) code +#else +# define if_OPT_DIRECT_COLOR(screen, code) /* nothing */ +# define if_OPT_DIRECT_COLOR2(screen, test, code) /* nothing */ +#endif + #define COLOR_RES_NAME(root) "color" root #if OPT_COLOR_CLASS @@ -1538,36 +1565,79 @@ typedef struct { /***====================================================================***/ +/* + * Pixel (and its components) are declared as unsigned long, but even for RGB + * we need no more than 32-bits. + */ +typedef uint32_t MyPixel; +typedef int32_t MyColor; + #if OPT_ISO_COLORS -#if OPT_256_COLORS || OPT_88_COLORS +#if OPT_DIRECT_COLOR +typedef struct { + MyColor fg; + MyColor bg; +} CellColor; + +#define isSameCColor(p,q) (!memcmp(&(p), &(q), sizeof(CellColor))) + +#elif OPT_256_COLORS || OPT_88_COLORS + #define COLOR_BITS 8 typedef unsigned short CellColor; + #else + #define COLOR_BITS 4 typedef Char CellColor; + #endif #else typedef unsigned CellColor; #endif -#define BITS2MASK(b) ((1 << b) - 1) +#define NO_COLOR ((unsigned)-1) -#define COLOR_MASK BITS2MASK(COLOR_BITS) +#ifndef isSameCColor +#define isSameCColor(p,q) ((p) == (q)) +#endif -#define GetCellColorFG(src) ((src) & COLOR_MASK) -#define GetCellColorBG(src) (((src) >> COLOR_BITS) & COLOR_MASK) +#define BITS2MASK(b) ((1 << b) - 1) + +#define COLOR_MASK BITS2MASK(COLOR_BITS) + +#if OPT_DIRECT_COLOR +#define clrDirectFG(flags) UIntClr(flags, ATR_DIRECT_FG) +#define clrDirectBG(flags) UIntClr(flags, ATR_DIRECT_BG) +#define GetCellColorFG(data) ((data).fg) +#define GetCellColorBG(data) ((data).bg) +#define hasDirectFG(flags) ((flags) & ATR_DIRECT_FG) +#define hasDirectBG(flags) ((flags) & ATR_DIRECT_BG) +#define setDirectFG(flags,test) if (test) UIntSet(flags, ATR_DIRECT_FG); else UIntClr(flags, ATR_DIRECT_BG) +#define setDirectBG(flags,test) if (test) UIntSet(flags, ATR_DIRECT_BG); else UIntClr(flags, ATR_DIRECT_BG) +#else +#define clrDirectFG(flags) /* nothing */ +#define clrDirectBG(flags) /* nothing */ +#define GetCellColorFG(data) ((data) & COLOR_MASK) +#define GetCellColorBG(data) (((data) >> COLOR_BITS) & COLOR_MASK) +#define hasDirectFG(flags) 0 +#define hasDirectBG(flags) 0 +#define setDirectFG(flags,test) (void)(test) +#define setDirectBG(flags,test) (void)(test) +#endif +extern CellColor blank_cell_color; typedef Char RowData; /* wrap/blink, and DEC single-double chars */ -#define LINEFLAG_BITS 4 -#define LINEFLAG_MASK BITS2MASK(LINEFLAG_BITS) +#define LINEFLAG_BITS 4 +#define LINEFLAG_MASK BITS2MASK(LINEFLAG_BITS) -#define GetLineFlags(ld) ((ld)->bufHead & LINEFLAG_MASK) +#define GetLineFlags(ld) ((ld)->bufHead & LINEFLAG_MASK) #if OPT_DEC_CHRSET -#define SetLineFlags(ld,xx) (ld)->bufHead = (RowData) ((ld->bufHead & (DBLCS_MASK << LINEFLAG_BITS)) | (xx & LINEFLAG_MASK)) +#define SetLineFlags(ld,xx) (ld)->bufHead = (RowData) ((ld->bufHead & (DBLCS_MASK << LINEFLAG_BITS)) | (xx & LINEFLAG_MASK)) #else -#define SetLineFlags(ld,xx) (ld)->bufHead = (RowData) (xx & LINEFLAG_MASK) +#define SetLineFlags(ld,xx) (ld)->bufHead = (RowData) (xx & LINEFLAG_MASK) #endif typedef IChar CharData; @@ -1676,6 +1746,11 @@ typedef struct { XftFont * font; FontMap map; } XTermXftFonts; + +typedef struct _ListXftFonts { + struct _ListXftFonts *next; + XftFont * font; +} ListXftFonts; #endif typedef struct { @@ -1687,6 +1762,7 @@ typedef struct { /* indices into save_modes[] */ typedef enum { + DP_ALLOW_ALTBUF, DP_ALTERNATE_SCROLL, DP_ALT_SENDS_ESC, DP_BELL_IS_URGENT, @@ -1717,7 +1793,7 @@ typedef enum { DP_RXVT_SCROLL_TTY_KEYPRESS, DP_RXVT_SCROLL_TTY_OUTPUT, DP_SELECT_TO_CLIPBOARD, - DP_X_ALTSCRN, + DP_X_ALTBUF, DP_X_DECCOLM, DP_X_EXT_MOUSE, DP_X_LOGGING, @@ -1831,11 +1907,10 @@ typedef struct { int gsets[4]; Boolean wrap_flag; #if OPT_ISO_COLORS - int cur_foreground; /* current foreground color */ - int cur_background; /* current background color */ - int sgr_foreground; /* current SGR foreground color */ - int sgr_background; /* current SGR background color */ - Boolean sgr_extended; /* SGR set with extended codes? */ + int cur_foreground; /* current foreground color */ + int cur_background; /* current background color */ + int sgr_foreground; /* current SGR foreground color */ + int sgr_background; /* current SGR background color */ #endif } SavedCursor; @@ -1969,6 +2044,7 @@ typedef struct { Display *display; /* X display for screen */ int respond; /* socket for responses (position report, etc.) */ + int nextEventDelay; /* msecs to delay for x-events */ /* These parameters apply to VT100 window */ IChar unparse_bfr[256]; unsigned unparse_len; @@ -2001,6 +2077,9 @@ typedef struct { #if OPT_WIDE_ATTRS Boolean colorITMode; /* use color for italics? */ #endif +#if OPT_DIRECT_COLOR + Boolean direct_color; /* direct-color enabled? */ +#endif #endif #if OPT_DEC_CHRSET Boolean font_doublesize;/* enable font-scaling */ @@ -2164,10 +2243,11 @@ typedef struct { #endif Boolean fnt_prop; /* true if proportional fonts */ - Boolean fnt_boxes; /* true if font has box-chars */ + unsigned fnt_boxes; /* 0=no boxes, 1=old, 2=unicode */ Boolean force_packed; /* true to override proportional */ #if OPT_BOX_CHARS Boolean force_box_chars;/* true if we assume no boxchars */ + Boolean broken_box_chars;/* true if broken boxchars */ Boolean force_all_chars;/* true to outline missing chars */ Boolean assume_all_chars;/* true to allow missing chars */ Boolean allow_packing; /* true to allow packed-fonts */ @@ -2195,9 +2275,10 @@ typedef struct { Boolean cursor_underline; /* true if cursor is in underline mode */ XtCursorShape cursor_shape; #if OPT_BLINK_CURS - Boolean cursor_blink; /* cursor blink enable */ - Boolean cursor_blink_res; /* initial cursor blink value */ - Boolean cursor_blink_esc; /* cursor blink escape-state */ + BlinkOps cursor_blink; /* cursor blink enable */ + char * cursor_blink_s; /* ...resource cursorBlink */ + int cursor_blink_esc; /* cursor blink escape-state */ + Boolean cursor_blink_xor; /* how to merge menu/escapes */ #endif #if OPT_BLINK_TEXT Boolean blink_as_bold; /* text blink disable */ @@ -2237,6 +2318,7 @@ typedef struct { * Working variables for getLineData(). */ size_t lineExtra; /* extra space for combining chars */ + size_t cellExtra; /* extra space for combining chars */ /* * Pointer to the current visible buffer. */ @@ -2485,6 +2567,7 @@ typedef struct { void * icon_cgs_cache; #endif #if OPT_RENDERFONT + ListXftFonts *list_xft_fonts; XTermXftFonts renderFontNorm[NMENUFONTS]; XTermXftFonts renderFontBold[NMENUFONTS]; XTermXftFonts renderFontItal[NMENUFONTS]; @@ -2806,6 +2889,7 @@ typedef struct _Work { #endif ScrnColors *oldColors; Boolean palette_changed; + Boolean broken_box_chars; } Work; typedef struct {int foo;} XtermClassPart, TekClassPart; @@ -2853,6 +2937,8 @@ typedef struct _XtermWidgetRec { XSizeHints hints; XVisualInfo *visInfo; int numVisuals; + unsigned rgb_shifts[3]; + Bool has_rgb; Bool init_menu; TKeyboard keyboard; /* terminal keyboard */ TScreen screen; /* terminal screen */ @@ -2866,7 +2952,6 @@ typedef struct _XtermWidgetRec { #if OPT_ISO_COLORS int sgr_foreground; /* current SGR foreground color */ int sgr_background; /* current SGR background color */ - Boolean sgr_extended; /* SGR set with extended codes? */ #endif IFlags initflags; /* initial mode flags */ Tabs tabs; /* tabstops of the terminal */ @@ -2918,7 +3003,9 @@ typedef struct _TekWidgetRec { #define ATR_ITALIC AttrBIT(9) #define ATR_STRIKEOUT AttrBIT(10) #define ATR_DBL_UNDER AttrBIT(11) -#define SGR_MASK2 (ATR_FAINT | ATR_ITALIC | ATR_STRIKEOUT | ATR_DBL_UNDER) +#define ATR_DIRECT_FG AttrBIT(12) +#define ATR_DIRECT_BG AttrBIT(13) +#define SGR_MASK2 (ATR_FAINT | ATR_ITALIC | ATR_STRIKEOUT | ATR_DBL_UNDER | ATR_DIRECT_FG | ATR_DIRECT_BG) #else #define SGR_MASK2 0 #endif @@ -3051,7 +3138,7 @@ typedef struct _TekWidgetRec { #define WhichVWin(screen) (&((screen)->fullVwin)) #define WhichTWin(screen) (&((screen)->fullTwin)) -#define WhichVFont(screen,name) getNormalFont(screen, name)->fs +#define WhichVFont(screen,name) getNormalFont(screen, (int)(name))->fs #define FontAscent(screen) WhichVWin(screen)->f_ascent #define FontDescent(screen) WhichVWin(screen)->f_descent diff --git a/app/xterm/resize.man b/app/xterm/resize.man index af31dd287..6582f8a48 100644 --- a/app/xterm/resize.man +++ b/app/xterm/resize.man @@ -1,6 +1,6 @@ -.\" $XTermId: resize.man,v 1.32 2016/09/24 11:14:15 tom Exp $ +.\" $XTermId: resize.man,v 1.33 2017/11/13 00:58:17 tom Exp $ .\" -.\" Copyright 1998-2013,2016 by Thomas E. Dickey +.\" Copyright 1998-2016,2017 by Thomas E. Dickey .\" .\" All Rights Reserved .\" @@ -35,7 +35,8 @@ .\" .\" Bulleted paragraph .de bP -.IP \(bu 4 +.ie n .IP \(bu 4 +.el .IP \(bu 2 .. .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds AQ \(aq diff --git a/app/xterm/screen.c b/app/xterm/screen.c index 7643a57b9..ac40f010c 100644 --- a/app/xterm/screen.c +++ b/app/xterm/screen.c @@ -1,4 +1,4 @@ -/* $XTermId: screen.c,v 1.517 2017/05/29 19:59:05 tom Exp $ */ +/* $XTermId: screen.c,v 1.521 2017/12/19 23:48:26 tom Exp $ */ /* * Copyright 1999-2015,2017 by Thomas E. Dickey @@ -828,7 +828,7 @@ void ScrnWriteText(XtermWidget xw, IChar *str, unsigned flags, - unsigned cur_fg_bg, + CellColor cur_fg_bg, unsigned length) { TScreen *screen = TScreenOf(xw); @@ -936,7 +936,7 @@ ScrnWriteText(XtermWidget xw, if_OPT_ISO_COLORS(screen, { unsigned j; for (j = 0; j < real_width; ++j) - ld->color[screen->cur_col + (int) j] = (CellColor) cur_fg_bg; + ld->color[screen->cur_col + (int) j] = cur_fg_bg; }); #if OPT_WIDE_CHARS @@ -1445,7 +1445,7 @@ ScrnRefresh(XtermWidget xw, for (row = toprow; row <= maxrow; y += FontHeight(screen), row++) { #if OPT_ISO_COLORS CellColor *fb = 0; -#define ColorOf(col) (CellColor) (fb ? fb[col] : 0) +#define ColorOf(col) (fb ? fb[col] : initCColor) #endif #if OPT_WIDE_CHARS int wideness = 0; @@ -1459,8 +1459,8 @@ ScrnRefresh(XtermWidget xw, int lastind; unsigned flags; unsigned test; - CellColor fg_bg = 0; - unsigned fg = 0, bg = 0; + CellColor fg_bg = initCColor; + Pixel fg = 0, bg = 0; int x; GC gc; Bool hilite; @@ -2404,13 +2404,11 @@ ScrnFillRectangle(XtermWidget xw, } temp = attrs | (temp & (FG_COLOR | BG_COLOR)) | CHARDRAWN; ld->attribs[col] = (IAttr) temp; -#if OPT_ISO_COLORS - if (attrs & (FG_COLOR | BG_COLOR)) { - if_OPT_ISO_COLORS(screen, { + if_OPT_ISO_COLORS(screen, { + if (attrs & (FG_COLOR | BG_COLOR)) { ld->color[col] = xtermColorPair(xw); - }); - } -#endif + } + }); } for (col = (int) left; col < target->right; ++col) diff --git a/app/xterm/scrollbar.c b/app/xterm/scrollbar.c index 0eb2c21c0..4ae351c09 100644 --- a/app/xterm/scrollbar.c +++ b/app/xterm/scrollbar.c @@ -1,7 +1,7 @@ -/* $XTermId: scrollbar.c,v 1.200 2016/05/22 16:43:12 tom Exp $ */ +/* $XTermId: scrollbar.c,v 1.202 2017/12/26 01:58:48 tom Exp $ */ /* - * Copyright 2000-2014,2016 by Thomas E. Dickey + * Copyright 2000-2016,2017 by Thomas E. Dickey * * All Rights Reserved * @@ -727,6 +727,36 @@ AlternateScroll(Widget w, long amount) } } +/*ARGSUSED*/ +void +HandleScrollTo( + Widget w, + XEvent *event GCC_UNUSED, + String *params, + Cardinal *nparams) +{ + XtermWidget xw; + TScreen *screen; + + if ((xw = getXtermWidget(w)) != 0 && + (screen = TScreenOf(xw)) != 0 && + *nparams > 0) { + long amount; + int value; + int to_top = (screen->topline - screen->savedlines); + if (!x_strcasecmp(params[0], "begin")) { + amount = to_top * FontHeight(screen); + } else if (!x_strcasecmp(params[0], "end")) { + amount = -to_top * FontHeight(screen); + } else if ((value = atoi(params[0])) >= 0) { + amount = (value + to_top) * FontHeight(screen); + } else { + amount = 0; + } + AlternateScroll(w, amount); + } +} + /*ARGSUSED*/ void HandleScrollForward( diff --git a/app/xterm/svg.c b/app/xterm/svg.c index bee4958f0..de7c94629 100644 --- a/app/xterm/svg.c +++ b/app/xterm/svg.c @@ -1,7 +1,8 @@ -/* $XTermId: svg.c,v 1.6 2016/05/22 19:09:17 tom Exp $ */ +/* $XTermId: svg.c,v 1.11 2017/12/30 14:47:53 tom Exp $ */ /* - * Copyright 2015,2016 Jens Schweikhardt + * Copyright 2015-2016,2017 Jens Schweikhardt + * Copyright 2017 Thomas E. Dickey * * All Rights Reserved * @@ -32,8 +33,14 @@ #include #include -#define NO_COLOR ((unsigned)-1) -#define RGBPCT(c) c.red / 655.35, c.green / 655.35, c.blue / 655.35 +#define MakeDim(color) \ + color = (unsigned short) ((2 * (unsigned) color) / 3) + +#define RGBPCT(c) \ + ((double)c.red / 655.35), \ + ((double)c.green / 655.35), \ + ((double)c.blue / 655.35) + #define CELLW 10 #define CELLH 20 @@ -156,7 +163,7 @@ dumpSvgLine(XtermWidget xw, int row, FILE *fp) /* Count how many consecutive cells have the same color & attributes. */ for (sal = 1; col + sal < MaxCols(s); ++sal) { #if OPT_ISO_COLORS - if (ld->color[col] != ld->color[col + sal]) + if (!isSameCColor(ld->color[col], ld->color[col + sal])) break; #endif if (ld->attribs[col] != ld->attribs[col + sal]) @@ -167,12 +174,22 @@ dumpSvgLine(XtermWidget xw, int row, FILE *fp) bgcolor.pixel = xw->old_background; #if OPT_ISO_COLORS if (ld->attribs[col] & FG_COLOR) { - unsigned fg = extract_fg(xw, ld->color[col], ld->attribs[col]); - fgcolor.pixel = s->Acolors[fg].value; + Pixel fg = extract_fg(xw, ld->color[col], ld->attribs[col]); +#if OPT_DIRECT_COLOR + if (ld->attribs[col] & ATR_DIRECT_FG) + fgcolor.pixel = fg; + else +#endif + fgcolor.pixel = s->Acolors[fg].value; } if (ld->attribs[col] & BG_COLOR) { - unsigned bg = extract_bg(xw, ld->color[col], ld->attribs[col]); - bgcolor.pixel = s->Acolors[bg].value; + Pixel bg = extract_bg(xw, ld->color[col], ld->attribs[col]); +#if OPT_DIRECT_COLOR + if (ld->attribs[col] & ATR_DIRECT_BG) + bgcolor.pixel = bg; + else +#endif + bgcolor.pixel = s->Acolors[bg].value; } #endif @@ -186,9 +203,9 @@ dumpSvgLine(XtermWidget xw, int row, FILE *fp) } #if OPT_WIDE_ATTRS if (ld->attribs[col] & ATR_FAINT) { - fgcolor.red = (unsigned short) ((2 * fgcolor.red) / 3); - fgcolor.green = (unsigned short) ((2 * fgcolor.green) / 3); - fgcolor.blue = (unsigned short) ((2 * fgcolor.blue) / 3); + MakeDim(fgcolor.red); + MakeDim(fgcolor.green); + MakeDim(fgcolor.blue); } #endif if (ld->attribs[col] & INVERSE) { diff --git a/app/xterm/termcap b/app/xterm/termcap index 845916218..a8869e301 100644 --- a/app/xterm/termcap +++ b/app/xterm/termcap @@ -1,11 +1,11 @@ -# $XTermId: termcap,v 1.83 2016/07/09 18:40:00 tom Exp $ +# $XTermId: termcap,v 1.88 2017/12/25 21:24:41 tom Exp $ # # These are termcap entries that correspond to xterm's terminfo file. # The file is formatted using ncurses' "tic -CNx", but is not mechanically # derived from the terminfo. # #------------------------------------------------------------------------------ -# Copyright 1996-2012,2016 by Thomas E. Dickey +# Copyright 1996-2016,2017 by Thomas E. Dickey # # All Rights Reserved # @@ -123,9 +123,13 @@ x2|xterm-88color|xterm alias:\ :Co#88:pa#7744:tc=xterm-256color: x3|xterm-256color|xterm alias:\ - :Co#256:pa#32767:\ + :Co#256:pa#65536:\ :AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=xterm-new: +# Termcap cannot do direct-colors, but users may expect this name. +x4|xterm-direct|xterm alias:\ + :tc=xterm-256color: + xi|xterm-nrc|xterm alias:\ :tc=xterm: xr|xterm-rep|xterm alias:\ @@ -241,3 +245,4 @@ v0|xterm|X11 terminal emulator:\ # should send. xterm+kbs|fragment for backspace key:\ :kb=^H: +# :kb=\177: diff --git a/app/xterm/terminfo b/app/xterm/terminfo index 9f0710d96..ee558e4d4 100644 --- a/app/xterm/terminfo +++ b/app/xterm/terminfo @@ -1,4 +1,4 @@ -# $XTermId: terminfo,v 1.165 2017/05/07 22:54:33 tom Exp $ +# $XTermId: terminfo,v 1.177 2017/12/25 21:08:55 tom Exp $ # # Updates/notes/new entries (e.g., xterm-8bit, xterm-16color, xterm-256color) # - Thomas E. Dickey @@ -32,6 +32,8 @@ # sale, use or other dealings in this Software without prior written # authorization. #------------------------------------------------------------------------------ +# format (ncurses 6.1): tic -W -1 -f -x terminfo +#------------------------------------------------------------------------------ # # Special Capabilities: # -------------------- @@ -134,11 +136,22 @@ xterm-new|modern xterm terminal emulator, kcbt=\E[Z, kent=\EOM, rin=\E[%p1%dT, + use=ansi+rep, use=ecma+strikeout, use=xterm+pcfkeys, use=xterm+tmux, use=xterm-basic, -# + +# These "ansi+XXX" blocks were added in ncurses 5.0: +ansi+rep, + rep=%p1%c\E[%p2%{1}%-%db, + +ansi+enq|ncurses extension for ANSI ENQ, + u6=\E[%i%d;%dR, + u7=\E[6n, + u8=\E[?%[;0123456789]c, + u9=\E[c, + # Encode modifiers using parameters (see "Xterm Control Sequences" ctlseqs.ms). # Note that this is unrelated to PCTERM. # @@ -211,11 +224,11 @@ xterm+pcfkeys|fragment for PC-style keys, # Ms modifies the selection/clipboard. Its parameters are # p1 = the storage unit (clipboard, selection or cut buffer) # p2 = the base64-encoded clipboard content. -# +# # Ss is used to set the cursor style as described by the DECSCUSR # function to a block or underline. # Se resets the cursor style to the terminal power-on default. -# +# # Cs and Ce set and reset the cursor colour. xterm+tmux|advanced xterm features used in tmux, Cr=\E]112\007, @@ -884,6 +897,7 @@ xterm+pce0|fragment with modifyCursorKeys:0, kPRV7=\E[5;7~, use=xterm+edit, +# This is an ncurses extension ecma+strikeout|ECMA-48 strikeout/crossed-out, rmxx=\E[29m, smxx=\E[9m, @@ -959,7 +973,6 @@ xterm-basic|modern xterm terminal emulator - common, ritm=\E[23m, rmacs=\E(B, rmam=\E[?7l, - rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>, rmm=\E[?1034l, @@ -1041,19 +1054,16 @@ xterm-basic|modern xterm terminal emulator - common, sitm=\E[3m, smacs=\E(0, smam=\E[?7h, - smcup=\E[?1049h, smir=\E[4h, smkx=\E[?1h\E=, smm=\E[?1034h, smso=\E[7m, smul=\E[4m, tbc=\E[3g, - u6=\E[%i%d;%dR, - u7=\E[6n, - u8=\E[?%[;0123456789]c, - u9=\E[c, vpa=\E[%i%p1%dd, E3=\E[3J, + use=ansi+enq, + use=xterm+alt+title, use=xterm+kbs, # # The xterm-new description has all of the features, but is not completely @@ -1450,6 +1460,21 @@ xterm+vt+edit|fragment for vt220-style editing keypad, kfnd=\E[1~, kslt=\E[4~, +xterm+noalt|xterm without altscreen, + rmcup@, + smcup@, + +xterm+alt1049|xterm 90 feature, + rmcup=\E[?1049l, + smcup=\E[?1049h, + +xterm+titlestack|xterm 251 feature, + rmcup=\E[23;0;0t, + smcup=\E[22;0;0t, + +xterm+alt+title|xterm 90 and 251 features combined, + rmcup=\E[?1049l\E[23;0;0t, + smcup=\E[?1049h\E[22;0;0t, # # This should work for the commonly used "color xterm" variations (XFree86 # xterm, color_xterm, nxterm, rxvt). Note that it does not set 'bce', so for @@ -1647,15 +1672,23 @@ xterm-16color|xterm with 16 colors, m, use=xterm+256color, use=xterm-new, + +# "indexed color" is mentioned without definition in ISO 8613-6 (ITU T.416). # -# This uses RGB values 0..1000 +# This implementation uses a 256-element color map where the first 16 entries +# are shared with the aixterm-compatible colors (and in turn the first 8 are +# shared with the ANSI colors). The three levels (256, 16, 8) account for the +# use of a conditional expression in setaf/setab which reduces the number of +# characters sent to the screen for typical applications. # -# 256 colors should give 65536 pairs, but terminfo stores numbers in a signed -# short. Most people will not notice problems with only 32767 pairs. +# 256 colors should give 65536 pairs, but SVr4 (legacy) terminfo stores numbers +# in a signed short. Most people will not notice problems with only 32767 +# pairs. With ncurses 6.1, numbers are stored in a signed integer (at least +# 32-bits), and the inconsistency regarding pairs is eliminated. xterm+256color|xterm 256-color feature, ccc, colors#0x100, - pairs#0x7fff, + pairs#0x10000, initc=\E]4; %p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\, oc=\E]104\007, @@ -1691,6 +1724,46 @@ xterm-88color|xterm with 88 colors, colors#88, pairs#7744, use=xterm-256color, + +# "direct color" is mentioned without definition in ISO 8613-6 (ITU T.416). +# +# This is a particular implementation which assume 8-bit values for red, green, +# and blue. Other encodings are possible; none are addressed by that standard. +# +# The "RGB" flag is an ncurses 6.1 extension which tells the library how to +# quickly compute the color-content for a given color value. +# +# Like xterm+256color, this uses a conditional expression. But it does that +# for a different reason: to make it readily usable for applications which +# print text but also use RGB colors, it uses a color map for the usual ANSI +# colors (0-7) and RGB colors for the remaining range of the color value. +xterm+direct|xterm with direct-color indexing, + RGB, + colors#0x1000000, + pairs#0x10000, + initc@, + op=\E[39;49m, + setab=\E[ + %? + %p1%{8}%< + %t4%p1%d + %e48\:2\:\: + %p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%d + %; + m, + setaf=\E[ + %? + %p1%{8}%< + %t3%p1%d + %e38\:2\:\: + %p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}%&%d + %; + m, + setb@, + setf@, +xterm-direct|xterm with direct-color indexing, + use=xterm+direct, + use=xterm, # # This is an 8-bit version of xterm, which emulates DEC vt220 with ANSI color. # To use it, your decTerminalID resource must be set to 200 or above, and the @@ -2040,7 +2113,6 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), rin=\E[%p1%dT, rmacs=^O, rmam=\E[?7l, - rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[27m, @@ -2115,7 +2187,6 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), sgr0=\E[m\017, smacs=^N, smam=\E[?7h, - smcup=\E[?1049h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, @@ -2130,6 +2201,7 @@ xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System), kb1=\EOt, kb3=\EOv, kc2=\EOr, + use=xterm+alt1049, use=xterm+kbs, xterm-xfree86|xterm terminal emulator (XFree86 4.4 Window System), use=xterm-xf86-v44, diff --git a/app/xterm/trace.c b/app/xterm/trace.c index af8d9fa57..31cb01457 100644 --- a/app/xterm/trace.c +++ b/app/xterm/trace.c @@ -1,4 +1,4 @@ -/* $XTermId: trace.c,v 1.171 2017/06/19 08:11:26 tom Exp $ */ +/* $XTermId: trace.c,v 1.172 2017/11/07 00:12:24 tom Exp $ */ /* * Copyright 1997-2016,2017 by Thomas E. Dickey @@ -48,7 +48,6 @@ #include #include #include -#include #include #include @@ -74,11 +73,10 @@ const char *trace_who = "parent"; static FILE *trace_fp; -void -Trace(const char *fmt,...) +static FILE * +TraceOpen(void) { static const char *trace_out; - va_list ap; if (trace_fp != 0 && trace_who != trace_out) { @@ -129,13 +127,30 @@ Trace(const char *fmt,...) } (void) umask(oldmask); } + return trace_fp; +} + +void +Trace(const char *fmt,...) +{ + va_list ap; + FILE *fp = TraceOpen(); va_start(ap, fmt); - vfprintf(trace_fp, fmt, ap); - (void) fflush(trace_fp); + vfprintf(fp, fmt, ap); + (void) fflush(fp); va_end(ap); } +void +TraceVA(const char *fmt, va_list ap) +{ + FILE *fp = TraceOpen(); + + vfprintf(fp, fmt, ap); + (void) fflush(fp); +} + void TraceClose(void) { diff --git a/app/xterm/trace.h b/app/xterm/trace.h index 14c156c4d..be97c3899 100644 --- a/app/xterm/trace.h +++ b/app/xterm/trace.h @@ -1,4 +1,4 @@ -/* $XTermId: trace.h,v 1.80 2017/01/20 22:36:24 tom Exp $ */ +/* $XTermId: trace.h,v 1.81 2017/11/07 00:12:24 tom Exp $ */ /* * Copyright 1997-2016,2017 by Thomas E. Dickey @@ -41,11 +41,17 @@ #if OPT_TRACE +#include + extern void Trace ( const char *, ... ) GCC_PRINTFLIKE(1,2); +extern void TraceVA ( const char *fmt, va_list ap ); #undef TRACE #define TRACE(p) Trace p +#undef TRACE_VA +#define TRACE_VA(p) TraceVA p + extern void TraceClose (void); #undef TRACE_CLOSE diff --git a/app/xterm/util.c b/app/xterm/util.c index 0e8251535..1d8259abf 100644 --- a/app/xterm/util.c +++ b/app/xterm/util.c @@ -1,4 +1,4 @@ -/* $XTermId: util.c,v 1.717 2017/06/19 08:11:47 tom Exp $ */ +/* $XTermId: util.c,v 1.728 2017/12/29 19:03:33 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -1023,7 +1023,7 @@ WriteText(XtermWidget xw, IChar *str, Cardinal len) TScreen *screen = TScreenOf(xw); CLineData *ld = 0; unsigned attr_flags = xw->flags; - CellColor fg_bg = makeColorPair(xw->cur_foreground, xw->cur_background); + CellColor fg_bg = xtermColorPair(xw); unsigned cells = visual_width(str, len); GC currentGC; @@ -2163,7 +2163,7 @@ static void set_background(XtermWidget xw, int color GCC_UNUSED) { TScreen *screen = TScreenOf(xw); - Pixel c = getXtermBackground(xw, xw->flags, color); + Pixel c = getXtermBG(xw, xw->flags, color); TRACE(("set_background(%d) %#lx\n", color, c)); XSetWindowBackground(screen->display, VShellWindow(xw), c); @@ -3311,8 +3311,8 @@ fixupItalics(XtermWidget xw, } #endif -#define SetMissing() \ - TRACE(("%s@%d: missing %d\n", __FILE__, __LINE__, missing)); \ +#define SetMissing(tag) \ + TRACE(("%s %s: missing %d\n", __FILE__, tag, missing)); \ missing = 1 /* @@ -3543,8 +3543,9 @@ drawXtermText(XtermWidget xw, * position. Failing that, use our own box-characters. */ if (screen->force_box_chars + || screen->broken_box_chars || xtermXftMissing(xw, currFont, dec2ucs(ch))) { - SetMissing(); + SetMissing("case 1"); } else { ch = dec2ucs(ch); replace = True; @@ -3559,9 +3560,10 @@ drawXtermText(XtermWidget xw, unsigned part = ucs2dec(ch); if (xtermIsDecGraphic(part)) { if (screen->force_box_chars + || screen->broken_box_chars || xtermXftMissing(xw, currFont, ch)) { ch = part; - SetMissing(); + SetMissing("case 2"); } } else if (xtermXftMissing(xw, currFont, ch)) { XftFont *test = pickXftFont(needed, font0, wfont0); @@ -3574,7 +3576,7 @@ drawXtermText(XtermWidget xw, ch = part; replace = True; } else if (ch != HIDDEN_CHAR) { - SetMissing(); + SetMissing("case 3"); } } }); @@ -3590,7 +3592,7 @@ drawXtermText(XtermWidget xw, * box-characters. */ if (xtermXftMissing(xw, currFont, ch)) { - SetMissing(); + SetMissing("case 4"); } } #endif @@ -3920,6 +3922,14 @@ drawXtermText(XtermWidget xw, if (ch == HIDDEN_CHAR) continue; +#if OPT_BOX_CHARS + if ((screen->fnt_boxes == 1) && (ch >= 256)) { + unsigned part = ucs2dec(ch); + if (part < 32) + ch = (IChar) part; + } +#endif + if (!needWide && !IsIcon(screen) && ((on_wide || my_wcwidth((wchar_t) ch) > 1) @@ -4243,15 +4253,16 @@ whichXtermCgs(XtermWidget xw, unsigned attr_flags, Bool hilite) * current screen foreground and background colors. */ GC -updatedXtermGC(XtermWidget xw, unsigned attr_flags, unsigned fg_bg, Bool hilite) +updatedXtermGC(XtermWidget xw, unsigned attr_flags, CellColor fg_bg, + Bool hilite) { TScreen *screen = TScreenOf(xw); VTwin *win = WhichVWin(screen); CgsEnum cgsId = whichXtermCgs(xw, attr_flags, hilite); - unsigned my_fg = extract_fg(xw, fg_bg, attr_flags); - unsigned my_bg = extract_bg(xw, fg_bg, attr_flags); - Pixel fg_pix = getXtermForeground(xw, attr_flags, (int) my_fg); - Pixel bg_pix = getXtermBackground(xw, attr_flags, (int) my_bg); + Pixel my_fg = extract_fg(xw, fg_bg, attr_flags); + Pixel my_bg = extract_bg(xw, fg_bg, attr_flags); + Pixel fg_pix = getXtermFG(xw, attr_flags, (int) my_fg); + Pixel bg_pix = getXtermBG(xw, attr_flags, (int) my_bg); Pixel xx_pix; #if OPT_HIGHLIGHT_COLOR Boolean reverse2 = ((attr_flags & INVERSE) && hilite); @@ -4384,8 +4395,8 @@ resetXtermGC(XtermWidget xw, unsigned attr_flags, Bool hilite) TScreen *screen = TScreenOf(xw); VTwin *win = WhichVWin(screen); CgsEnum cgsId = whichXtermCgs(xw, attr_flags, hilite); - Pixel fg_pix = getXtermForeground(xw, attr_flags, xw->cur_foreground); - Pixel bg_pix = getXtermBackground(xw, attr_flags, xw->cur_background); + Pixel fg_pix = getXtermFG(xw, attr_flags, xw->cur_foreground); + Pixel bg_pix = getXtermBG(xw, attr_flags, xw->cur_background); checkVeryBoldColors(attr_flags, xw->cur_foreground); @@ -4403,8 +4414,8 @@ resetXtermGC(XtermWidget xw, unsigned attr_flags, Bool hilite) * Extract the foreground-color index from a color pair. * If we've got BOLD or UNDERLINE color-mode active, those will be used. */ -unsigned -extract_fg(XtermWidget xw, unsigned color, unsigned attr_flags) +Pixel +extract_fg(XtermWidget xw, CellColor color, unsigned attr_flags) { unsigned fg = ExtractForeground(color); @@ -4419,8 +4430,8 @@ extract_fg(XtermWidget xw, unsigned color, unsigned attr_flags) * Extract the background-color index from a color pair. * If we've got INVERSE color-mode active, that will be used. */ -unsigned -extract_bg(XtermWidget xw, unsigned color, unsigned attr_flags) +Pixel +extract_bg(XtermWidget xw, CellColor color, unsigned attr_flags) { unsigned bg = ExtractBackground(color); @@ -4442,12 +4453,23 @@ extract_bg(XtermWidget xw, unsigned color, unsigned attr_flags) * attribute colors. */ CellColor -makeColorPair(int fg, int bg) +makeColorPair(XtermWidget xw) { - unsigned my_bg = (bg >= 0) && (bg < NUM_ANSI_COLORS) ? (unsigned) bg : 0; - unsigned my_fg = (fg >= 0) && (fg < NUM_ANSI_COLORS) ? (unsigned) fg : my_bg; + CellColor result; - return (CellColor) (my_fg | (my_bg << COLOR_BITS)); +#if OPT_DIRECT_COLOR + result.fg = xw->cur_foreground; + result.bg = xw->cur_background; +#else + int fg = xw->cur_foreground; + int bg = xw->cur_background; + unsigned my_bg = okIndexedColor(bg) ? (unsigned) bg : 0; + unsigned my_fg = okIndexedColor(fg) ? (unsigned) fg : my_bg; + + result = (CellColor) (my_fg | (my_bg << COLOR_BITS)); +#endif + + return result; } /* @@ -4499,13 +4521,18 @@ getXtermBackground(XtermWidget xw, unsigned attr_flags, int color) { Pixel result = T_COLOR(TScreenOf(xw), TEXT_BG); - (void) attr_flags; - (void) color; - #if OPT_ISO_COLORS - if ((attr_flags & BG_COLOR) && (color >= 0 && color < MAXCOLORS)) { + if_OPT_DIRECT_COLOR2(TScreenOf(xw), (attr_flags & ATR_DIRECT_BG), { + result = (Pixel) color; + } else + ) + if ((attr_flags & BG_COLOR) && + (color >= 0 && color < MAXCOLORS)) { result = GET_COLOR_RES(xw, TScreenOf(xw)->Acolors[color]); } +#else + (void) attr_flags; + (void) color; #endif return result; } @@ -4515,14 +4542,20 @@ getXtermForeground(XtermWidget xw, unsigned attr_flags, int color) { Pixel result = T_COLOR(TScreenOf(xw), TEXT_FG); - (void) attr_flags; - (void) color; - #if OPT_ISO_COLORS - if ((attr_flags & FG_COLOR) && (color >= 0 && color < MAXCOLORS)) { + if_OPT_DIRECT_COLOR2(TScreenOf(xw), (attr_flags & ATR_DIRECT_FG), { + result = (Pixel) color; + } else + ) + if ((attr_flags & FG_COLOR) && + (color >= 0 && color < MAXCOLORS)) { result = GET_COLOR_RES(xw, TScreenOf(xw)->Acolors[color]); } +#else + (void) attr_flags; + (void) color; #endif + #if OPT_WIDE_ATTRS #define DIM_IT(n) work.n = (unsigned short) ((2 * (unsigned)work.n) / 3) if ((attr_flags & ATR_FAINT)) { @@ -4828,7 +4861,7 @@ systemWcwidthOk(int samplesize, int samplepass) if ((system_code < 0 && intern_code >= 1) || (system_code >= 0 && intern_code != system_code)) { TRACE((".. width(U+%04X) = %d, expected %d\n", - n, system_code, intern_code)); + (unsigned) n, system_code, intern_code)); if (++oops > samplepass) break; } diff --git a/app/xterm/version.h b/app/xterm/version.h index 3eff0e51b..dc6b121a6 100644 --- a/app/xterm/version.h +++ b/app/xterm/version.h @@ -1,4 +1,4 @@ -/* $XTermId: version.h,v 1.437 2017/06/21 00:46:28 tom Exp $ */ +/* $XTermId: version.h,v 1.439 2017/12/30 19:26:00 tom Exp $ */ /* * Copyright 1998-2016,2017 by Thomas E. Dickey @@ -38,8 +38,8 @@ * version of X to which this version of xterm has been built. The resulting * number in parentheses is my patch number (Thomas E. Dickey). */ -#define XTERM_PATCH 330 -#define XTERM_DATE 2017-06-20 +#define XTERM_PATCH 331 +#define XTERM_DATE 2017-12-30 #ifndef __vendorversion__ #define __vendorversion__ "XTerm/OpenBSD" diff --git a/app/xterm/xcharmouse.h b/app/xterm/xcharmouse.h index aed0678e7..1ce2126f7 100644 --- a/app/xterm/xcharmouse.h +++ b/app/xterm/xcharmouse.h @@ -1,7 +1,8 @@ -/* $XTermId: xcharmouse.h,v 1.17 2012/09/26 00:39:14 tom Exp $ */ +/* $XTermId: xcharmouse.h,v 1.18 2012/09/26 00:39:14 tom Exp $ */ /************************************************************ +Copyright 1997-2011,2012 by Thomas E. Dickey Copyright 1998 by Jason Bacon All Rights Reserved diff --git a/app/xterm/xstrings.c b/app/xterm/xstrings.c index 637608620..234c3fefb 100644 --- a/app/xterm/xstrings.c +++ b/app/xterm/xstrings.c @@ -1,4 +1,4 @@ -/* $XTermId: xstrings.c,v 1.70 2017/06/11 21:20:37 tom Exp $ */ +/* $XTermId: xstrings.c,v 1.71 2017/11/10 00:52:29 tom Exp $ */ /* * Copyright 2000-2016,2017 by Thomas E. Dickey @@ -195,7 +195,7 @@ login_alias(char *login_name, uid_t uid, struct passwd *in_out) char * x_getlogin(uid_t uid, struct passwd *in_out) { - char *login_name = NULL; + char *login_name; login_name = login_alias(x_getenv("LOGNAME"), uid, in_out); if (IsEmpty(login_name)) { diff --git a/app/xterm/xterm.h b/app/xterm/xterm.h index 657a24fcf..61d6630a4 100644 --- a/app/xterm/xterm.h +++ b/app/xterm/xterm.h @@ -1,4 +1,4 @@ -/* $XTermId: xterm.h,v 1.778 2017/05/29 23:19:51 tom Exp $ */ +/* $XTermId: xterm.h,v 1.789 2017/12/26 11:37:37 tom Exp $ */ /* * Copyright 1999-2016,2017 by Thomas E. Dickey @@ -430,6 +430,7 @@ extern char **environ; #define XtNctrlFKeys "ctrlFKeys" #define XtNcurses "curses" #define XtNcursorBlink "cursorBlink" +#define XtNcursorBlinkXOR "cursorBlinkXOR" #define XtNcursorColor "cursorColor" #define XtNcursorOffTime "cursorOffTime" #define XtNcursorOnTime "cursorOnTime" @@ -439,6 +440,7 @@ extern char **environ; #define XtNdecTerminalID "decTerminalID" #define XtNdefaultString "defaultString" #define XtNdeleteIsDEL "deleteIsDEL" +#define XtNdirectColor "directColor" #define XtNdisallowedColorOps "disallowedColorOps" #define XtNdisallowedFontOps "disallowedFontOps" #define XtNdisallowedMouseOps "disallowedMouseOps" @@ -491,8 +493,8 @@ extern char **environ; #define XtNlogging "logging" #define XtNloginShell "loginShell" #define XtNmarginBell "marginBell" -#define XtNmaximized "maximized" #define XtNmaxGraphicSize "maxGraphicSize" +#define XtNmaximized "maximized" #define XtNmenuBar "menuBar" /* internal */ #define XtNmenuHeight "menuHeight" #define XtNmetaSendsEscape "metaSendsEscape" @@ -508,6 +510,7 @@ extern char **environ; #define XtNmultiClickTime "multiClickTime" #define XtNmultiScroll "multiScroll" #define XtNnMarginBell "nMarginBell" +#define XtNnextEventDelay "nextEventDelay" #define XtNnumColorRegisters "numColorRegisters" #define XtNnumLock "numLock" #define XtNoldXtermFKeys "oldXtermFKeys" @@ -621,6 +624,7 @@ extern char **environ; #define XtCCtrlFKeys "CtrlFKeys" #define XtCCurses "Curses" #define XtCCursorBlink "CursorBlink" +#define XtCCursorBlinkXOR "CursorBlinkXOR" #define XtCCursorOffTime "CursorOffTime" #define XtCCursorOnTime "CursorOnTime" #define XtCCursorUnderLine "CursorUnderLine" @@ -629,6 +633,7 @@ extern char **environ; #define XtCDecTerminalID "DecTerminalID" #define XtCDefaultString "DefaultString" #define XtCDeleteIsDEL "DeleteIsDEL" +#define XtCDirectColor "DirectColor" #define XtCDisallowedColorOps "DisallowedColorOps" #define XtCDisallowedFontOps "DisallowedFontOps" #define XtCDisallowedMouseOps "DisallowedMouseOps" @@ -677,8 +682,8 @@ extern char **environ; #define XtCLogging "Logging" #define XtCLoginShell "LoginShell" #define XtCMarginBell "MarginBell" -#define XtCMaximized "Maximized" #define XtCMaxGraphicSize "MaxGraphicSize" +#define XtCMaximized "Maximized" #define XtCMenuBar "MenuBar" /* internal */ #define XtCMenuHeight "MenuHeight" #define XtCMetaSendsEscape "MetaSendsEscape" @@ -693,6 +698,7 @@ extern char **environ; #define XtCModifyStringKeys "ModifyStringKeys" #define XtCMultiClickTime "MultiClickTime" #define XtCMultiScroll "MultiScroll" +#define XtCNextEventDelay "NextEventDelay" #define XtCNumColorRegisters "NumColorRegisters" #define XtCNumLock "NumLock" #define XtCOldXtermFKeys "OldXtermFKeys" @@ -1052,6 +1058,7 @@ extern XtermWidget getXtermWidget (Widget /* w */); extern char *udk_lookup (XtermWidget /* xw */, int /* keycode */, int * /* len */); extern char *xtermEnvEncoding (void); extern char *xtermFindShell (char * /* leaf */, Bool /* warning */); +extern char *xtermFormatSGR (XtermWidget /* xw */, char * /* target */, unsigned /* attrs */, int /* fg */, int /* bg */); extern const char *SysErrorMsg (int /* n */); extern const char *SysReasonMsg (int /* n */); extern Boolean allocateBestRGB(XtermWidget /* xw */, XColor * /* def */); @@ -1088,10 +1095,10 @@ extern void ReverseOldColors (XtermWidget /* xw */); extern void SysError (int /* i */) GCC_NORETURN; extern void VisualBell (void); extern void cleanup_colored_cursor (void); +extern void do_ansi_rqm (XtermWidget /* xw */, int /* nparam */, int * /* params */); extern void do_dcs (XtermWidget /* xw */, Char * /* buf */, size_t /* len */); -extern void do_decrpm (XtermWidget /* xw */, int /* nparam */, int * /* params */); +extern void do_dec_rqm (XtermWidget /* xw */, int /* nparam */, int * /* params */); extern void do_osc (XtermWidget /* xw */, Char * /* buf */, size_t /* len */, int /* final */); -extern void do_rpm (XtermWidget /* xw */, int /* nparam */, int * /* params */); extern void do_xevents (void); extern void end_tek_mode (void); extern void end_vt_mode (void); @@ -1124,6 +1131,10 @@ extern void xtermWarning (const char * /*fmt*/,...) GCC_PRINTFLIKE(1,2); extern void HandleDabbrevExpand PROTO_XT_ACTIONS_ARGS; #endif +#if OPT_DIRECT_COLOR +extern int getDirectColor(XtermWidget /* xw */, int /* red */, int /* green */, int /* blue */); +#endif /* OPT_DIRECT_COLOR */ + #if OPT_EXEC_XTERM extern char *ProcGetCWD(pid_t /* pid */); #else @@ -1271,7 +1282,7 @@ extern void ScrnInsertCol (XtermWidget /* xw */, unsigned /* n */); extern void ScrnInsertLine (XtermWidget /* xw */, ScrnBuf /* sb */, int /* last */, int /* where */, unsigned /* n */); extern void ScrnRefresh (XtermWidget /* xw */, int /* toprow */, int /* leftcol */, int /* nrows */, int /* ncols */, Bool /* force */); extern void ScrnUpdate (XtermWidget /* xw */, int /* toprow */, int /* leftcol */, int /* nrows */, int /* ncols */, Bool /* force */); -extern void ScrnWriteText (XtermWidget /* xw */, IChar * /* str */, unsigned /* flags */, unsigned /* cur_fg_bg */, unsigned /* length */); +extern void ScrnWriteText (XtermWidget /* xw */, IChar * /* str */, unsigned /* flags */, CellColor /* cur_fg_bg */, unsigned /* length */); extern void ShowWrapMarks (XtermWidget /* xw */, int /* row */, CLineData * /* ld */); extern void setupLineData (TScreen * /* screen */, ScrnBuf /* base */, Char * /* data */, unsigned /* nrow */, unsigned /* ncol */); extern void xtermParseRect (XtermWidget /* xw */, int, int *, XTermRect *); @@ -1349,6 +1360,7 @@ extern void deleteScrollback (TScreen * /* screen */); extern void DoResizeScreen (XtermWidget /* xw */); extern void HandleScrollBack PROTO_XT_ACTIONS_ARGS; extern void HandleScrollForward PROTO_XT_ACTIONS_ARGS; +extern void HandleScrollTo PROTO_XT_ACTIONS_ARGS; extern void ResizeScrollBar (XtermWidget /* xw */); extern void ScrollBarDrawThumb (Widget /* scrollWidget */); extern void ScrollBarOff (XtermWidget /* xw */); @@ -1375,7 +1387,7 @@ extern void TabZonk (Tabs /* tabs */); extern Boolean isDefaultBackground(const char * /* name */); extern Boolean isDefaultForeground(const char * /* name */); extern CgsEnum whichXtermCgs(XtermWidget /* xw */, unsigned /* attr_flags */, Bool /* hilite */); -extern GC updatedXtermGC (XtermWidget /* xw */, unsigned /* flags */, unsigned /* fg_bg */, Bool /* hilite */); +extern GC updatedXtermGC (XtermWidget /* xw */, unsigned /* flags */, CellColor /* fg_bg */, Bool /* hilite */); extern Pixel getXtermBackground(XtermWidget /* xw */, unsigned /* flags */, int /* color */); extern Pixel getXtermForeground(XtermWidget /* xw */, unsigned /* flags */, int /* color */); extern int ClearInLine (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */); @@ -1430,12 +1442,12 @@ extern int XParseXineramaGeometry(Display * /* display */, char * /* parsestring #if OPT_ISO_COLORS -extern unsigned extract_fg (XtermWidget /* xw */, unsigned /* color */, unsigned /* flags */); -extern unsigned extract_bg (XtermWidget /* xw */, unsigned /* color */, unsigned /* flags */); -extern CellColor makeColorPair (int /* fg */, int /* bg */); +extern Pixel extract_fg (XtermWidget /* xw */, CellColor /* color */, unsigned /* flags */); +extern Pixel extract_bg (XtermWidget /* xw */, CellColor /* color */, unsigned /* flags */); +extern CellColor makeColorPair (XtermWidget /* xw */); extern void ClearCurBackground (XtermWidget /* xw */, int /* top */, int /* left */, unsigned /* height */, unsigned /* width */, unsigned /* fw */); -#define xtermColorPair(xw) makeColorPair(xw->sgr_foreground, xw->sgr_background) +#define xtermColorPair(xw) makeColorPair(xw) #if OPT_COLOR_RES #define GET_COLOR_RES(xw, res) xtermGetColorRes(xw, &(res)) @@ -1510,13 +1522,15 @@ extern Pixel xtermGetColorRes(XtermWidget /* xw */, ColorRes * /* res */); /* FIXME: Reverse-Video? */ #define T_COLOR(v,n) (v)->Tcolors[n] -#define makeColorPair(fg, bg) 0 #define xtermColorPair(xw) 0 #define checkVeryBoldColors(flags, fg) /* nothing */ #endif /* OPT_ISO_COLORS */ +#define getXtermFG(xw, flags, color) getXtermForeground(xw, flags, color) +#define getXtermBG(xw, flags, color) getXtermBackground(xw, flags, color) + #if OPT_ZICONBEEP extern void initZIconBeep(void); extern void resetZIconBeep(XtermWidget /* xw */); diff --git a/app/xterm/xterm.log.html b/app/xterm/xterm.log.html index 2280dcaa9..96a632b1c 100644 --- a/app/xterm/xterm.log.html +++ b/app/xterm/xterm.log.html @@ -30,7 +30,7 @@ * sale, use or other dealings in this Software without prior written * * authorization. * ***************************************************************************** - $XTermId: xterm.log.html,v 1.1765 2017/06/21 00:48:25 tom Exp $ + $XTermId: xterm.log.html,v 1.1815 2017/12/30 19:25:39 tom Exp $ --> @@ -60,7 +60,7 @@

Contents

Here is + "https://invisible-island.net/xterm/xterm.log.html">Here is the latest version of this file.

It began as a list of the changes that I made for xterm, using @@ -72,6 +72,8 @@ CHANGELOG).

+

Patch #331 - + 2017/12/30

+ +
    +
  • add workaround for improper grayscale adjustments made in + FreeType library, exposed by changes to rounding in 2.8.1, + which shows up as a gap in line-drawing characters (Debian + #880407).
  • + +
  • improve a special case where a non-Unicode font's + line-drawing characters were not used, when specifying it via + the utf8Fonts resource, e.g., + +
    +
    +        -fs 15 \
    +        -xrm '*VT100.font:12x24' \
    +        -xrm '*VT100.boldFont:12x24' \
    +        -xrm '*VT100.utf8Fonts.font: 12x24' \
    +        -xrm '*VT100.utf8Fonts.boldFont: 12x24' \
    +
    +
    +
  • + +
  • replace constant 10msec delay for next X event with new + resource nextEventDelay, and reduce that to 1msec + to accommodate faster machines than used when + -hold was implemented in 1999 (Debian #877628).
  • + +
  • add scroll-to action, which simplifies binding + a key to scroll to the beginning or end of the saved-lines + (Debian #880120).
  • + +
  • add building blocks for alternate screen and/or title-stack + features in the terminfo file.
  • + +
  • improve calculations for cell-data size.
  • + +
  • change configure script to enable XHTML/SVG screen dumps by + default.
  • + +
  • change configure script to enable 256-colors by + default.
  • + +
  • update config.guess, config.sub
  • + +
  • change configure script option for + --with-man2html to use improved script by + default.
  • + +
  • add case for private mode 1044 in DECRQM, to report the + keepClipboard resource setting and corresponding menu + entry.
  • + +
  • fix an inconsistency between private mode 12 (the AT&T + 610 cursor blink) and DECSCUSR: the former relied + on having the cursorBlink resource set initially + to enable the escape sequence, while the latter does not.
  • + +
  • add private modes 13 and 14, as well as resource + cursorBlinkXOR to allow better control over the + cursor-blinking state (discussion with Bram Moolenaar).
  • + +
  • modify the html and svg screen dumps to support direct + color
  • + +
  • modify media copy (screen-printing) to support the same SGR + codes as DECRQSS, including 88/256 indexed color + as well as direct color.
  • + +
  • improve options-parsing for query-status.pl script.
  • + +
  • modify parsing of SGR direct-color control + making color space identitier optional. The + corresponding DECRQSS reply always returns an + empty (default) field for the identifier.
  • + +
  • add wide-attributes to DECRQSS reply for + SGR.
  • + +
  • add private mode 1046 to help with scripting + applications.
  • + +
  • correct expression used for readline-flags in DECRQM; to + test the current flag rather than information stacked + within the same variable.
  • + +
  • correct typo in ctlseqs.ms reference to + ISO-8613-6 (patch by Mike Frysinger).
  • + +
  • fix lintian warning for test-package.
  • + +
  • fix typo in DECRQSS for SGR 48, + which printed the foreground value for colors past 15. Also use + colon delimiter for codes 38/48 in response (report by Paul + LeoNerd Evans).
  • + +
  • improve workaround for Debian #542434 by using the font's + maximum width when no ISO-8859-1 glyphs are provided (Debian + #879936).
  • + +
  • work around a special case of Xft's mismanagement + of its cached data by adding a check before the + -report-fonts option to ensure that it does not + use an XftPattern which may have been freed during + a call to XftFontOpenPattern.
  • + +
  • improve manual page description of regex + option for onXClicks resources (report by + Lukas Mai).
  • + +
  • add directColor resource.
  • + +
  • additional manpage macro cleanup (Brandon Robinson, Debian + #880551).
  • + +
  • add optional support for direct-colors (adapted from patch + by anonymous “Nibby Nebbulous”).
  • + +
  • improve legacy/NRC character set mapping (patch by Thomas + Wolff): + +
      +
    • enable alternate NRC set designators for French and + French Canadian, ‘9’ and ‘f’ + respectively, as documented in ctlseqs. (‘9’ is + documented for VT510, ‘f’ is a Kermit + feature).
    • + +
    • correct the Unicode value in the DEC Technical + table to show capital delta.
    • + +
    • referring to + +
      +

      http://vt100.net/docs/vt220-rm/table2-3b.html
      + + http://vt100.net/docs/vt320-uu/appendixe.html

      +
      + +

      add entries for the DEC Supplemental Graphics + table to display 0x28/0xa8 as ¤ and 0x5d/0xdd as + Ÿ.

      +
    • + +
    • referring to + +
      +

      http://www.vt100.net/charsets/technical.html

      +
      + +

      alter the Unicode values used for 0x2b through 0x2c to + use curly braces to work with the + “middle” parts displayed with 0x2f and + 0x30.

      +
    • + +
    • modify the VT220 “Supplemental” table, + giving a hint that it was probably meant to be + “Supplemental Graphics” and is the same as + VT320's table.
    • +
    +
  • + +
  • quiet a few font-warnings when a derived fontname cannot be + opened, overlooked in refactoring of font resources in patch #328 (initially reported on Cygwin + mailing list, with followup).
  • + +
  • correct error response for DECRQSS broken in + cleanup of Coverity reports in patch + #288 (reports by Bram Moolenaar and IWAMOTO Kouichi).
  • + +
  • improve DECRPM responses by returning mode + not recognized for modes which may not be settable due to + the selected decTerminalID resource (report by + IWAMOTO Kouichi).
  • + +
  • correct logic for print-immediate action, and + enable corresponding menu entry (patch by Lauri + Tirkkonen).
  • + +
  • add configure option --with-pcre2 (patch by + David Michael).
  • + +
  • fix a misspelled subsection title in ctlseqs.ms and add a + note regarding blink which was rendered as bold in X11R6. + Blinking text was implemented in Patch + #60.
  • + +
  • fix typos in xterm.man (patches by Sven + Joachim, Larry Hynes).
  • + +
  • fix typography in xterm.man (patch by Bjarni + Ingi Gislason, Debian #869248).
  • + +
  • fix typo in INSTALL (Larry Hynes).
  • + +
  • add xterm-direct terminal description based on + changes introduced in patch #277, and + relying upon ncurses RGB + extension.
  • + +
  • modify xterm-new terminal description to use + ECMA-48 REP, reflecting its use in xterm since + patch #32 (1996).
  • + +
  • clarify comment in ctlseqs.ms regarding blink: it has been + part of xterm since patch #60 + (1998).
  • + +
  • update ftp URLs in documentation.
  • +
+

Patch #330 - 2017/06/20

@@ -3129,7 +3351,7 @@ Go-Mono-Italic.ttf: "Go Mono" "Italic"
  • add E3 extended capability to xterm-basic to match ncurses 20120728 + "https://invisible-island.net/ncurses/NEWS.html#t20120728">20120728 patch.
  • fix incorrect transformation of row-parameter for @@ -4007,7 +4229,7 @@ Go-Mono-Italic.ttf: "Go Mono" "Italic"
  • minor formatting changes to ctlseqs.ms to simplify a script which extracts the feature information. See the results in + "https://invisible-island.net/xterm/xterm.faq.html#compare_versions"> Comparing versions, by counting controls in the xterm FAQ.
  • @@ -4210,7 +4432,7 @@ Go-Mono-Italic.ttf: "Go Mono" "Italic"
    • modify configure check for luit to include new + "https://invisible-island.net/luit/">luit to include new aliases for the program (xterm-filter and bluit).
    • @@ -4275,7 +4497,7 @@ Go-Mono-Italic.ttf: "Go Mono" "Italic"
    • change default value of menuLocale resource to "C", to work around longstanding Xorg + "https://invisible-island.net/xterm/xterm.faq.html#slow_menus">Xorg bug.
    • modify handling of scrollKey feature to ignore @@ -5803,9 +6025,10 @@ Go-Mono-Italic.ttf: "Go Mono" "Italic" for the Xaw popup menus (adapted from patch by Dave Coffin).
    • -
    • modify do_precomposition() function and make-compose.sh to - handle 21-bit codes vs the 16-bit codes those were written for, - and fix a few mis-sorted codes (patch by Thomas Wolff).
    • +
    • modify do_precomposition() function and + make-precompose.sh to handle 21-bit codes vs the + 16-bit codes those were written for, and fix a few mis-sorted + codes (patch by Thomas Wolff).
    • handle special case in -cjk_width which unexpectedly caused a character's width to change when a @@ -8506,7 +8729,7 @@ Klanderman). (patch by Holger Veit).
    • used modified indent 2.0 (patch 20020428) to + "ftp://ftp.invisible-island.net/gnu-patches/">20020428) to reformat most of the C source files, to simplify maintenance.
    • diff --git a/app/xterm/xterm.man b/app/xterm/xterm.man index 6f5431b55..d92aad8b3 100644 --- a/app/xterm/xterm.man +++ b/app/xterm/xterm.man @@ -1,5 +1,5 @@ '\" t -.\" $XTermId: xterm.man,v 1.715 2017/06/18 18:07:02 tom Exp $ +.\" $XTermId: xterm.man,v 1.736 2017/12/30 13:47:54 tom Exp $ .\" .\" Copyright 1996-2016,2017 by Thomas E. Dickey .\" @@ -61,15 +61,15 @@ .\" .\" Bulleted paragraph .de bP -.ie \n(.IP \(bu 4 +.ie n .IP \(bu 4 .el .IP \(bu 2 .. .\" these would be fallbacks for DS/DE, .\" but groff changed the meaning of the macros. .de NS -.ie \n(.sp +.ie n .sp .el .sp .5 -.ie \n(.in +4 +.ie n .in +4 .el .in +2 .nf .ft C \" Courier @@ -94,7 +94,7 @@ xterm \- terminal emulator for X .if n .na .SH SYNOPSIS .B \*n -[\-\fItoolkitoption\fP ...] [\-\fIoption\fP ...] [\fIshell\fP] +[\-\fItoolkitoption\fP \&...\&] [\-\fIoption\fP \&...\&] [\fIshell\fP] .SH DESCRIPTION .hy 0 .nh @@ -347,6 +347,7 @@ There are a few drawbacks .bP \fI\*N\fP cannot tell easily whether a resource value was set by one of the external resource- or application-defaults files, +whether it was set using \fBxrdb\fP(1), or if it was set through the \fB\-xrm\fP option or via some directly relevant command-line option. \fI\*N\fP sees only the end-result: @@ -507,7 +508,7 @@ Set the \fIvt100\fP resource \fBcutToBeginningOfLine\fP to \*(``false\*(''. .B "+cb" Set the \fIvt100\fP resource \fBcutToBeginningOfLine\fP to \*(``true\*(''. .TP 8 -.B "\-cc \fIcharacterclassrange\fP:\fIvalue\fP[,...]" +.B "\-cc \fIcharacterclassrange\fP:\fIvalue\fP[, \&...\&]" This sets classes indicated by the given ranges for using in selecting by words (see \fBCHARACTER CLASSES\fP and the \fBcharClass\fP resource). .TP 8 @@ -586,7 +587,7 @@ The option sets the \fBdynamicColors\fP option to \*(``false\*(''. This option enables the escape sequence to change dynamic colors. The option sets the \fBdynamicColors\fP option to \*(``true\*(''. .TP 8 -.BI \-e "\fI program \fP[ \fIarguments \fP.\|.\|. ]\fI" +.BI \-e "\fI program \fP[ \fIarguments \fP\&.\|.\|.\& ]\fI" This option specifies the program (and its command line arguments) to be run in the \fI\*n\fP window. It also sets the window title and icon @@ -627,23 +628,23 @@ See also the \fBrenderFont\fP resource, which combines with this to determine whether FreeType fonts are initially active. .TP 8 -.BI \-fbb +.B \-fbb This option indicates that \fI\*n\fP should compare normal and bold fonts bounding boxes to ensure they are compatible. It sets the \fBfreeBoldBox\fP resource to \*(``false\*(''. .TP 8 -.BI +fbb +.B +fbb This option indicates that \fI\*n\fP should not compare normal and bold fonts bounding boxes to ensure they are compatible. It sets the \fBfreeBoldBox\fP resource to \*(``true\*(''. .TP 8 -.BI \-fbx +.B \-fbx This option indicates that \fI\*n\fP should not assume that the normal and bold fonts have VT100 line-drawing characters. If any are missing, \fI\*n\fP will draw the characters directly. It sets the \fBforceBoxChars\fP resource to \*(``false\*(''. .TP 8 -.BI +fbx +.B +fbx This option indicates that \fI\*n\fP should assume that the normal and bold fonts have VT100 line-drawing characters. It sets the \fBforceBoxChars\fP resource to \*(``true\*(''. @@ -664,13 +665,13 @@ This option sets the pointsize for fonts selected from the FreeType library if support for that library was compiled into \fI\*n\fP. This corresponds to the \fBfaceSize\fP resource. .TP 8 -.BI \-fullscreen +.B \-fullscreen This option indicates that \fI\*n\fP should ask the window manager to let it use the full-screen for display, e.g., without window decorations. It sets the \fBfullscreen\fP resource to \*(``true\*(''. .TP 8 -.BI +fullscreen +.B +fullscreen This option indicates that \fI\*n\fP should not ask the window manager to let it use the full-screen for display. It sets the \fBfullscreen\fP resource to \*(``false\*(''. @@ -702,35 +703,35 @@ See also the discussion of the \fBximFont\fP resource. .BI \-hc " color" (see \fB\-selbg\fP). .TP 8 -.BI \-hf +.B \-hf This option indicates that HP function key escape codes should be generated for function keys. It sets the \fBhpFunctionKeys\fP resource to \*(``true\*(''. .TP 8 -.BI +hf +.B +hf This option indicates that HP function key escape codes should not be generated for function keys. It sets the \fBhpFunctionKeys\fP resource to \*(``false\*(''. .TP 8 -.BI \-hm +.B \-hm Tells \fI\*n\fP to use \fBhighlightTextColor\fP and \fBhighlightColor\fP to override the reversed foreground/background colors in a selection. It sets the \fBhighlightColorMode\fP resource to \*(``true\*(''. .TP 8 -.BI +hm +.B +hm Tells \fI\*n\fP not to use \fBhighlightTextColor\fP and \fBhighlightColor\fP to override the reversed foreground/background colors in a selection. It sets the \fBhighlightColorMode\fP resource to \*(``false\*(''. .TP 8 -.BI \-hold +.B \-hold Turn on the \fBhold\fP resource, i.e., \fI\*n\fP will not immediately destroy its window when the shell command completes. It will wait until you use the window manager to destroy/kill the window, or if you use the menu entries that send a signal, e.g., HUP or KILL. .TP 8 -.BI +hold +.B +hold Turn off the \fBhold\fP resource, i.e., \fI\*n\fP will immediately destroy its window when the shell command completes. .TP 8 @@ -792,7 +793,7 @@ This option indicates that \fI\*n\fP should not do jump scrolling. .B \-k8 This option sets the \fBallowC1Printable\fP resource. When \fBallowC1Printable\fP is set, \fI\*n\fP overrides the mapping -of C1 control characters (code 128-159) to treat them as printable. +of C1 control characters (code 128\(en159) to treat them as printable. .TP 8 .B +k8 This option resets the \fBallowC1Printable\fP resource. @@ -902,7 +903,7 @@ See the \fB\-l\fP option. .B \-ls This option indicates that the shell that is started in the \fI\*n\fP window will be a login shell (i.e., the first character of argv[0] will be a dash, -indicating to the shell that it should read the user's .login or .profile). +indicating to the shell that it should read the user's \&.login or \&.profile). .IP The \fB\-ls\fP flag and the \fBloginShell\fP resource are ignored if \fB\-e\fP is also given, @@ -1249,7 +1250,7 @@ enables the display of characters with underline attribute as italics rather than with underlining. .TP 8 .B \-ut -This option indicates that \fI\*n\fP should not write a record into the +This option indicates that \fI\*n\fP should not write a record into the system \fIutmp\fP log file. .TP 8 .B +ut @@ -1325,9 +1326,9 @@ Examples (the first two are equivalent since the descriptor follows the last \*(``/\*(''): .NS 15 --S/dev/pts/123/45 --S123/45 --Sab34 +\-S/dev/pts/123/45 +\-S123/45 +\-Sab34 .NE .IP Note that \fI\*n\fP does not close any file descriptor @@ -1488,10 +1489,11 @@ Here are tables showing how the initial settings for .bP .B ptyInitialErase\fP (PIE), along with the .bP -\fIstty\fP erase character (^H for backspace, ^? for delete) +\fIstty\fP erase character (^H for backspace, ^?\& for delete) .RE .IP -will affect DECBKM. First, \fI\*n\fP obtains the initial \fIerase\fP character: +will affect DECBKM. +First, \fI\*n\fP obtains the initial \fIerase\fP character: .RS .bP \fI\*n\fP's internal value is ^H @@ -1526,8 +1528,9 @@ if \fBbackarrowKeyIsErase\fP is true, \fI\*n\fP uses the \fIerase\fP character for the initial state of \fBDECBKM\fP .bP if \fBbackarrowKeyIsErase\fP is false, \fI\*n\fP sets \fBDECBKM\fP -to 2 (internal). This ties together \fBbackarrowKey\fP -and the control sequence for \fBDECBKM\fP +to 2 (internal). +This ties together \fBbackarrowKey\fP +and the control sequence for \fBDECBKM\fP. .bP applications can send a control sequence to set/reset \fBDECBKM\fP control set .bP @@ -1774,7 +1777,7 @@ terminal initialization is complete. This is needed for some systems whose pseudo-terminals cannot propagate terminal characteristics. Where it is not needed, it can interfere with other methods for -setting the intial screen size, e.g., via window manager interaction. +setting the initial screen size, e.g., via window manager interaction. .IP See also \fBwaitForMap\fP which waits for a handshake-message giving the pseudo-terminal's notion of the screen size. @@ -1921,7 +1924,7 @@ This is very useful for overriding the default terminal settings without having to do an \fIstty\fP every time an \fI\*n\fP is started. Note, however, that the \fIstty\fP program on a given host may use different -keywords; \fI\*n\fR's table is built-in. +keywords; \fI\*n\fR's table is built in. .IP If the \fBttyModes\fP resource specifies a value for \fBerase\fP, that overrides the \fBptyInitialErase\fP resource setting, @@ -2028,7 +2031,7 @@ This overrides both the \fBalwaysBoldMode\fP and the \fBboldMode\fP resources. .TP 8 .B "allowC1Printable\fP (class\fB AllowC1Printable\fP)" If true, overrides the mapping of C1 controls -(codes 128-159) to make them be treated +(codes 128\(en159) to make them be treated as if they were printable characters. Although this corresponds to no particular standard, some users insist it is a VT100. @@ -2443,7 +2446,7 @@ The default for this resource is \*(``false\*(''. .B "charClass\fP (class\fB CharClass\fP)" Specifies comma-separated lists of character class bindings of the form .NS -\fIlow\fP[-\fIhigh]\fP[:\fIvalue\fP]. +\fIlow\fP[\-\fIhigh]\fP[:\fIvalue\fP]. .NE .IP These are used in determining which @@ -2489,7 +2492,7 @@ magenta3, cyan3, and gray90. -The default shades of color are chosen to allow the colors 8-15 +The default shades of color are chosen to allow the colors 8\(en15 to be used as brighter versions. .TP 8 .B "color8\fP (class\fB Color8\fP)" @@ -2651,12 +2654,53 @@ The default is \*(``false\*(''. .TP 8 .B "cursorBlink\fP (class\fB CursorBlink\fP)" Specifies whether to make the cursor blink. -The default is \*(``false\*(''. +\fI\*N\fP accepts either a keyword (ignoring case) +or the number shown in parentheses: +.RS +.TP 3 +false (0) +The cursor will not blink, but may be combined with escape sequences +according to the \fBcursorBlinkXOR\fP resource. +.TP 3 +true (1) +The cursor will blink, but may be combined with escape sequences +according to the \fBcursorBlinkXOR\fP resource. +.TP 3 +always (2) +The cursor will always blink, ignoring escape sequences. +The menu entry will be disabled. +.TP 3 +never (3) +The cursor will never blink, ignoring escape sequences. +The menu entry will be disabled. +.RE .IP -\fI\*N\fP uses two variables to determine whether the cursor blinks. -One is set by this resource. -The other is set by control sequences (private mode 12 and DECSCUSR). -\fI\*N\fP tests the XOR of the two variables. +The default is \*(``false\*(''. +.TP 8 +.B "cursorBlinkXOR\fP (class\fB CursorBlinkXOR\fP)" +\fI\*N\fP uses two inputs to determine whether the cursor blinks: +.RS +.bP +The \fBcursorBlink\fP resource (which can be altered with a menu entry). +.bP +Control sequences (private mode 12 and DECSCUSR). +.RE +.IP +The \fBcursorBlinkXOR\fP resource determines how those inputs are combined: +.RS +.TP 5 +false +.br +\fI\*N\fP uses the logical-OR of the two variables. +If either is set, \fI\*n\fP makes the cursor blink. +.TP 5 +true +.br +\fI\*N\fP uses the logical-XOR of the two variables. +If only one is set, \fI\*n\fP makes the cursor blink. +.RE +.IP +The default is \*(``true\*(''. .TP 8 .B "cursorColor\fP (class\fB CursorColor\fP)" Specifies the color to use for the text cursor. @@ -2711,7 +2755,7 @@ Specify the character (or string) which \fI\*n\fP will substitute when pasted text includes a character which cannot be represented in the current encoding. For instance, pasting UTF-8 text into a display of ISO-8859-1 characters -will only be able to display codes 0-255, while UTF-8 text can include +will only be able to display codes 0\(en255, while UTF-8 text can include Unicode values above 255. The default is \*(``#\*('' (a single pound sign). .IP @@ -2725,6 +2769,13 @@ or the VT220-style Remove escape sequence. A \*(``false\*('' value enables the latter. The default is \*(``__delete_is_del__\*(''. .TP 8 +.B "directColor\fP (class\fB DirectColor\fP)" +Specifies whether to handle direct-color control sequences +using the X server's available colors, +or to approximate those using a color map with 256 entries. +A \*(``true\*('' value enables the former. +The default is \*(``true\*(''. +.TP 8 .B "disallowedColorOps\fP (class\fB DisallowedColorOps\fP)" Specify which features will be disabled if \fBallowColorOps\fP is false. This is a comma-separated list of names. @@ -2843,6 +2894,7 @@ from \fIdtterm\fP the operation number). The default value is .NS 20,21,SetXprop,SetSelection +(i.e.\& no operations are allowed). .NE .IP The names are listed below. @@ -2947,7 +2999,7 @@ but \*(``Alt\*('' keys are common, and they are conventionally used for \*(``Meta\*(''. If they were synonymous, it would have been reasonable to name this resource \*(``\fBaltSendsEscape\fP\*('', reversing its sense. -For more background on this, see the \fBmeta(3x)\fP function in curses. +For more background on this, see the \fBmeta\fP(3x) function in curses. .IP Note that the \fIAlt\fP key is not necessarily the same as the \fIMeta\fP modifier. @@ -3065,8 +3117,8 @@ or if there is no match for both TrueType normal and bold fonts, It is possible to select suitable bitmap fonts using a script such as this: .NS \&#!/bin/sh -\&FONT=`xfontsel -print` -\&test -n "$FONT" && xfd -fn "$FONT" +\&FONT=`xfontsel \-print` +\&test \-n "$FONT" && xfd \-fn "$FONT" .NE .IP However (even though \fIxfd\fP accepts a \*(``\fB\-fa\fP\*('' option @@ -3074,7 +3126,7 @@ to denote FreeType fonts), \fIxfontsel\fP has not been similarly extended. As a workaround, you may try .NS -fc-list :scalable=true:spacing=mono: family +fc\-list :scalable=true:spacing=mono: family .NE .IP to find a list of scalable fixed-pitch fonts @@ -3226,7 +3278,7 @@ have VT100 line-drawing characters: .RS .bP The fixed-pitch ISO-8859-*-encoded fonts used by \fI\*n\fP -normally have the VT100 line-drawing glyphs in cells 1-31. +normally have the VT100 line-drawing glyphs in cells 1\(en31. Other fixed-pitch fonts may be more attractive, but lack these glyphs. .bP When using an ISO-10646-1 font and the \fBwideChars\fP resource is true, @@ -3389,7 +3441,8 @@ If false, \fI\*n\fP will not request the targets \fBCOMPOUND_TEXT\fP or \fBTEXT\fP. -The default is \*(``true\*(''. It may be set to false in order to work around +The default is \*(``true\*(''. +It may be set to false in order to work around ICCCM violations by other X clients. .TP 8 .B "iconBorderColor\fP (class\fB BorderColor\fP)" @@ -3535,7 +3588,7 @@ which depends on your system configuration. If the encoding converter requires command-line parameters, you can add those after the command, e.g., .NS -*localeFilter: xterm-filter -p +*localeFilter: xterm\-filter \-p .NE .IP Alternatively, @@ -3582,7 +3635,7 @@ this resource controls the maximum size of a graph which can be displayed. .IP The default is \*(``1000x1000\*('' (given as \fIwidth\fP by \fIheight\fP). .IP -If the resource is \*(``auto\*('' then \fI\*n\fR will use the +If the resource is \*(``auto\*('' then \fI\*n\fR will use the \fBdecTerminalID\fP resource: .TS l l @@ -3777,6 +3830,10 @@ Specifies the number of characters from the right margin at which the margin bell should be rung, when enabled by the \fBmarginBell\fP resource. The default is \*(``10\*(''. .TP 8 +.B "nextEventDelay\fP (class\fB NextEventDelay\fP)" +Specifies a delay time in milliseconds before checking for new X events. +The default is \*(``1\*(''. +.TP 8 .B "numColorRegisters\fP (class\fB NumColorRegisters\fP)" If \fI\*n\fR is configured to support ReGIS or SIXEL graphics, this specifies the number of color-registers which are available. @@ -3818,7 +3875,7 @@ to \fBlegacy\fP. The \fBkeyboardType\fP resource is the preferred mechanism for selecting this mode. .IP The old-style escape sequences resemble VT220 keys, -but appear to have been invented for \fI\*n\fP in X11R4. +but appear to have been invented for \fI\*n\fP in X11R4. .TP 8 .B "on2Clicks\fP (class\fB On2Clicks\fP)" .TP @@ -3836,29 +3893,51 @@ action) are interpreted according to the resource values of The resource value can be one of these: .RS .TP 3 -word +.B word Select a \*(``word\*('' as determined by the \fBcharClass\fP resource. See the \fBCHARACTER CLASSES\fP section. .TP -line +.B line Select a line (counting wrapping). .TP -group +.B group Select a group of adjacent lines (counting wrapping). The selection stops on a blank line, and does not extend outside the current page. .TP -page +.B page Select all visible lines, i.e., the page. .TP -all +.B all +.br Select all lines, i.e., including the saved lines. .TP -regex -Select a \*(``word\*('' as determined by the regular expression which -follows in the resource value. +.B regex +Select the best match for the POSIX extended regular expression (ERE) which +follows in the resource value: +.RS +.bP +\fI\*N\fP matches the regular expression against a byte array +for the entire (possibly wrapped) line. +That byte array may be UTF-8 or ISO-8859-1, +depending on the mode in which \fI\*n\fP is running. +.bP +\fI\*N\fP steps through each byte-offset in this array, +keeping track of the best (longest) match. +If more than one match ties for the longest length, the first is used. +.IP +\fI\*N\fP does this to make it convenient to click anywhere in the area of +interest and cause the regular expression to match the entire word, etc. +.bP +The \*(``^\*('' and \*(``$\*('' anchors in a regular expression +denote the ends of the entire line. +.bP +If the regular expression contains backslashes \*(``\\\*('' those +should be escaped \*(``\\\\\*('' +because the X libraries interpret backslashes in resource strings. +.RE .TP -none +.B none No selection action is associated with this resource. \fI\*N\fP interprets it as the end of the list. For example, you may use it to disable triple (and higher) clicking @@ -3991,7 +4070,7 @@ the \fBprint-immediate\fP action is invoked. .bP If zero (0), then this selects the current (visible screen) plus the saved lines, except if the alternate screen is being used. -In that case, only the alternate screen is selectd. +In that case, only the alternate screen is selected. .bP If nonzero, the bits of this resource value (checked in descending order) @@ -4025,8 +4104,8 @@ The default is \*(``9\*('', which selects the current visible screen plus saved lines, with no special case for the alternated screen. .TP 8 .B "printerAutoClose\fP (class\fB PrinterAutoClose\fP)" -If \*(``true\*('', \fI\*n\fR will close the printer (a pipe) when the application switches -the printer offline with a Media Copy command. +If \*(``true\*('', \fI\*n\fR will close the printer (a pipe) when the +application switches the printer offline with a Media Copy command. The default is \*(``false\*(''. .TP 8 .B "printerCommand\fP (class\fB PrinterCommand\fP)" @@ -4065,7 +4144,7 @@ The default is \*(``true\*(''. .TP 8 .B "privateColorRegisters\fP (class\fB PrivateColorRegisters\fP)" If \fI\*n\fR is configured to support ReGIS or SIXEL graphics, -this controls whether \fI\*n\fR +this controls whether \fI\*n\fR allocates separate color registers for each sixel device control string, e.g., for DECGCI. If not true, color registers are allocated only once, @@ -4165,8 +4244,8 @@ in case the input-method server is not responding. This is a different issue than unsupported preedit type, etc. You may encounter retries if your X configuration (and its libraries) are missing pieces. -Setting this resource to zero ``0'' will cancel the retrying. -The default is ``3''. +Setting this resource to zero \*(``0\*('' will cancel the retrying. +The default is \*(``3\*(''. .TP 8 .B "reverseVideo\fP (class\fB ReverseVideo\fP)" Specifies whether or not reverse video should be simulated. @@ -4431,7 +4510,8 @@ The default is \*(``true\*(''. .TP 8 .B "utf8\fP (class\fB Utf8\fP)" This specifies whether \fI\*n\fP will run in UTF-8 mode. -If you set this resource, \fI\*n\fP also sets the \fBwideChars\fP resource as a side-effect. +If you set this resource, \fI\*n\fP also sets the \fBwideChars\fP resource +as a side-effect. The resource can be set via the menu entry \*(``UTF-8 Encoding\*(''. The default is \*(``default\*(''. .IP @@ -5020,7 +5100,7 @@ be changed through the resource database; see \fBActions\fP below. Pointer button one (usually left) is used to save text into the cut buffer: .NS -~Meta :\fBselect-start\fP() +~Meta :\fBselect\-start\fP() .NE .IP Move the cursor to beginning of the text, @@ -5029,7 +5109,7 @@ and releasing the button. The selected text is highlighted and is saved in the global \fIcut buffer\fP and made the selection when the button is released: .NS -:\fBselect-end\fP(\fBSELECT\fP, CUT_BUFFER0) \n\ +:\fBselect\-end\fP(\fBSELECT\fP, \fBCUT_BUFFER0\fP) \en .NE .IP Normally (but see the discussion of \fBon2Clicks\fP, etc): @@ -5058,14 +5138,14 @@ Pointer button two (usually middle) the given selection, if any, otherwise from the cut buffer, inserting it as keyboard input: .NS -~Ctrl ~Meta :\fB\fBinsert-selection\fP\fP(\fBSELECT\fP, CUT_BUFFER0) +~Ctrl ~Meta :\fB\fBinsert\-selection\fP\fP(\fBSELECT\fP, \fBCUT_BUFFER0\fP) .NE . .TP 5 Pointer button three (usually right) \fIextends\fP the current selection. .NS -~Ctrl ~Meta :\fB\fBstart-extend\fP\fP() +~Ctrl ~Meta :\fB\fBstart\-extend\fP\fP() .NE .IP (Without loss of generality, @@ -5162,14 +5242,16 @@ The \fBPRIMARY\fP token is a standard X feature, documented in the ICCCM which states .RS .PP -The selection named by the atom \fBPRIMARY\fP is used for all commands that take only a single argument and is the principal means of communication between clients that use the selection mechanism. +The selection named by the atom \fBPRIMARY\fP is used for all commands +that take only a single argument and is the principal means of +communication between clients that use the selection mechanism. .RE .SS SELECT .PP However, many applications use \fBCLIPBOARD\fP in imitation of other windowing systems. The \fBselectToClipboard\fP resource (and corresponding menu entry -\fBSelect to Clipboard\fP) introduce the SELECT token (known only +\fBSelect to Clipboard\fP) introduce the \fBSELECT\fP token (known only to \fI\*n\fP) which chooses between the \fBPRIMARY\fP and \fBCLIPBOARD\fP tokens. .PP Without using this feature, one can use workarounds such as the @@ -5356,7 +5438,8 @@ there is no portable equivalent in CSS 2.2. .IP The font is whatever your browser uses for preformatted (
      )
      -elements. The XHTML file references a cascading style sheet (CSS)
      +elements.
      +The XHTML file references a cascading style sheet (CSS)
       named \*(``\fBxterm.css\fP\*('' that you can create to select a font or
       override properties.
       .RS
      @@ -5382,7 +5465,8 @@ In addition you may use
       .RE
       .IP
       Attributes faint, reverse and blink are implemented as \fIstyle\fP attributes
      -setting color properties. All colors are specified as RGB percentages
      +setting color properties.
      +All colors are specified as RGB percentages
       in order to support displays with 10 bits per RGB.
       .IP
       The name of the file will be
      @@ -5407,7 +5491,7 @@ is started in, or the home directory for a login
       The \fBdump-html\fP action can also be triggered using the Media Copy
       control sequence CSI 1 0 i, for example from a shell script with
       .NS
      -printf '\\033[10i'
      +printf \*(AQ\\033[10i\*(AQ
       .NE
       .sp
       Only the UTF-8 encoding is supported.
      @@ -5446,7 +5530,7 @@ is started in, or the home directory for a login
       The \fBdump-svg\fP action can also be triggered using the Media Copy
       control sequence CSI 1 1 i, for example from a shell script with
       .NS
      -printf '\\033[11i'
      +printf \*(AQ\\033[11i\*(AQ
       .NE
       .sp
       Only the UTF-8 encoding is supported.
      @@ -5458,7 +5542,7 @@ Modes for setting keyboard style:
       .B 8-Bit Controls\fP (resource \fB8-bit-control\fP)
       Enabled for VT220 emulation, this controls whether \fI\*n\fP will send
       8-bit control sequences rather than using 7-bit (ASCII) controls,
      -e.g., sending a byte in the range 128-159 rather than the escape character
      +e.g., sending a byte in the range 128\(en159 rather than the escape character
       followed by a second byte.
       \fI\*N\fP always interprets both 8-bit and 7-bit control sequences
       (see \fI\*N Control Sequences\fP).
      @@ -5597,7 +5681,8 @@ As a special case, the XON / XOFF keys (control/S and control/Q) are ignored.
       .
       .TP
       .B Scroll to Bottom on Tty Output\fP (resource \fBscrollttyoutput\fP)
      -Enable (or disable) scrolling to the bottom of the scrolling region on output to the terminal.
      +Enable (or disable) scrolling to the bottom of the scrolling region on
      +output to the terminal.
       This corresponds to the \fB\-si\fP option and the \fBscrollTtyOutput\fP resource.
       .
       .TP
      @@ -5642,11 +5727,23 @@ This corresponds to the \fB\-pop\fP option and the \fBpopOnBell\fP resource.
       .B Enable Blinking Cursor\fP (resource \fBcursorblink\fP)
       Enable (or disable) the blinking-cursor feature.
       This corresponds to the \fB\-bc\fP option and the \fBcursorBlink\fP resource.
      -There is also an escape sequence
      -(see \fI\*N Control Sequences\fP).
      -The menu entry and the escape sequence states are XOR'd:
      +There are also escape sequences
      +(see \fI\*N Control Sequences\fP):
      +.RS
      +.bP
      +If the \fBcursorBlinkXOR\fP resource is set,
      +the menu entry and the escape sequence states will be XOR'd:
       if both are enabled, the cursor will not blink,
       if only one is enabled, the cursor will blink.
      +.bP
      +If the \fBcursorBlinkXOR\fP is not set;
      +if either the menu entry or the escape sequence states are set,
      +the cursor will blink.
      +.RE
      +.IP
      +In either case, the checkbox for the menu shows the state of the
      +\fBcursorBlink\fP resource,
      +which may not correspond to what the cursor is actually doing.
       .
       .TP
       .B Enable Alternate Screen Switching\fP (resource \fBtiteInhibit\fP)
      @@ -5679,9 +5776,11 @@ this controls whether a private color palette can be used.
       .IP
       When enabled,
       each graphic image uses a separate set of color registers, so that it
      -essentially has a private palette (this is the default).  If it is not set,
      +essentially has a private palette (this is the default).
      +If it is not set,
       all graphics images share a common set of registers which is how sixel and
      -ReGIS graphics worked on actual hardware.  The default is likely a more
      +ReGIS graphics worked on actual hardware.
      +The default is likely a more
       useful mode on modern TrueColor hardware.
       .IP
       This corresponds to the \fBprivateColorRegisters\fP resource.
      @@ -5760,7 +5859,7 @@ the alternate screen does not.
       .SS "VT Fonts"
       .PP
       The \fI\*n\fP \fIfontMenu\fP pops up when
      -when the \*(``control\*('' key and pointer button three are pressed in a window.
      +the \*(``control\*('' key and pointer button three are pressed in a window.
       It sets the font used in the VT\fIxxx\fP window,
       or modifies the way the font is specified or displayed.
       There are several sections.
      @@ -5860,7 +5959,7 @@ Assuming the standard app-defaults files,
       this command will launch \fI\*n\fP able to switch between UTF-8
       and ISO-8859-1 encoded fonts:
       .NS
      -u\*n -class __default_class__
      +u\*n \-class __default_class__
       .NE
       .RE
       .PP
      @@ -6039,7 +6138,8 @@ The
       to 65535, corresponding to the code for the character or characters to be
       set.
       .bP
      -The \fIvalue\fP is arbitrary.  For example, the default table uses the
      +The \fIvalue\fP is arbitrary.
      +For example, the default table uses the
       character number of the first character occurring in the set.
       When not in
       UTF-8 mode, only the first 256 entries of this table will be used.
      @@ -6180,7 +6280,7 @@ of lines saved off the top of the screen.
       It is also invoked from the \fBclearsavedlines\fP entry in \fIvtMenu\fP.
       The effect is identical to a hardware reset (RIS) control sequence.
       .TP 8
      -.B "copy-selection(\fIdestname\fP [, ...])"
      +.B "copy-selection(\fIdestname\fP [, \&...\&])"
       This action puts the currently selected text into all of the selections or
       cutbuffers specified by \fIdestname\fP.
       Unlike \fBselect-end\fP, it does not send a mouse position or otherwise
      @@ -6209,7 +6309,7 @@ of \*(``dynamic abbreviation\*('' expansion in Emacs (bound there to M\-/).
       Here is a resource setting for \fI\*n\fP which will do the same thing:
       .NS
       *VT100*translations:    #override \\n\\\&
      -        Meta  /:\fBdabbrev-expand\fP()
      +        Meta  /:\fBdabbrev\-expand\fP()
       .NE
       .TP 8
       .B "deiconify()"
      @@ -6227,7 +6327,7 @@ by echoing the event's position
       ^X ESC G  
       .in -8
       .TP 8
      -.B "exec-formatted(\fIformat\fP, \fIsourcename\fP [, ...])"
      +.B "exec-formatted(\fIformat\fP, \fIsourcename\fP [, \&...\&])"
       Execute an external command,
       using the current selection for part of the command's parameters.
       The first parameter, \fIformat\fP gives the basic command.
      @@ -6285,8 +6385,8 @@ For example, this translation would invoke a new \fI\*n\fP process
       to view a file whose name is selected while holding the shift key down.
       The new process is started when the mouse button is released:
       .NS
      -*VT100*translations: #override Shift \\
      -    :\fBexec-formatted\fP("xterm -e view '%t'", \fBSELECT\fP)
      +*VT100*translations: #override Shift \\\&
      +    :\fBexec\-formatted\fP("xterm \-e view \*(AQ%t\*(AQ", \fBSELECT\fP)
       .NE
       .TP 8
       .B "exec-selectable(\fIformat\fP, \fIonClicks\fP)"
      @@ -6343,7 +6443,7 @@ send an ESC byte before the key, or
       send the key unaltered.
       .RE
       .TP 8
      -.B "insert-formatted(\fIformat\fP, \fIsourcename\fP [, ...])"
      +.B "insert-formatted(\fIformat\fP, \fIsourcename\fP [, \&...\&])"
       Insert the current selection or data related to it, formatted.
       The first parameter, \fIformat\fP gives the template for the data
       as in \fBexec-formatted\fP.
      @@ -6356,15 +6456,15 @@ as in \fBexec-formatted\fP.
       The second parameter specifies the method for copying
       the data as in the \fBon2Clicks\fP resource.
       .TP 8
      -.B "insert-selection(\fIsourcename\fP [, ...])"
      +.B "insert-selection(\fIsourcename\fP [, \&...\&])"
       This action inserts the string found in the selection or cutbuffer indicated
       by \fIsourcename\fP.
       Sources are checked in the order given (case is
       significant) until one is found.
       Commonly-used selections include:
      -\fIPRIMARY\fP, \fISECONDARY\fP, and \fICLIPBOARD\fP.
      +\fBPRIMARY\fP, \fBSECONDARY\fP, and \fBCLIPBOARD\fP.
       Cut buffers are
      -typically named \fICUT_BUFFER0\fP through \fICUT_BUFFER7\fP.
      +typically named \fBCUT_BUFFER0\fP through \fBCUT_BUFFER7\fP.
       .TP 8
       .B "insert-seven-bit()"
       This action is a synonym for \fBinsert()\fP.
      @@ -6424,33 +6524,33 @@ The parameter values are matched ignoring case:
       .TP 5
       noFormFeed
       no form feed will be sent at the end of the last line printed
      -(i.e., \fBprinterFormFeed\fP is ``false'').
      +(i.e., \fBprinterFormFeed\fP is \*(``false\*('').
       .TP 5
       FormFeed
       a form feed will be sent at the end of the last line printed
      -(i.e., \fBprinterFormFeed\fP is ``true'').
      +(i.e., \fBprinterFormFeed\fP is \*(``true\*('').
       .TP 5
       noNewLine
       no newline will be sent at the end of the last line printed,
       and wrapped lines will be combined into long lines
      -(i.e., \fBprinterNewLine\fP is ``false'').
      +(i.e., \fBprinterNewLine\fP is \*(``false\*('').
       .TP 5
       NewLine
       a newline will be sent at the end of the last line printed,
       and each line will be limited (by adding a newline) to the screen width
      -(i.e., \fBprinterNewLine\fP is ``true'').
      +(i.e., \fBprinterNewLine\fP is \*(``true\*('').
       .TP 5
       noAttrs
       the page is printed without attributes
      -(i.e., \fBprintAttributes\fP is ``0'').
      +(i.e., \fBprintAttributes\fP is \*(``0\*('').
       .TP 5
       monoAttrs
       the page is printed with monochrome (vt220) attributes
      -(i.e., \fBprintAttributes\fP is ``1'').
      +(i.e., \fBprintAttributes\fP is \*(``1\*('').
       .TP 5
       colorAttrs
       the page is printed with ANSI color attributes
      -(i.e., \fBprintAttributes\fP is ``2'').
      +(i.e., \fBprintAttributes\fP is \*(``2\*('').
       .RE
       .TP 8
       .B "print-everything(\fIprinter-flags\fP)"
      @@ -6510,7 +6610,7 @@ The \fIcount\fP argument
       indicates the number of \fIunits\fP (which may be \fIpage\fP, \fIhalfpage\fP,
       \fIpixel\fP, or \fIline\fP) by which to scroll.
       .IP
      -An adjustment can be specified for these values
      +An adjustment can be specified for the \fIpage\fP or \fIhalfpage\fP units
       by appending a \*(``+\*('' or \*(``\-\*(''
       sign followed by a number,
       e.g., \fIpage\-2\fP to specify 2 lines less than a page.
      @@ -6532,7 +6632,20 @@ This action sets, unsets or toggles internal state which tells
       \fI\*n\fP whether Scroll Lock is active,
       subject to the \fBallowScrollLock\fP resource.
       .TP 8
      -.B "select-cursor-end(\fIdestname\fP [, ...])"
      +.B "scroll-to(\fIcount\fP)"
      +Scroll to the given line relative to the beginning of the saved-lines.
      +For instance, \*(``\fBscroll-to(0)\fP\*('' would scroll to the beginning.
      +Two special nonnumeric parameters are recognized:
      +.RS
      +.TP 8
      +.B scroll-to(begin)
      +Scroll to the beginning of the saved lines.
      +.TP 8
      +.B scroll-to(end)
      +Scroll to the end of the saved lines, i.e., to the currently active page.
      +.RE
      +.TP 8
      +.B "select-cursor-end(\fIdestname\fP [, \&...\&])"
       This action is similar to \fBselect-end\fP except that it should be used
       with \fBselect-cursor-start\fP.
       .TP 8
      @@ -6544,7 +6657,7 @@ with \fBselect-cursor-start\fP.
       This action is similar to \fBselect-start\fP except that it begins the
       selection at the current text cursor position.
       .TP 8
      -.B "select-end(\fIdestname\fP [, ...])"
      +.B "select-end(\fIdestname\fP [, \&...\&])"
       This action puts the currently selected text into all of the selections or
       cutbuffers specified by \fIdestname\fP.
       It also sends a mouse position and updates the internal selection state
      @@ -6640,8 +6753,9 @@ This action sets, unsets or toggles the \fBjumpscroll\fP resource.
       It is also invoked by the \fBjumpscroll\fP entry in \fIvtMenu\fP.
       .TP 8
       .B "set-font-linedrawing(\fIon/off/toggle\fP)"
      -This action sets, unsets or toggles the \fI\*n\fR's state regarding whether the current font
      -has line-drawing characters and whether it should draw them directly.
      +This action sets, unsets or toggles the \fI\*n\fR's state regarding whether
      +the current font has line-drawing characters and whether it should draw them
      +directly.
       It is also invoked by the \fBfont-linedrawing\fP entry in \fIfontMenu\fP.
       .\" .\" not implemented
       .\" .TP 8
      @@ -6898,70 +7012,70 @@ The default bindings in the VT\fIxxx\fP window use the \fBSELECT\fP token,
       which is set by the \fBselectToClipboard\fP resource.
       These are for the \fIvt100\fP widget:
       .NS
      -          Shift  Prior:\fBscroll-back\fP(1,halfpage) \\n\\\&
      -           Shift  Next:\fBscroll-forw\fP(1,halfpage) \\n\\\&
      -         Shift  Select:\fBselect-cursor-start\fP() \\\&
      -                                 \fBselect-cursor-end\fP(\fBSELECT\fP, CUT_BUFFER0) \\n\\\&
      -         Shift  Insert:\fBinsert-selection\fP(\fBSELECT\fP, CUT_BUFFER0) \\n\\\&
      +          Shift  Prior:\fBscroll\-back\fP(1,halfpage) \\n\\\&
      +           Shift  Next:\fBscroll\-forw\fP(1,halfpage) \\n\\\&
      +         Shift  Select:\fBselect\-cursor\-start\fP() \\\&
      +                                 \fBselect\-cursor\-end\fP(\fBSELECT\fP, \fBCUT_BUFFER0\fP) \\n\\\&
      +         Shift  Insert:\fBinsert\-selection\fP(\fBSELECT\fP, \fBCUT_BUFFER0\fP) \\n\\\&
                        Alt Return:\fBfullscreen\fP() \\n\\\&
      -         Scroll_Lock:\fBscroll-lock\fP() \\n\\\&
      -    Shift~Ctrl  KP_Add:\fBlarger-vt-font\fP() \\n\\\&
      -    Shift Ctrl  KP_Add:\fBsmaller-vt-font\fP() \\n\\\&
      -    Shift  KP_Subtract:\fBsmaller-vt-font\fP() \\n\\\&
      -                ~Meta :\fBinsert-seven-bit\fP() \\n\\\&
      -                 Meta :\fBinsert-eight-bit\fP() \\n\\\&
      -                !Ctrl :\fBpopup-menu\fP(mainMenu) \\n\\\&
      -           !Lock Ctrl :\fBpopup-menu\fP(mainMenu) \\n\\\&
      - !Lock Ctrl @Num_Lock :\fBpopup-menu\fP(mainMenu) \\n\\\&
      -     ! @Num_Lock Ctrl :\fBpopup-menu\fP(mainMenu) \\n\\\&
      -                ~Meta :\fBselect-start\fP() \\n\\\&
      -              ~Meta :\fBselect-extend\fP() \\n\\\&
      -                !Ctrl :\fBpopup-menu\fP(vtMenu) \\n\\\&
      -           !Lock Ctrl :\fBpopup-menu\fP(vtMenu) \\n\\\&
      - !Lock Ctrl @Num_Lock :\fBpopup-menu\fP(vtMenu) \\n\\\&
      -     ! @Num_Lock Ctrl :\fBpopup-menu\fP(vtMenu) \\n\\\&
      +         Scroll_Lock:\fBscroll\-lock\fP() \\n\\\&
      +    Shift~Ctrl  KP_Add:\fBlarger\-vt\-font\fP() \\n\\\&
      +    Shift Ctrl  KP_Add:\fBsmaller\-vt\-font\fP() \\n\\\&
      +    Shift  KP_Subtract:\fBsmaller\-vt\-font\fP() \\n\\\&
      +                ~Meta :\fBinsert\-seven\-bit\fP() \\n\\\&
      +                 Meta :\fBinsert\-eight\-bit\fP() \\n\\\&
      +                !Ctrl :\fBpopup\-menu\fP(mainMenu) \\n\\\&
      +           !Lock Ctrl :\fBpopup\-menu\fP(mainMenu) \\n\\\&
      + !Lock Ctrl @Num_Lock :\fBpopup\-menu\fP(mainMenu) \\n\\\&
      +     ! @Num_Lock Ctrl :\fBpopup\-menu\fP(mainMenu) \\n\\\&
      +                ~Meta :\fBselect\-start\fP() \\n\\\&
      +              ~Meta :\fBselect\-extend\fP() \\n\\\&
      +                !Ctrl :\fBpopup\-menu\fP(vtMenu) \\n\\\&
      +           !Lock Ctrl :\fBpopup\-menu\fP(vtMenu) \\n\\\&
      + !Lock Ctrl @Num_Lock :\fBpopup\-menu\fP(vtMenu) \\n\\\&
      +     ! @Num_Lock Ctrl :\fBpopup\-menu\fP(vtMenu) \\n\\\&
                 ~Ctrl ~Meta :\fBignore\fP() \\n\\\&
      -                 Meta :\fBclear-saved-lines\fP() \\n\\\&
      -            ~Ctrl ~Meta :\fBinsert-selection\fP(\fBSELECT\fP, CUT_BUFFER0) \\n\\\&
      -                !Ctrl :\fBpopup-menu\fP(fontMenu) \\n\\\&
      -           !Lock Ctrl :\fBpopup-menu\fP(fontMenu) \\n\\\&
      - !Lock Ctrl @Num_Lock :\fBpopup-menu\fP(fontMenu) \\n\\\&
      -     ! @Num_Lock Ctrl :\fBpopup-menu\fP(fontMenu) \\n\\\&
      -          ~Ctrl ~Meta :\fBstart-extend\fP() \\n\\\&
      -              ~Meta :\fBselect-extend\fP() \\n\\\&
      -                 Ctrl :\fBscroll-back\fP(1,halfpage,m) \\n\\\&
      -            Lock Ctrl :\fBscroll-back\fP(1,halfpage,m) \\n\\\&
      -  Lock @Num_Lock Ctrl :\fBscroll-back\fP(1,halfpage,m) \\n\\\&
      -       @Num_Lock Ctrl :\fBscroll-back\fP(1,halfpage,m) \\n\\\&
      -                      :\fBscroll-back\fP(5,line,m)     \\n\\\&
      -                 Ctrl :\fBscroll-forw\fP(1,halfpage,m) \\n\\\&
      -            Lock Ctrl :\fBscroll-forw\fP(1,halfpage,m) \\n\\\&
      -  Lock @Num_Lock Ctrl :\fBscroll-forw\fP(1,halfpage,m) \\n\\\&
      -       @Num_Lock Ctrl :\fBscroll-forw\fP(1,halfpage,m) \\n\\\&
      -                      :\fBscroll-forw\fP(5,line,m)     \\n\\\&
      -                         :\fBselect-end\fP(\fBSELECT\fP, CUT_BUFFER0) \\n\\\&
      +                 Meta :\fBclear\-saved\-lines\fP() \\n\\\&
      +            ~Ctrl ~Meta :\fBinsert\-selection\fP(\fBSELECT\fP, \fBCUT_BUFFER0\fP) \\n\\\&
      +                !Ctrl :\fBpopup\-menu\fP(fontMenu) \\n\\\&
      +           !Lock Ctrl :\fBpopup\-menu\fP(fontMenu) \\n\\\&
      + !Lock Ctrl @Num_Lock :\fBpopup\-menu\fP(fontMenu) \\n\\\&
      +     ! @Num_Lock Ctrl :\fBpopup\-menu\fP(fontMenu) \\n\\\&
      +          ~Ctrl ~Meta :\fBstart\-extend\fP() \\n\\\&
      +              ~Meta :\fBselect\-extend\fP() \\n\\\&
      +                 Ctrl :\fBscroll\-back\fP(1,halfpage,m) \\n\\\&
      +            Lock Ctrl :\fBscroll\-back\fP(1,halfpage,m) \\n\\\&
      +  Lock @Num_Lock Ctrl :\fBscroll\-back\fP(1,halfpage,m) \\n\\\&
      +       @Num_Lock Ctrl :\fBscroll\-back\fP(1,halfpage,m) \\n\\\&
      +                      :\fBscroll\-back\fP(5,line,m)     \\n\\\&
      +                 Ctrl :\fBscroll\-forw\fP(1,halfpage,m) \\n\\\&
      +            Lock Ctrl :\fBscroll\-forw\fP(1,halfpage,m) \\n\\\&
      +  Lock @Num_Lock Ctrl :\fBscroll\-forw\fP(1,halfpage,m) \\n\\\&
      +       @Num_Lock Ctrl :\fBscroll\-forw\fP(1,halfpage,m) \\n\\\&
      +                      :\fBscroll\-forw\fP(5,line,m)     \\n\\\&
      +                         :\fBselect\-end\fP(\fBSELECT\fP, \fBCUT_BUFFER0\fP) \\n\\\&
                              :\fBignore\fP()
       .NE
       .PP
       The default bindings in the Tektronix window are analogous but less extensive.
       These are for the \fItek4014\fP widget:
       .NS
      -                 ~Meta: \fBinsert-seven-bit\fP() \\n\\\&
      -                  Meta: \fBinsert-eight-bit\fP() \\n\\\&
      -                !Ctrl : \fBpopup-menu\fP(mainMenu) \\n\\\&
      -           !Lock Ctrl : \fBpopup-menu\fP(mainMenu) \\n\\\&
      - !Lock Ctrl @Num_Lock : \fBpopup-menu\fP(mainMenu) \\n\\\&
      -      !Ctrl @Num_Lock : \fBpopup-menu\fP(mainMenu) \\n\\\&
      -                !Ctrl : \fBpopup-menu\fP(tekMenu) \\n\\\&
      -           !Lock Ctrl : \fBpopup-menu\fP(tekMenu) \\n\\\&
      - !Lock Ctrl @Num_Lock : \fBpopup-menu\fP(tekMenu) \\n\\\&
      -      !Ctrl @Num_Lock : \fBpopup-menu\fP(tekMenu) \\n\\\&
      -           Shift ~Meta: \fBgin-press\fP(L) \\n\\\&
      -                 ~Meta: \fBgin-press\fP(l) \\n\\\&
      -           Shift ~Meta: \fBgin-press\fP(M) \\n\\\&
      -                 ~Meta: \fBgin-press\fP(m) \\n\\\&
      -           Shift ~Meta: \fBgin-press\fP(R) \\n\\\&
      -                 ~Meta: \fBgin-press\fP(r)
      +                 ~Meta: \fBinsert\-seven\-bit\fP() \\n\\\&
      +                  Meta: \fBinsert\-eight\-bit\fP() \\n\\\&
      +                !Ctrl : \fBpopup\-menu\fP(mainMenu) \\n\\\&
      +           !Lock Ctrl : \fBpopup\-menu\fP(mainMenu) \\n\\\&
      + !Lock Ctrl @Num_Lock : \fBpopup\-menu\fP(mainMenu) \\n\\\&
      +      !Ctrl @Num_Lock : \fBpopup\-menu\fP(mainMenu) \\n\\\&
      +                !Ctrl : \fBpopup\-menu\fP(tekMenu) \\n\\\&
      +           !Lock Ctrl : \fBpopup\-menu\fP(tekMenu) \\n\\\&
      + !Lock Ctrl @Num_Lock : \fBpopup\-menu\fP(tekMenu) \\n\\\&
      +      !Ctrl @Num_Lock : \fBpopup\-menu\fP(tekMenu) \\n\\\&
      +           Shift ~Meta: \fBgin\-press\fP(L) \\n\\\&
      +                 ~Meta: \fBgin\-press\fP(l) \\n\\\&
      +           Shift ~Meta: \fBgin\-press\fP(M) \\n\\\&
      +                 ~Meta: \fBgin\-press\fP(m) \\n\\\&
      +           Shift ~Meta: \fBgin\-press\fP(R) \\n\\\&
      +                 ~Meta: \fBgin\-press\fP(r)
       .NE
       .SS Custom Key Bindings
       .PP
      @@ -6980,10 +7094,10 @@ When it loses the selection, it removes the corresponding highlight.
       But you can still paste from the corresponding cut buffer.
       .NS
       *VT100*translations:    #override \\n\\\&
      -   ~Shift~Ctrl: \fBinsert-selection\fP(\fBPRIMARY\fP, CUT_BUFFER0) \\n\\\&
      -    Shift~Ctrl: \fBinsert-selection\fP(\fBCLIPBOARD\fP, CUT_BUFFER1) \\n\\\&
      -   ~Shift      : \fBselect-end\fP(\fBPRIMARY\fP, CUT_BUFFER0) \\n\\\&
      -    Shift      : \fBselect-end\fP(\fBCLIPBOARD\fP, CUT_BUFFER1)
      +   ~Shift~Ctrl: \fBinsert\-selection\fP(\fBPRIMARY\fP, \fBCUT_BUFFER0\fP) \\n\\\&
      +    Shift~Ctrl: \fBinsert\-selection\fP(\fBCLIPBOARD\fP, \fBCUT_BUFFER1\fP) \\n\\\&
      +   ~Shift      : \fBselect\-end\fP(\fBPRIMARY\fP, \fBCUT_BUFFER0\fP) \\n\\\&
      +    Shift      : \fBselect\-end\fP(\fBCLIPBOARD\fP, \fBCUT_BUFFER1\fP)
       .NE
       .PP
       In the example, the class name \fBVT100\fP is used rather than the widget name.
      @@ -6992,19 +7106,42 @@ A leading \*(``*\*('' is used because the widget hierarchy above the
       \fIvt100\fP widget depends on
       whether the toolbar support is compiled into \fI\*n\fP.
       .PP
      +Most of the predefined translations are related to the mouse,
      +with a few that use some of the special keys on the keyboard.
      +Applications use special keys (function-keys, cursor-keys, keypad-keys)
      +with modifiers (shift, control, alt).
      +If \fI\*n\fP defines a translation for a given combination of
      +special key and modifier, that makes it unavailable for use
      +by applications within the terminal.
      +For instance, one might extend the use of \fIPage Up\fP and \fIPage Down\fP
      +keys seen here:
      +.NS
      +    Shift  Prior : \fBscroll\-back\fP(1,halfpage) \\n\\\&
      +    Shift  Next  : \fBscroll\-forw\fP(1,halfpage) \\n\\\&
      +.NE
      +.PP
      +to the \fIHome\fP and \fIEnd\fP keys:
      +.NS
      +    Shift  Home : \fBscroll\-to\fP(begin) \\n\\\&
      +    Shift  End  : \fBscroll\-to\fP(end)
      +.NE
      +.PP
      +but then shift\-\fIHome\fP and shift\-\fIEnd\fP would then
      +be unavailable to applications.
      +.PP
       Not everyone finds the three-button mouse bindings easy to use.
       In a wheel mouse, the middle button might be the wheel.
      -As an alternative, you could add a binding shifted keys:
      +As an alternative, you could add a binding using shifted keys:
       .NS
      -*VT100*translations:      #override \\n\\
      -    Shift Home:    \fBcopy-selection\fP(\fBSELECT\fP) \\n\\
      -    Shift Insert:  \fBcopy-selection\fP(\fBSELECT\fP) \\n\\
      -    Ctrl Shift C:  \fBcopy-selection\fP(\fBSELECT\fP) \\n\\
      -    Ctrl Shift V:  \fBinsert-selection\fP(\fBSELECT\fP)
      +*VT100*translations:      #override \\n\\\&
      +    Shift Home:    \fBcopy\-selection\fP(\fBSELECT\fP) \\n\\\&
      +    Shift Insert:  \fBcopy\-selection\fP(\fBSELECT\fP) \\n\\\&
      +    Ctrl Shift C:  \fBcopy\-selection\fP(\fBSELECT\fP) \\n\\\&
      +    Ctrl Shift V:  \fBinsert\-selection\fP(\fBSELECT\fP)
       .NE
       .PP
       You would still use the left- and right-mouse buttons (typically 1 and 3)
      -for beginning and extending selections. 
      +for beginning and extending selections.
       .PP
       Besides mouse problems, there are also keyboards with inconvenient layouts.
       Some lack a numeric keypad, making it hard to use the shifted keypad plus
      @@ -7012,9 +7149,9 @@ and minus bindings for switching between font sizes.
       You can work around that by assigning the actions to more readily accessed
       keys:
       .NS
      -*VT100*translations:      #override \\n\\
      -    Ctrl  +:       \fBlarger-vt-font\fP() \\n\\
      -    Ctrl  -:       \fBsmaller-vt-font\fP()
      +*VT100*translations:      #override \\n\\\&
      +    Ctrl  +:       \fBlarger\-vt\-font\fP() \\n\\\&
      +    Ctrl  \-:       \fBsmaller\-vt\-font\fP()
       .NE
       .PP
       The keymap feature allows you to switch between sets of translations.
      @@ -7025,14 +7162,14 @@ keys for entering commonly-typed words:
       *VT100.Translations: #override F13: keymap(dbx)
       *VT100.dbxKeymap.translations: \\\&
               F14:       \fBkeymap\fP(None) \\n\\\&
      -        F17:       \fBstring\fP("next") \\n\\
      +        F17:       \fBstring\fP("next") \\n\\\&
                               \fBstring\fP(0x0d) \\n\\\&
      -        F18:       \fBstring\fP("step") \\n\\
      +        F18:       \fBstring\fP("step") \\n\\\&
                               \fBstring\fP(0x0d) \\n\\\&
      -        F19:       \fBstring\fP("continue") \\n\\
      +        F19:       \fBstring\fP("continue") \\n\\\&
                               \fBstring\fP(0x0d) \\n\\\&
      -        F20:       \fBstring\fP("print ") \\n\\
      -                        \fBinsert-selection\fP(\fBPRIMARY\fP, CUT_BUFFER0)
      +        F20:       \fBstring\fP("print ") \\n\\\&
      +                        \fBinsert\-selection\fP(\fBPRIMARY\fP, \fBCUT_BUFFER0\fP)
       .NE
       .SS Default Scrollbar Bindings
       .PP
      @@ -7152,16 +7289,16 @@ A few examples of usage are given in this section.
       Some scripts use \fBecho\fP with options \fB\-e\fP and \fB\-n\fP to tell
       the shell to interpret the string \*(``\\e\*('' as the \fIescape\fP character and
       to suppress a trailing newline on output.
      -Those are not portable, not recommended.
      +Those are not portable, nor recommended.
       Instead, use \fBprintf\fP (POSIX).
       .PP
       For example, to set the \fIwindow title\fP to \*(``Hello world!\*('',
       you could use one of these commands in a script:
       .NS
      -printf '\\033]2;Hello world!\\033\\'
      -printf '\\033]2;Hello world!\\007'
      -printf '\\033]2;%s\\033\\' "Hello world!"
      -printf '\\033]2;%s\\007' "Hello world!"
      +printf \*(AQ\\033]2;Hello world!\\033\\\*(AQ
      +printf \*(AQ\\033]2;Hello world!\\007\*(AQ
      +printf \*(AQ\\033]2;%s\\033\\\*(AQ "Hello world!"
      +printf \*(AQ\\033]2;%s\\007\*(AQ "Hello world!"
       .NE
       .PP
       The \fBprintf\fP command interprets the octal value \*(``\\033\*('' for
      @@ -7171,10 +7308,10 @@ newline from the output.
       Some programs (such as \fBscreen\fP(1)) set both window- and icon-titles
       at the same time, using a slightly different control sequence:
       .NS
      -printf '\\033]0;Hello world!\\033\\'
      -printf '\\033]0;Hello world!\\007'
      -printf '\\033]0;%s\\033\\' "Hello world!"
      -printf '\\033]0;%s\\007' "Hello world!"
      +printf \*(AQ\\033]0;Hello world!\\033\\\*(AQ
      +printf \*(AQ\\033]0;Hello world!\\007\*(AQ
      +printf \*(AQ\\033]0;%s\\033\\\*(AQ "Hello world!"
      +printf \*(AQ\\033]0;%s\\007\*(AQ "Hello world!"
       .NE
       .PP
       The difference is the \fIparameter\fP \*(``0\*('' in each command.
      @@ -7183,10 +7320,10 @@ Some will make a distinction and allow you to set just the icon title.
       You can tell \fI\*n\fP to ask for this with a different parameter
       in the control sequence:
       .NS
      -printf '\\033]1;Hello world!\\033\\'
      -printf '\\033]1;Hello world!\\007'
      -printf '\\033]1;%s\\033\\' "Hello world!"
      -printf '\\033]1;%s\\007' "Hello world!"
      +printf \*(AQ\\033]1;Hello world!\\033\\\*(AQ
      +printf \*(AQ\\033]1;Hello world!\\007\*(AQ
      +printf \*(AQ\\033]1;%s\\033\\\*(AQ "Hello world!"
      +printf \*(AQ\\033]1;%s\\007\*(AQ "Hello world!"
       .NE
       .
       .SS Special Keys
      @@ -7195,13 +7332,13 @@ printf '\\033]1;%s\\007' "Hello world!"
       has two modes for the \fIspecial keys\fP (cursor-keys, numeric keypad,
       and certain function-keys):
       .bP
      -\fInormal mode\fP, which makes the special keys transmit 
      +\fInormal mode\fP, which makes the special keys transmit
       \*(``useful\*('' sequences such as the control sequence for cursor-up
       when pressing the up-arrow, and
       .bP
       \fIapplication mode\fP,
       which uses a different control sequence that cannot be mistaken for
      -the 
      +the
       \*(``useful\*('' sequences.
       .PP
       The main difference between the two modes is that normal mode sequences
      @@ -7242,9 +7379,9 @@ for its command-line use regardless of whether the terminal uses
       normal or application mode initially.
       Here is an example:
       .NS
      -[[ "$terminfo[kcuu1]" == "^[O"* ]] && \\
      -bindkey -M viins "${terminfo[kcuu1]/O/[}" \\
      -vi-up-line-or-history
      +[[ "$terminfo[kcuu1]" == "^[O"* ]] && \\\&
      +bindkey \-M viins "${terminfo[kcuu1]/O/[}" \\\&
      +vi\-up\-line\-or\-history
       .NE
       .
       .
      @@ -7259,12 +7396,12 @@ necessarily be the same as the number of characters.
       Because there is no guidance in the POSIX standard, each shell addresses
       the problem in a different way:
       .bP
      -\fBbash\fP treats characters within 
      +\fBbash\fP treats characters within
       \*(``\\[\*('' and
       \*(``\\]\*(''
       as nonprinting (using no width on the screen).
       .bP
      -\fBzsh\fP treats characters within 
      +\fBzsh\fP treats characters within
       \*(``%{\*('' and
       \*(``%}\*(''
       as nonprinting.
      @@ -7418,7 +7555,7 @@ If your display supports color, use this
       .in +10
       *customization: \-color
       .in -10
      -in your .Xdefaults file to
      +in your \&.Xdefaults file to
       automatically use this resource file rather than
       .IR __apploaddir__/__default_class__ .
       If you do not do this,
      @@ -7681,27 +7818,36 @@ tty(4)
       \fIXterm Control Sequences\fP
       (this is the file ctlseqs.ms).
       .sp
      -http://invisible-island.net/xterm/xterm.html
      +https://invisible\-island.net/xterm/xterm.html
       .br
      -http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
      +https://invisible\-island.net/xterm/manpage/xterm.html
       .br
      -http://invisible-island.net/xterm/xterm.faq.html
      +https://invisible\-island.net/xterm/ctlseqs/ctlseqs.html
      +.br
      +https://invisible\-island.net/xterm/xterm.faq.html
      +.br
      +https://invisible\-island.net/xterm/xterm.log.html
       .
       .
       .SH AUTHORS
      -Far too many people, including:
      -.sp
      +Far too many people.
      +.PP
      +These contributed to the X Consortium:
       Loretta Guarino Reid (DEC-UEG-WSL),
       Joel McCormack (DEC-UEG-WSL), Terry Weissman (DEC-UEG-WSL),
      -Edward Moy (Berkeley), Ralph R. Swick (MIT-Athena),
      +Edward Moy (Berkeley), Ralph R.\& Swick (MIT-Athena),
       Mark Vandevoorde (MIT-Athena), Bob McNamara (DEC-MAD),
       Jim Gettys (MIT-Athena), Bob Scheifler (MIT X Consortium), Doug Mink (SAO),
       Steve Pitschke (Stellar), Ron Newman (MIT-Athena), Jim Fulton (MIT X
      -Consortium), Dave Serisky (HP), Jonathan Kamens (MIT-Athena),
      +Consortium), Dave Serisky (HP), Jonathan Kamens (MIT-Athena).
      +.PP
      +Beginning with XFree86, there were far more identifiable contributors.
      +The \fITHANKS\fP file in \*n's source lists 189 at the end of 2017.
      +Keep in mind these:
       Jason Bacon,
       Jens Schweikhardt,
       Ross Combs,
      -Stephen P. Wall,
      +Stephen P.\& Wall,
       David Wexelblat, and
       Thomas Dickey (invisible-island.net).
       .SH OPENBSD SPECIFICS
      diff --git a/app/xterm/xtermcfg.h b/app/xterm/xtermcfg.h
      index cfd26f6b0..5af0ee2b9 100644
      --- a/app/xterm/xtermcfg.h
      +++ b/app/xterm/xtermcfg.h
      @@ -60,7 +60,7 @@
       /* #undef DEF_ALT_SENDS_ESC */	/* CF_ARG_ENABLE(alt-sends-esc) */
       /* #undef DEF_BACKARO_BS */		/* CF_ARG_DISABLE(backarrow-key) */
       #define DEF_BACKARO_ERASE 1	/* CF_ARG_ENABLE(backarrow-is-erase) */
      -/* #undef DEF_INITIAL_ERASE	/* CF_ARG_DISABLE(initial-erase) */
      +/* #undef DEF_INITIAL_ERASE */	/* CF_ARG_DISABLE(initial-erase) */
       /* #undef DEF_META_SENDS_ESC */	/* CF_ARG_ENABLE(meta-sends-esc) */
       /* #undef DFT_COLORMODE */		/* AC_ARG_WITH(default-color-mode) */
       #define DFT_DECID "100"		/* AC_ARG_WITH(default-terminal-id) */
      @@ -77,16 +77,18 @@
       #define HAVE_LIBXPM		/* CF_WITH_XPM */
       /* #undef HAVE_LIB_NEXTAW */		/* CF_X_ATHENA(--with-neXtaw) */
       /* #undef HAVE_LIB_PCRE */		/* CF_WITH_PCRE */
      +/* #undef HAVE_LIB_PCRE2 */		/* CF_WITH_PCRE2 */
       #define HAVE_LIB_XAW 1		/* CF_X_ATHENA */
       /* #undef HAVE_LIB_XAW3D */		/* CF_X_ATHENA(--with-Xaw3d) */
       /* #undef HAVE_LIB_XAW3DXFT */	/* CF_X_ATHENA(--with-Xaw3dxft) */
       /* #undef HAVE_LIB_XAWPLUS */		/* CF_X_ATHENA(--with-XawPlus) */
       #define HAVE_LIB_XCURSOR 1	/* AC_CHECK_LIB(Xcursor) */
       #define HAVE_MKDTEMP 1		/* AC_CHECK_FUNCS(mkdtemp) */
      -/* #undef HAVE_NCURSES_CURSES_H	/* AC_CHECK_HEADERS(ncurses/curses.h) */
      +/* #undef HAVE_NCURSES_CURSES_H	*/	/* AC_CHECK_HEADERS(ncurses/curses.h) */
       /* #undef HAVE_NCURSES_TERM_H */	/* AC_CHECK_HEADERS(ncurses/term.h) */
       #define HAVE_PATHS_H 1		/* CF_LASTLOG */
       /* #undef HAVE_PCREPOSIX_H */		/* CF_WITH_PCRE */
      +/* #undef HAVE_PCRE2POSIX_H */	/* CF_WITH_PCRE2 */
       /* #undef HAVE_POSIX_OPENPT */	/* CF_FUNC_GRANTPT */
       #define HAVE_POSIX_SAVED_IDS 1	/* CF_POSIX_SAVED_IDS */
       /* #undef HAVE_PTSNAME */		/* CF_FUNC_GRANTPT */
      @@ -133,6 +135,7 @@
       #define LUIT_PATH "/usr/X11R6/bin/luit"		/* CF_ARG_ENABLE(luit) */
       /* #undef NO_ACTIVE_ICON */		/* CF_ARG_DISABLE(active-icon) */
       /* #undef NO_LEAKS */			/* CF_ARG_DISABLE(leaks) */
      +#define OPT_DIRECT_COLOR 1		/* CF_ARG_ENABLE(direct-color) */
       #define OPT_256_COLORS 1		/* CF_ARG_ENABLE(256-color) */
       /* #undef OPT_88_COLORS */		/* CF_ARG_ENABLE(88-color) */
       /* #undef OPT_AIX_COLORS */		/* CF_ARG_DISABLE(16-color) */
      @@ -169,12 +172,12 @@
       /* #undef OPT_READLINE */		/* CF_ARG_ENABLE(readline-mouse) */
       /* #undef OPT_SAME_NAME */		/* CF_ARG_DISABLE(samename) */
       /* #undef OPT_SCO_FUNC_KEYS */	/* CF_ARG_ENABLE(sco-fkeys) */
      -/* #undef OPT_SELECTION_OPS	/* CF_ARG_DISABLE(selection-ops) */
      +/* #undef OPT_SELECTION_OPS */	/* CF_ARG_DISABLE(selection-ops) */
       #define OPT_SELECT_REGEX 1		/* CF_ARG_DISABLE(regex) */
       /* #undef OPT_SESSION_MGT */		/* CF_ARG_DISABLE(session-mgt) */
      -/* #undef OPT_REGIS_GRAPHICS	/* CF_ARG_ENABLE(regis-graphics) */
      -/* #undef OPT_SIXEL_GRAPHICS	/* CF_ARG_ENABLE(sixel-graphics) */
      -/* #undef OPT_GRAPHICS		/* CF_ARG_ENABLE(graphics) */
      +/* #undef OPT_REGIS_GRAPHICS */	/* CF_ARG_ENABLE(regis-graphics) */
      +/* #undef OPT_SIXEL_GRAPHICS */	/* CF_ARG_ENABLE(sixel-graphics) */
      +/* #undef OPT_GRAPHICS */		/* CF_ARG_ENABLE(graphics) */
       /* #undef OPT_SUN_FUNC_KEYS */	/* CF_ARG_ENABLE(sun-fkeys) */
       /* #undef OPT_TCAP_FKEYS */		/* CF_ARG_ENABLE(tcap-fkeys) */
       /* #undef OPT_TCAP_QUERY */		/* CF_ARG_ENABLE(tcap-query) */
      @@ -187,7 +190,7 @@
       /* #undef OPT_XMC_GLITCH */		/* CF_ARG_ENABLE(xmc-glitch) */
       /* #undef OPT_ZICONBEEP */		/* CF_ARG_DISABLE(ziconbeep) */
       /* #undef OWN_TERMINFO_DIR */		/* AC_ARG_WITH(own-terminfo) */
      -/* +#undef OWN_TERMINFO_ENV		/* AC_ARG_ENABLE(env-terminfo) */
      +/* #undef OWN_TERMINFO_ENV */		/* AC_ARG_ENABLE(env-terminfo) */
       /* #undef PROCFS_ROOT */		/* CF_ARG_ENABLE(exec-xterm) */
       #define SCROLLBAR_RIGHT 1		/* CF_ARG_ENABLE(rightbar) */
       #define SIG_ATOMIC_T volatile sig_atomic_t		/* CF_SIG_ATOMIC_T */
      @@ -207,7 +210,7 @@
       #define USE_UTMP_SETGID 1		/* AC_ARG_WITH(utmp-setgid) */
       /* #undef UTMPX_FOR_UTMP */		/* CF_UTMP */
       #define XRENDERFONT 1		/* CF_X_FREETYPE */
      -/* #undef cc_t                    /* CF_TYPE_CC_T */
      +/* #undef cc_t */		/* CF_TYPE_CC_T */
       /* #undef gid_t */			/* AC_TYPE_UID_T */
       /* #undef mode_t */			/* AC_TYPE_MODE_T */
       /* #undef off_t */			/* AC_TYPE_OFF_T */
      diff --git a/app/xterm/xtermcfg.hin b/app/xterm/xtermcfg.hin
      index 37b133871..ba35482b4 100644
      --- a/app/xterm/xtermcfg.hin
      +++ b/app/xterm/xtermcfg.hin
      @@ -1,4 +1,4 @@
      -/* $XTermId: xtermcfg.hin,v 1.213 2017/05/04 00:49:33 tom Exp $ */
      +/* $XTermId: xtermcfg.hin,v 1.215 2017/11/08 02:27:49 tom Exp $ */
       
       /*
        * Copyright 1997-2016,2017 by Thomas E. Dickey
      @@ -77,6 +77,7 @@
       #undef HAVE_LIBXPM		/* CF_WITH_XPM */
       #undef HAVE_LIB_NEXTAW		/* CF_X_ATHENA(--with-neXtaw) */
       #undef HAVE_LIB_PCRE		/* CF_WITH_PCRE */
      +#undef HAVE_LIB_PCRE2		/* CF_WITH_PCRE2 */
       #undef HAVE_LIB_XAW		/* CF_X_ATHENA */
       #undef HAVE_LIB_XAW3D		/* CF_X_ATHENA(--with-Xaw3d) */
       #undef HAVE_LIB_XAW3DXFT	/* CF_X_ATHENA(--with-Xaw3dxft) */
      @@ -87,6 +88,7 @@
       #undef HAVE_NCURSES_TERM_H	/* AC_CHECK_HEADERS(ncurses/term.h) */
       #undef HAVE_PATHS_H		/* CF_LASTLOG */
       #undef HAVE_PCREPOSIX_H		/* CF_WITH_PCRE */
      +#undef HAVE_PCRE2POSIX_H	/* CF_WITH_PCRE2 */
       #undef HAVE_POSIX_OPENPT	/* CF_FUNC_GRANTPT */
       #undef HAVE_POSIX_SAVED_IDS	/* CF_POSIX_SAVED_IDS */
       #undef HAVE_PTSNAME		/* CF_FUNC_GRANTPT */
      @@ -133,6 +135,7 @@
       #undef LUIT_PATH		/* CF_ARG_ENABLE(luit) */
       #undef NO_ACTIVE_ICON		/* CF_ARG_DISABLE(active-icon) */
       #undef NO_LEAKS			/* CF_ARG_DISABLE(leaks) */
      +#undef OPT_DIRECT_COLOR		/* CF_ARG_ENABLE(direct-color) */
       #undef OPT_256_COLORS		/* CF_ARG_ENABLE(256-color) */
       #undef OPT_88_COLORS		/* CF_ARG_ENABLE(88-color) */
       #undef OPT_AIX_COLORS		/* CF_ARG_DISABLE(16-color) */