# ------------------------------------------------------------------------------
# charproc.c | 72 +++++++++++++++++++++++++++++++++++++------------------
# ctlseqs.ms | 2 +
# cursor.c | 22 +++++++++++++---
# fontutils.c | 26 +++++++++++--------
# misc.c | 28 +++++++++++++++++++++
# ptydata.c | 2 -
# trace.c | 4 +--
# version.h | 4 +--
# xterm.h | 1
# xterm.log.html | 25 +++++++++++++++++++
# xterm.man | 9 ++++++
# 11 files changed, 152 insertions, 43 deletions
# ------------------------------------------------------------------------------
Index: charproc.c
--- xterm-109+/charproc.c Sun Jun 27 18:23:43 1999
+++ xterm-110/charproc.c Mon Jun 28 05:35:32 1999
@@ -368,7 +368,17 @@
/* Defaults */
#if OPT_ISO_COLORS
static Boolean defaultCOLORMODE = DFT_COLORMODE;
+
+/*
+ * If we default to colorMode enabled, compile-in defaults for the ANSI colors.
+ */
+#if DFT_COLORMODE
+#define DFT_COLOR(name) name
+#else
+#define DFT_COLOR(name) "XtDefaultForeground"
#endif
+#endif
+
static Boolean defaultFALSE = FALSE;
static Boolean defaultTRUE = TRUE;
static int defaultZERO = 0;
@@ -789,61 +799,61 @@
#if OPT_ISO_COLORS
{XtNcolor0, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_0]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("black")},
{XtNcolor1, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_1]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("red3")},
{XtNcolor2, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_2]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("green3")},
{XtNcolor3, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_3]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("yellow3")},
{XtNcolor4, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_4]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("blue3")},
{XtNcolor5, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_5]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("magenta3")},
{XtNcolor6, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_6]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("cyan3")},
{XtNcolor7, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_7]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("gray90")},
{XtNcolor8, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_8]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("gray30")},
{XtNcolor9, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_9]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("red")},
{XtNcolor10, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_10]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("green")},
{XtNcolor11, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_11]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("yellow")},
{XtNcolor12, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_12]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("blue")},
{XtNcolor13, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_13]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("magenta")},
{XtNcolor14, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_14]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("cyan")},
{XtNcolor15, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_15]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("white")},
{XtNcolorBD, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_BD]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("XtDefaultForeground")},
{XtNcolorBL, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_BL]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("XtDefaultForeground")},
{XtNcolorUL, XtCForeground, XtRPixel, sizeof(Pixel),
XtOffsetOf(XtermWidgetRec, screen.Acolors[COLOR_UL]),
- XtRString, "XtDefaultForeground"},
+ XtRString, DFT_COLOR("XtDefaultForeground")},
{XtNcolorMode, XtCColorMode, XtRBoolean, sizeof(Boolean),
XtOffsetOf(XtermWidgetRec, screen.colorMode),
XtRBoolean, (XtPointer) &defaultCOLORMODE},
@@ -1170,9 +1180,17 @@
laststate = nextstate;
#if OPT_WIDE_CHARS
if (c > 255) {
- nextstate = (parsestate == groundtable)
- ? CASE_PRINT
- : CASE_GROUND_STATE;
+ if (parsestate == groundtable) {
+ nextstate = CASE_PRINT;
+ } else if (parsestate == sos_table) {
+ c &= 0xffff;
+ if (c > 255) {
+ TRACE(("Found code > 255 while in SOS state: %04X\n", c))
+ c = '?';
+ }
+ } else {
+ nextstate = CASE_GROUND_STATE;
+ }
} else
#endif
nextstate = parsestate[c];
@@ -3973,6 +3991,11 @@
wnew->dft_foreground = MyBlackPixel(wnew->screen.display);
wnew->dft_background = MyWhitePixel(wnew->screen.display);
}
+ TRACE(("Color resource initialization:\n"))
+ TRACE((" Default foreground %#lx\n", wnew->dft_foreground))
+ TRACE((" Default background %#lx\n", wnew->dft_background))
+ TRACE((" Screen foreground %#lx\n", request->screen.foreground))
+ TRACE((" Screen background %#lx\n", request->core.background_pixel))
wnew->screen.mouse_button = -1;
wnew->screen.mouse_row = -1;
@@ -4097,6 +4120,7 @@
wnew->screen.colorULMode = request->screen.colorULMode;
for (i = 0, color_ok = False; i < MAXCOLORS; i++) {
+ TRACE(("Acolors[%d] = %#lx\n", i, request->screen.Acolors[i]))
wnew->screen.Acolors[i] = request->screen.Acolors[i];
if (wnew->screen.Acolors[i] != wnew->dft_foreground
&& wnew->screen.Acolors[i] != request->screen.foreground
@@ -4109,8 +4133,10 @@
* resource says. (There doesn't seem to be any good way to determine if
* the resource lookup failed versus the user having misconfigured this).
*/
- if (!color_ok)
+ if (!color_ok) {
wnew->screen.colorMode = False;
+ TRACE(("All colors are foreground or background: disable colorMode\n"))
+ }
wnew->num_ptrs = (OFF_COLOR+1);
wnew->sgr_foreground = -1;
Index: ctlseqs.ms
--- xterm-109+/ctlseqs.ms Sun Jun 13 17:55:49 1999
+++ xterm-110/ctlseqs.ms Thu Jun 24 19:22:34 1999
@@ -953,6 +953,8 @@
\*(Ps = \*0 \(-> Change Icon Name and Window Title to \*(Pt
\*(Ps = \*1 \(-> Change Icon Name to \*(Pt
\*(Ps = \*2 \(-> Change Window Title to \*(Pt
+ \*(Ps = \*3 \(-> Set X property on top-level window. \*(Pt should be in the form
+"\fIprop=value\fP", or just "\fIprop\fP" to delete the property
\*(Ps = \*1\*0 \(-> Change color names starting with text foreground to \*(Pt
(a list of one or more color names or RGB specifications, separated by
semicolon, up to eight, as per \fIXParseColor\fP).
Index: cursor.c
--- xterm-109+/cursor.c Sun Dec 20 22:50:38 1998
+++ xterm-110/cursor.c Tue Jun 29 20:00:08 1999
@@ -31,14 +31,28 @@
#include <xterm.h>
#include <data.h>
+/*
+ * Clear the selection if the cursor moves "before" the current position.
+ * Moving "after" is ok.
+ *
+ * That sounds fine - if the cursor really had anything direct relationship to
+ * the selection. For instance, if the cursor moved due to command line
+ * editing, it would be nice to deselect. However, what that means in practice
+ * is that a fullscreen program which scrolls back a line will (because it must
+ * temporarily reposition the cursor) clear the selection.
+ *
+ * However, it has an indirect relationship to the selection - we want to
+ * prevent the application from changing the screen contents under the
+ * highlighted region.
+ */
static void _CheckSelection (register TScreen *screen)
{
- if (screen->cur_row > screen->endHRow ||
+ if ((screen->cur_row < screen->endHRow) ||
(screen->cur_row == screen->endHRow &&
- screen->cur_col >= screen->endHCol))
- ;
- else
+ screen->cur_col < screen->endHCol))
+ {
DisownSelection(term);
+ }
}
Index: fontutils.c
--- xterm-109+/fontutils.c Wed Jun 23 07:08:34 1999
+++ xterm-110/fontutils.c Tue Jun 29 19:03:44 1999
@@ -316,20 +316,24 @@
/*
* Case-independent comparison for font-names, including wildcards.
*/
-static int
-same_font_name(char *name1, char *name2)
+static Boolean
+same_font_name(char *pattern, char *match)
{
- while (*name1 && *name2) {
- if (*name1 == '*') {
- return same_font_name(name1+1, name2+1)
- || same_font_name(name1, name2+1);
- } else if (*name2 == '*') {
- return same_font_name(name2, name1);
- } else if (char2lower(*name1++) != char2lower(*name2++)) {
- return 0;
+ while (*pattern && *match) {
+ if (*pattern == '*') {
+ if (same_font_name(pattern+1, match)) {
+ return True;
+ } else if (same_font_name(pattern, match+1)) {
+ return True;
+ } else {
+ return False;
+ }
+ } else {
+ if (char2lower(*pattern++) != char2lower(*match++))
+ return False;
}
}
- return (*name1 == *name2); /* both should be NUL */
+ return (*pattern == *match); /* both should be NUL */
}
/*
Index: misc.c
--- xterm-109+/misc.c Sun May 16 15:55:44 1999
+++ xterm-110/misc.c Thu Jun 24 19:26:26 1999
@@ -1010,6 +1010,10 @@
Changetitle(buf);
break;
+ case 3: /* change X property */
+ ChangeXprop(buf);
+ break;
+
case 10: case 11: case 12:
case 13: case 14: case 15:
case 16: case 17:
@@ -1316,6 +1320,30 @@
Changetitle(register char *name)
{
ChangeGroup( XtNtitle, (XtArgVal)name );
+}
+
+void
+ChangeXprop(register char *buf)
+{
+ Display *dpy = XtDisplay(toplevel);
+ Window w = XtWindow(toplevel);
+ XTextProperty text_prop;
+ Atom aprop;
+ char *pchEndPropName = strchr(buf,'=');
+
+ if (pchEndPropName)
+ *pchEndPropName = '\0';
+ aprop = XInternAtom(dpy, buf, False);
+ if (pchEndPropName == NULL) {
+ /* no "=value" given, so delete the property */
+ XDeleteProperty(dpy, w, aprop);
+ } else {
+ text_prop.value = pchEndPropName+1;
+ text_prop.encoding = XA_STRING;
+ text_prop.format = 8;
+ text_prop.nitems = strlen(text_prop.value);
+ XSetTextProperty(dpy,w,&text_prop,aprop);
+ }
}
/***====================================================================***/
Index: ptydata.c
--- xterm-109+/ptydata.c Sun Jun 27 18:23:43 1999
+++ xterm-110/ptydata.c Mon Jun 28 05:35:32 1999
@@ -51,7 +51,7 @@
#endif
#endif
-#define UTF8_FLAG 0x10000000
+#define UTF8_FLAG 0x80000000U
#define UTF8_CODE(code) ((code) | (screen->utf8_controls ? 0 : UTF8_FLAG))
int getPtyData(TScreen *screen, fd_set *select_mask, PtyData *data)
Index: trace.c
--- xterm-109+/trace.c Mon May 3 16:47:48 1999
+++ xterm-110/trace.c Thu Jun 24 19:57:56 1999
@@ -108,7 +108,7 @@
value |= (*buf2 << 8);
buf2++;
}
- if (value > 127)
+ if (value > 255)
sprintf(dst, "\\u+%04X", value);
else
#endif
@@ -137,7 +137,7 @@
while (len--) {
unsigned value = *buf++;
#if OPT_WIDE_CHARS
- if (value > 127)
+ if (value > 255)
sprintf(dst, "\\u+%04X", value);
else
#endif
Index: version.h
--- xterm-109+/version.h Sun Jun 27 18:23:43 1999
+++ xterm-110/version.h Tue Jun 29 19:09:49 1999
@@ -6,5 +6,5 @@
* XFree86 to which this version of xterm has been built. The number in
* parentheses is my patch number (T.Dickey).
*/
-#define XTERM_PATCH 109
-#define XFREE86_VERSION "XFree86 3.9Pt"
+#define XTERM_PATCH 110
+#define XFREE86_VERSION "XFree86 3.9Pu"
Index: xterm.h
--- xterm-109+/xterm.h Sun Jun 13 17:55:49 1999
+++ xterm-110/xterm.h Thu Jun 24 19:27:54 1999
@@ -269,6 +269,7 @@
extern int xerror (Display *d, XErrorEvent *ev);
extern int xioerror (Display *dpy);
extern void Bell (int which, int percent);
+extern void ChangeXprop (char *name);
extern void Changename (char *name);
extern void Changetitle (char *name);
extern void Cleanup (int code);
Index: xterm.log.html
--- xterm-109+/xterm.log.html Sun Jun 27 18:23:43 1999
+++ xterm-110/xterm.log.html Tue Jun 29 20:40:00 1999
@@ -41,6 +41,7 @@
xc/programs/Xserver/hw/xfree86).
<UL>
+<LI><A HREF="#xterm_110">Patch #110 - 1999/6/29 - XFree86 3.9Pu</A>
<LI><A HREF="#xterm_109">Patch #109 - 1999/6/23 - XFree86 3.9Pt</A>
<LI><A HREF="#xterm_108">Patch #108 - 1999/6/19 - XFree86 3.9Ps</A>
<LI><A HREF="#xterm_107">Patch #107 - 1999/6/12 - XFree86 3.9Pq</A>
@@ -152,6 +153,30 @@
<LI><A HREF="#xterm_02">Patch #2 - 1996/1/7</A>
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL>
+
+<H1><A NAME="xterm_110">Patch #110 - 1999/6/29 - XFree86 3.9Pu</A></H1>
+<ul>
+ <li>If colorMode is enabled by default, compile-in default resources to
+ match the colors listed in XTerm-col.ad (this should fix a
+ longstanding FAQ).
+
+ <li>added new OSC 3 ; PROPNAME=VALUE ST escape
+ sequence to set an arbitrary X property on the top level xterm X11
+ window. Omit "=VALUE" to delete the X property (patch by Greg Badros
+ <gjb@cs.washington.edu>).
+
+ <li>change internal flag used for <em>utf8controls</em> resource
+ so we allow 31-bit range of characters (suggested by Thomas Wolff).
+
+ <li>add check for 16-bit characters in OSC strings, change them to '?'
+ (reported by Thomas Wolff).
+
+ <li>modify logic of same_font_name() to avoid trying to interpret both
+ parameters as wildcard patterns. That does not (cannot) work, and in
+ some instances the font server will return unresolved wildcards for
+ the normal or bold fontnames, making them match inadvertently,
+ triggering the fallback overstrike logic (reported by Tim Adye).
+</ul>
<H1><A NAME="xterm_109">Patch #109 - 1999/6/23 - XFree86 3.9Pt</A></H1>
<ul>
Index: xterm.man
--- xterm-109+/xterm.man Sun Jun 27 18:23:43 1999
+++ xterm-110/xterm.man Mon Jun 28 05:35:32 1999
@@ -1087,6 +1087,15 @@
If ``true'', \fIxterm\fP highlights only the positions that contain text that
can be selected.
The default is ``false.''
+.PP
+Depending on the way your applications write to the screen, there may
+be trailing blanks on a line.
+\fIXterm\fP stores data as it is shown on the screen.
+Erasing the display changes the internal state of each cell
+so it is not considered a blank for the purpose of selection.
+Blanks written since the last erase are selectable.
+If you do not wish to have trailing blanks in a selection,
+use the \fBtrimSelection\fP resource.
.TP 8
.B "hpLowerleftBugCompat (\fPclass\fB HpLowerleftBugCompat)"
Specifies whether to work around a bug in HP's \fIxdb\fP,