Skip to content
Commits on Source (6)
XCOMM $XTermId: Imakefile,v 1.121 2018/08/12 17:23:20 tom Exp $
XCOMM $XTermId: Imakefile,v 1.123 2019/11/02 21:50:51 tom Exp $
XCOMM
XCOMM Attention xterm porters
XCOMM
......@@ -166,9 +166,6 @@ TERMCAPDEFINES=-DUSE_TERMINFO -DHAVE_TIGETSTR -DHAVE_TERM_H
#if !HasPutenv
PUTENVDEF = -DNOPUTENV
#endif
#ifdef DumpsXTerm
DUMPSDEF = -DOPT_SCREEN_DUMPS=1
#endif
#ifdef RegisXTerm
SIXELDEF = -DOPT_REGIS_GRAPHICS=1
#endif
......@@ -184,15 +181,13 @@ TERMCAPDEFINES=-DUSE_TERMINFO -DHAVE_TIGETSTR -DHAVE_TERM_H
MISC_DEFINES = /* -DALLOWLOGGING -DALLOWLOGFILEEXEC */
XKB_DEFINES = XkbClientDefines
PATH_DEFINES = -DPROJECTROOT=$(PROJECTROOT)
DEFINES = $(XKB_DEFINES) $(TERMCAPDEFINES) $(FEATURE_DEFINES) $(SCROLLBAR_RIGHT) $(UTF8_OPTION) $(XRFDEF) $(PATH_DEFINES) $(PUTENVDEF) $(IMAKEDEFINES) $(SIXELDEF) $(TRACEDEF) $(DUMPSDEF)
DEFINES = $(XKB_DEFINES) $(TERMCAPDEFINES) $(FEATURE_DEFINES) $(SCROLLBAR_RIGHT) $(UTF8_OPTION) $(XRFDEF) $(PATH_DEFINES) $(PUTENVDEF) $(IMAKEDEFINES) $(SIXELDEF) $(TRACEDEF)
INCLUDES = -I. $(XRFINCLUDES)
MAINSRC = main.c
MAINOBJ = main.o
#ifdef DumpsXTerm
DUMPSSRC = html.c svg.c
DUMPSOBJ = html.o svg.o
#endif
#ifdef RegisXTerm
SIXELSRC = graphics_regis.c
SIXELOBJ = graphics_regis.o
......
MANIFEST for xterm-349, version xterm-349
MANIFEST for xterm-350, version xterm-350
--------------------------------------------------------------------------------
MANIFEST this file
256colres.h resource-definitions for 256-color mode
......
The NEWS file was generated from xterm.log.html, which serves as the changelog
for xterm.
--------------------------------------------------------------------------------
Patch #349 - 2019/09/22
Patch #350 - 2019/11/02
* add graphic context to support bold+italics (patch by Quinn
Strahl).
* document window properties in the manual page.
* improve title-string feature:
+ if any of allowC1Printable, utf8Title or titleModes hint that
an application might send a title-string encoded in UTF-8,
check if that is the case, and if it is recodable into
ISO-8859-1, use that for the ICCCM-style title.
+ check if the title given by a control sequence happens to be
already encoded in UTF-8, to avoid double-encoding (FreeBSD
#240393).
+ Make sameName resource work for the EWMH titles.
+ Modify menu-state of utf8Title to be consistent with the utf8
source, i.e., setting the EWMH properties automatically when
UTF-8 is active.
* reorganize text-drawing to make it possible to investigate using
Xft to implement VT100-style double-sized characters. While doing
this, made a workaround for apparent Xft bug which loses its
drawable state when switching from 132 to 80 columns.
* improve font-warning messages by showing which are derived rather
than directly from resource settings (suggested by Tomas Korbar).
Also filter repeated font-warning messages, to accommodate broken X
configurations.
* fix an inconsistency between failure to load derived wide font
versus failure to load derived wide-bold font (Redhat #1679790).
That relies upon the “:unscaled” property which is broken in some
distributions (however, recent Debian and the BSDs such as MacOS
work).
* updated autoconf-252 to check X11R7 include/lib directories found
on some older configurations.
* set a graphic-context for border when double-buffering is active;
to prevent the border color from changing when switching to
reverse-video.
* build-fix for --disable-ziconbeep, which conflicted with the new
double-buffer configuration (report by Brian Lindholm).
* fix loop-limit for lookup of fullscreen resource broken in xterm
#347 (report by Scott Bertilson).
* modify html/svg dump to not ignore zero'd/blank cells.
* align terminfo file with ncurses, e.g., add xterm+osc104 block.
* improve discussion of modifyOtherKeys in manual page and in
ctlseqs.ms.
* add vttests/modify-keys.pl script to illustrate the modifyOtherKeys
resource (prompted by discussion with Bram Moolenaar).
* various improvements to ctlseqs.ms, as part of autogenerating links
for the website.
* update manual page default for saveLines resource default value
(Branden Robinson, Debian #913815).
* add command-line option -report-xres to show the values of the
VT100 widget X resources when initialization is complete.
* add a control sequence which, like tcap-query, allows an
application to inspect most X resource settings of the VT100
widget.
* adjust some optional features to enable them in the imake
configuration as they would be by default via the configure script.
* add null-pointer checks to improve error recovery when bitmap fonts
are missing or corrupt (report by Jonne Ransijn).
* correct the condition for deleting the EWMH window-title property,
i.e., if UTF-8 titles are disabled, rather than if an update to the
EWHM property found no change (report by Sven Joachim).
* build-fix for the case when configure --enable-trace is used
without --enable-warnings (report by Sven Joachim).
* fix a few minor bugs found with Coverity.
* add a check in property_to_string to avoid translating UTF8_STRING
or COMPOUND_TEXT into Latin-1 when UTF-8 encoding is active, e.g.,
when pushing onto the title-stack while switching to the alternate
screen.
* build-fix for the --disable-doublechars configure option (report by
Brian Lindholm).
/* $XTermId: charproc.c,v 1.1708 2019/09/20 23:04:00 tom Exp $ */
/* $XTermId: charproc.c,v 1.1720 2019/10/07 00:26:56 tom Exp $ */
/*
* Copyright 1999-2018,2019 by Thomas E. Dickey
......@@ -7129,7 +7129,10 @@ property_to_string(XtermWidget xw, XTextProperty * text)
*/
if ((text->format != 8)
|| IsTitleMode(xw, tmGetUtf8)
|| (rc = xtermUtf8ToTextList(xw, text, &list, &length)) < 0)
|| (text->encoding == XA_UTF8_STRING(dpy) &&
!(screen->wide_chars || screen->c1_printable) &&
(rc = xtermUtf8ToTextList(xw, text, &list, &length)) < 0)
|| (rc = -1) > 0)
#endif
if ((rc = XmbTextPropertyToTextList(dpy, text, &list, &length)) < 0)
rc = XTextPropertyToStringList(text, &list, &length);
......@@ -8538,6 +8541,109 @@ set_flags_from_list(char *target,
? CURSOR_UNDERLINE \
: CURSOR_BLOCK
#if OPT_XRES_QUERY
static XtResource *
findVT100Resource(const char *name)
{
Cardinal n;
XtResource *result = 0;
if (!IsEmpty(name)) {
XrmQuark quarkName = XrmPermStringToQuark(name);
for (n = 0; n < XtNumber(xterm_resources); ++n) {
if ((int) xterm_resources[n].resource_offset >= 0
&& !strcmp(xterm_resources[n].resource_name, name)) {
result = &xterm_resources[n];
break;
} else if (xterm_resources[n].resource_name
== (String) (intptr_t) quarkName) {
result = &xterm_resources[n];
break;
}
}
}
return result;
}
static int
cmp_resources(const void *a, const void *b)
{
return strcmp((*(const String *) a),
(*(const String *) b));
}
static void
reportResources(XtermWidget xw)
{
String *list = TypeMallocN(String, XtNumber(xterm_resources));
Cardinal n;
int widest = 0;
for (n = 0; n < XtNumber(xterm_resources); ++n) {
int width;
list[n] = (((int) xterm_resources[n].resource_offset < 0)
? XrmQuarkToString((XrmQuark) (intptr_t)
xterm_resources[n].resource_name)
: xterm_resources[n].resource_name);
width = (int) strlen(list[n]);
if (widest < width)
widest = width;
}
qsort(list, XtNumber(xterm_resources), sizeof(String), cmp_resources);
for (n = 0; n < XtNumber(xterm_resources); ++n) {
char *value = vt100ResourceToString(xw, list[n]);
printf("%-*s : %s\n", widest, list[n], value ? value : "(skip)");
}
free(list);
}
char *
vt100ResourceToString(XtermWidget xw, const char *name)
{
XtResource *data;
char *result = NULL;
if ((data = findVT100Resource(name)) != 0) {
int fake_offset = (int) data->resource_offset;
void *res_addr;
int real_offset;
String res_type;
/*
* X Toolkit "compiles" the resource-list into quarks and changes the
* resource-offset at the same time to a negative value.
*/
if (fake_offset < 0) {
real_offset = -(fake_offset + 1);
res_type = XrmQuarkToString((XrmQuark) (intptr_t) data->resource_type);
} else {
real_offset = fake_offset;
res_type = data->resource_type;
}
res_addr = (void *) ((char *) xw + real_offset);
if (!strcmp(res_type, XtRString)) {
char *value = *(char **) res_addr;
if (value != NULL) {
size_t need = strlen(value);
if ((result = malloc(1 + need)) != 0)
strcpy(result, value);
}
} else if (!strcmp(res_type, XtRInt)) {
if ((result = malloc(1 + (3 * data->resource_size))) != 0)
sprintf(result, "%d", *(int *) res_addr);
} else if (!strcmp(res_type, XtRFloat)) {
if ((result = malloc(1 + (3 * data->resource_size))) != 0)
sprintf(result, "%f", *(float *) res_addr);
} else if (!strcmp(res_type, XtRBoolean)) {
if ((result = malloc(6)) != 0)
strcpy(result, *(Boolean *) res_addr ? "true" : "false");
}
}
TRACE(("vt100ResourceToString(%s) %s\n", name, NonNull(result)));
return result;
}
#endif /* OPT_XRES_QUERY */
/* ARGSUSED */
static void
VTInitialize(Widget wrequest,
......@@ -9319,6 +9425,9 @@ VTInitialize(Widget wrequest,
screen->selectMap[i] = (SelectUnit) i;
else
break;
#if OPT_XRES_QUERY
init_Sres(screen.onClick[i]);
#endif
TRACE(("on%dClicks %s=%d\n", ck,
NonNull(TScreenOf(request)->onClick[i]),
screen->selectMap[i]));
......@@ -9403,10 +9512,15 @@ VTInitialize(Widget wrequest,
#if OPT_WIDE_CHARS
/* setup data for next call */
init_Sres(screen.utf8_mode_s);
request->screen.utf8_mode =
extendedBoolean(request->screen.utf8_mode_s, tblUtf8Mode, uLast);
init_Sres(screen.utf8_fonts_s);
request->screen.utf8_fonts =
extendedBoolean(request->screen.utf8_fonts_s, tblUtf8Mode, uLast);
init_Sres(screen.utf8_title_s);
request->screen.utf8_title =
extendedBoolean(request->screen.utf8_title_s, tblUtf8Mode, uLast);
......@@ -9765,6 +9879,10 @@ VTInitialize(Widget wrequest,
initLineData(wnew);
#if OPT_WIDE_CHARS
freeFontList(&(request->work.fonts.x11.list_n));
#endif
#if OPT_XRES_QUERY
if (resource.reportXRes)
reportResources(wnew);
#endif
return;
}
......
This diff is collapsed.
dnl $XTermId: configure.in,v 1.363 2019/07/21 19:41:39 tom Exp $
dnl $XTermId: configure.in,v 1.366 2019/11/02 20:49:15 tom Exp $
dnl
dnl -----------------------------------------------------------------------------
dnl this file is part of xterm
......@@ -1014,9 +1014,10 @@ CF_ARG_DISABLE(screen-dumps,
[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])
EXTRASRCS="$EXTRASRCS html.c svg.c"
EXTRAOBJS="$EXTRAOBJS html.o svg.o"
else
AC_DEFINE(OPT_SCREEN_DUMPS,0,[Define to 0 to disable XHTML and SVG screen dump support])
fi
AC_MSG_CHECKING(if you want ReGIS graphics support)
......
This diff is collapsed.
This diff is collapsed.
/* $XTermId: data.h,v 1.137 2019/07/19 00:40:42 tom Exp $ */
/* $XTermId: data.h,v 1.138 2019/10/06 20:16:02 tom Exp $ */
/*
* Copyright 2002-2018,2019 by Thomas E. Dickey
......@@ -220,6 +220,9 @@ typedef struct XTERM_RESOURCE {
#if OPT_REPORT_FONTS
Boolean reportFonts; /* show bitmap-font information as loaded */
#endif
#if OPT_XRES_QUERY
Boolean reportXRes; /* show vt100 resources after initialization */
#endif
#if OPT_REPORT_ICONS
Boolean reportIcons; /* show icon information as loaded */
#endif
......
xterm (350-1) UNRELEASED; urgency=medium
* New upstream release.
- Update manual page default for saveLines resource default value
(Branden Robinson, Closes: #913815).
* Drop cherry-picked patches.
* Refresh remaining patches.
-- Sven Joachim <svenjoac@gmx.de> Sun, 03 Nov 2019 18:03:21 +0100
xterm (349-1) unstable; urgency=medium
* New upstream release.
......
Description: Add a check in property_to_string
Add a check in property_to_string to avoid translating UTF8_STRING or
COMPOUND_TEXT into Latin-1 when UTF-8 encoding is active, e.g., when
pushing onto the title-stack while switching to the alternate screen.
---
charproc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/charproc.c
+++ b/charproc.c
@@ -1,4 +1,4 @@
-/* $XTermId: charproc.c,v 1.1708 2019/09/20 23:04:00 tom Exp $ */
+/* $XTermId: charproc.c,v 1.1709 2019/09/24 22:49:17 tom Exp $ */
/*
* Copyright 1999-2018,2019 by Thomas E. Dickey
@@ -7129,7 +7129,10 @@ property_to_string(XtermWidget xw, XText
*/
if ((text->format != 8)
|| IsTitleMode(xw, tmGetUtf8)
- || (rc = xtermUtf8ToTextList(xw, text, &list, &length)) < 0)
+ || (text->encoding == XA_UTF8_STRING(dpy) &&
+ !(screen->wide_chars || screen->c1_printable) &&
+ (rc = xtermUtf8ToTextList(xw, text, &list, &length)) < 0)
+ || (rc = -1))
#endif
if ((rc = XmbTextPropertyToTextList(dpy, text, &list, &length)) < 0)
rc = XTextPropertyToStringList(text, &list, &length);
Description: Correct the condition for deleting the EWMH window-title property
Correct the condition for deleting the EWMH window-title property,
i.e., if UTF-8 titles are disabled, rather than if an update to the
EWHM property found no change (report by Sven Joachim).
---
misc.c | 74 +++++++++++++++++++++++++++++++++--------------------------------
1 file changed, 38 insertions(+), 36 deletions(-)
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/* $XTermId: misc.c,v 1.904 2019/09/23 00:17:44 tom Exp $ */
+/* $XTermId: misc.c,v 1.905 2019/09/30 00:34:51 tom Exp $ */
/*
* Copyright 1999-2018,2019 by Thomas E. Dickey
@@ -5515,44 +5515,46 @@ ChangeGroup(XtermWidget xw, const char *
if (my_atom != None) {
changed = True;
+ if (IsSetUtf8Title(xw)) {
#if OPT_SAME_NAME
- if (resource.sameName && IsSetUtf8Title(xw)) {
- Atom actual_type;
- Atom requested_type = XA_UTF8_STRING(dpy);
- int actual_format = 0;
- long long_length = 1024;
- unsigned long nitems = 0;
- unsigned long bytes_after = 0;
- unsigned char *prop = 0;
-
- if (xtermGetWinProp(dpy,
- VShellWindow(xw),
- my_atom,
- 0L,
- long_length,
- requested_type,
- &actual_type,
- &actual_format,
- &nitems,
- &bytes_after,
- &prop)
- && actual_type == requested_type
- && actual_format == 8
- && prop != 0
- && nitems == strlen(value)
- && memcmp(value, prop, nitems) == 0) {
- changed = False;
+ if (resource.sameName) {
+ Atom actual_type;
+ Atom requested_type = XA_UTF8_STRING(dpy);
+ int actual_format = 0;
+ long long_length = 1024;
+ unsigned long nitems = 0;
+ unsigned long bytes_after = 0;
+ unsigned char *prop = 0;
+
+ if (xtermGetWinProp(dpy,
+ VShellWindow(xw),
+ my_atom,
+ 0L,
+ long_length,
+ requested_type,
+ &actual_type,
+ &actual_format,
+ &nitems,
+ &bytes_after,
+ &prop)
+ && actual_type == requested_type
+ && actual_format == 8
+ && prop != 0
+ && nitems == strlen(value)
+ && memcmp(value, prop, nitems) == 0) {
+ changed = False;
+ }
}
- }
#endif /* OPT_SAME_NAME */
- if (changed && IsSetUtf8Title(xw)) {
- ReportIcons(("...updating %s\n", propname));
- ReportIcons(("...value is %s\n", value));
- XChangeProperty(dpy, VShellWindow(xw), my_atom,
- XA_UTF8_STRING(dpy), 8,
- PropModeReplace,
- (Char *) value,
- (int) strlen(value));
+ if (changed) {
+ ReportIcons(("...updating %s\n", propname));
+ ReportIcons(("...value is %s\n", value));
+ XChangeProperty(dpy, VShellWindow(xw), my_atom,
+ XA_UTF8_STRING(dpy), 8,
+ PropModeReplace,
+ (Char *) value,
+ (int) strlen(value));
+ }
} else {
ReportIcons(("...deleting %s\n", propname));
XDeleteProperty(dpy, VShellWindow(xw), my_atom);
......@@ -51,7 +51,7 @@ Author: Sven Joachim <svenjoac@gmx.de>
--- a/terminfo
+++ b/terminfo
@@ -138,7 +138,7 @@ xterm-new|modern xterm terminal emulator
rin=\E[%p1%dT,
use=xterm+keypad,
use=vt420+lrmm,
use=xterm+sm+1006,
- use=ansi+rep,
......@@ -59,7 +59,7 @@ Author: Sven Joachim <svenjoac@gmx.de>
use=ecma+strikeout,
use=xterm+pcfkeys,
use=xterm+tmux,
@@ -2482,12 +2482,12 @@ xterm-r5|xterm R5 version,
@@ -2519,12 +2519,12 @@ xterm-r5|xterm R5 version,
# This is the only entry which you should have to customize, since "xterm"
# is widely used for a variety of incompatible terminal emulations including
# color_xterm and rxvt.
......
......@@ -11,7 +11,7 @@ Description: Change the disallowedWindowOps default
--- a/xterm.man
+++ b/xterm.man
@@ -3133,7 +3133,7 @@ This is a comma-separated list of names,
@@ -3153,7 +3153,7 @@ This is a comma-separated list of names,
from \fIdtterm\fP the operation number).
The default value is
.NS
......
......@@ -9,7 +9,7 @@ Description: Change allowFontOps default
--- a/xterm.man
+++ b/xterm.man
@@ -2161,7 +2161,7 @@ The default is \*(``true\*(''.
@@ -2181,7 +2181,7 @@ The default is \*(``true\*(''.
.TP
.B "allowFontOps\fP (class\fB AllowFontOps\fP)"
Specifies whether control sequences that set/query the font should be allowed.
......
900_debian_xterm.diff
902_windowops.diff
904_fontops.diff
349b.diff
349d.diff
/* $XTermId: fontutils.c,v 1.655 2019/09/20 23:23:25 tom Exp $ */
/* $XTermId: fontutils.c,v 1.656 2019/10/01 08:34:12 tom Exp $ */
/*
* Copyright 1998-2018,2019 by Thomas E. Dickey
......@@ -309,13 +309,18 @@ get_font_name_props(Display *dpy, XFontStruct *fs, char **result)
static FontNameProperties props;
static char *last_name;
Atom fontatom = XInternAtom(dpy, "FONT", False);
char *name = 0;
Atom fontatom;
char *name;
char *str;
if (fs == NULL)
return NULL;
/*
* first get the full font name
*/
name = 0;
fontatom = XInternAtom(dpy, "FONT", False);
if (fontatom != 0) {
XFontProp *fp;
int i;
......@@ -781,6 +786,15 @@ is_fixed_font(XFontStruct *fs)
return 1;
}
static int
differing_widths(XFontStruct *a, XFontStruct *b)
{
int result = 0;
if (a != NULL && b != NULL && a->max_bounds.width != b->max_bounds.width)
result = 1;
return result;
}
/*
* Check if the font looks like a double width font (i.e. contains
* characters of width X and 2X
......@@ -789,7 +803,7 @@ is_fixed_font(XFontStruct *fs)
static int
is_double_width_font(XFontStruct *fs)
{
return ((2 * fs->min_bounds.width) == fs->max_bounds.width);
return (fs != NULL && ((2 * fs->min_bounds.width) == fs->max_bounds.width));
}
#else
#define is_double_width_font(fs) 0
......@@ -1532,9 +1546,11 @@ xtermLoadFont(XtermWidget xw,
* Normal/bold fonts should be the same width. Also, the min/max
* values should be the same.
*/
if (!is_fixed_font(fnts[fNorm].fs)
if (fnts[fNorm].fs != 0
&& fnts[fBold].fs != 0
&& (!is_fixed_font(fnts[fNorm].fs)
|| !is_fixed_font(fnts[fBold].fs)
|| fnts[fNorm].fs->max_bounds.width != fnts[fBold].fs->max_bounds.width) {
|| differing_widths(fnts[fNorm].fs, fnts[fBold].fs))) {
TRACE(("Proportional font! normal %d/%d, bold %d/%d\n",
fnts[fNorm].fs->min_bounds.width,
fnts[fNorm].fs->max_bounds.width,
......@@ -1548,7 +1564,7 @@ xtermLoadFont(XtermWidget xw,
&& fnts[fWBold].fs != 0
&& (!is_fixed_font(fnts[fWide].fs)
|| !is_fixed_font(fnts[fWBold].fs)
|| fnts[fWide].fs->max_bounds.width != fnts[fWBold].fs->max_bounds.width)) {
|| differing_widths(fnts[fWide].fs, fnts[fWBold].fs))) {
TRACE(("Proportional font! wide %d/%d, wide bold %d/%d\n",
fnts[fWide].fs->min_bounds.width,
fnts[fWide].fs->max_bounds.width,
......@@ -3404,7 +3420,9 @@ xtermMissingChar(unsigned ch, XTermFonts * font)
XFontStruct *fs = font->fs;
XCharStruct *pc = 0;
if (fs->max_byte1 == 0) {
if (fs == NULL) {
result = True;
} else if (fs->max_byte1 == 0) {
#if OPT_WIDE_CHARS
if (ch < 256)
#endif
......
/* $XTermId: html.c,v 1.16 2019/06/11 09:19:29 tom Exp $ */
/* $XTermId: html.c,v 1.17 2019/11/02 15:03:43 tom Exp $ */
/*
* Copyright 2018,2019 Thomas E. Dickey
......@@ -249,7 +249,7 @@ dumpHtmlLine(XtermWidget xw, int row, FILE *fp)
#endif
switch (chr) {
case 0:
/* This sometimes happens when resizing... ignore. */
fputc(' ', fp);
break;
case '&':
fputs("&amp;", fp);
......
/* $XTermId: main.c,v 1.854 2019/07/23 20:43:58 tom Exp $ */
/* $XTermId: main.c,v 1.856 2019/11/02 23:56:58 tom Exp $ */
/*
* Copyright 2002-2018,2019 by Thomas E. Dickey
......@@ -939,6 +939,9 @@ static XtResource application_resources[] =
#if OPT_REPORT_ICONS
Bres("reportIcons", "ReportIcons", reportIcons, False),
#endif
#if OPT_XRES_QUERY
Bres("reportXRes", "ReportXRes", reportXRes, False),
#endif
#if OPT_SAME_NAME
Bres("sameName", "SameName", sameName, True),
#endif
......@@ -1094,6 +1097,9 @@ DATA("-report-icons", "*reportIcons", XrmoptionNoArg, "on"),
#if OPT_REPORT_FONTS
DATA("-report-fonts", "*reportFonts", XrmoptionNoArg, "on"),
#endif
#if OPT_XRES_QUERY
DATA("-report-xres", "*reportXRes", XrmoptionNoArg, "on"),
#endif
#ifdef SCROLLBAR_RIGHT
DATA("-leftbar", "*rightScrollBar", XrmoptionNoArg, "off"),
DATA("-rightbar", "*rightScrollBar", XrmoptionNoArg, "on"),
......@@ -1292,6 +1298,9 @@ static OptionHelp xtermOptions[] = {
#if OPT_REPORT_FONTS
{ "-report-fonts", "report fonts as loaded to stdout" },
#endif
#if OPT_XRES_QUERY
{ "-report-xres", "report X resources for VT100 widget" },
#endif
#ifdef SCROLLBAR_RIGHT
{ "-rightbar", "force scrollbar right (default left)" },
{ "-leftbar", "force scrollbar left" },
......
/* $XTermId: misc.c,v 1.904 2019/09/23 00:17:44 tom Exp $ */
/* $XTermId: misc.c,v 1.912 2019/10/06 20:01:39 tom Exp $ */
/*
* Copyright 1999-2018,2019 by Thomas E. Dickey
......@@ -4526,10 +4526,10 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen)
unparseputc(xw, ANSI_CAN);
}
break;
#if OPT_TCAP_QUERY
case '+':
cp++;
switch (*cp) {
#if OPT_TCAP_QUERY
case 'p':
if (AllowTcapOps(xw, etSetTcap)) {
set_termcap(xw, cp + 1);
......@@ -4612,9 +4612,63 @@ do_dcs(XtermWidget xw, Char *dcsbuf, size_t dcslen)
unparseputc1(xw, ANSI_ST);
}
break;
#endif
#if OPT_XRES_QUERY
case 'Q':
++cp;
if (AllowXResOps(xw)) {
Boolean first = True;
while (*cp != '\0') {
const char *parsed = 0;
const char *tmp;
char *name = x_decode_hex(cp, &parsed);
char *value;
char *result;
int code;
if (cp == parsed || name == NULL)
break; /* no data found, error */
TRACE(("query-feature '%s'\n", name));
if ((value = vt100ResourceToString(xw, name)) != 0) {
code = 0;
} else {
code = 1;
}
if (first) {
unparseputc1(xw, ANSI_DCS);
unparseputc(xw, code >= 0 ? '1' : '0');
unparseputc(xw, '+');
unparseputc(xw, 'R');
first = False;
}
for (tmp = cp; tmp != parsed; ++tmp)
unparseputc(xw, *tmp);
if (value != 0) {
unparseputc1(xw, '=');
result = x_encode_hex(value);
unparseputs(xw, result);
} else {
result = NULL;
}
free(name);
free(value);
free(result);
cp = parsed;
if (*parsed == ';') {
unparseputc(xw, *parsed++);
cp = parsed;
}
}
if (!first)
unparseputc1(xw, ANSI_ST);
}
break;
#endif
}
break;
#if OPT_DEC_RECTOPS
case '1':
/* FALLTHRU */
......@@ -5515,8 +5569,9 @@ ChangeGroup(XtermWidget xw, const char *attribute, char *value)
if (my_atom != None) {
changed = True;
if (IsSetUtf8Title(xw)) {
#if OPT_SAME_NAME
if (resource.sameName && IsSetUtf8Title(xw)) {
if (resource.sameName) {
Atom actual_type;
Atom requested_type = XA_UTF8_STRING(dpy);
int actual_format = 0;
......@@ -5545,7 +5600,7 @@ ChangeGroup(XtermWidget xw, const char *attribute, char *value)
}
}
#endif /* OPT_SAME_NAME */
if (changed && IsSetUtf8Title(xw)) {
if (changed) {
ReportIcons(("...updating %s\n", propname));
ReportIcons(("...value is %s\n", value));
XChangeProperty(dpy, VShellWindow(xw), my_atom,
......@@ -5553,6 +5608,7 @@ ChangeGroup(XtermWidget xw, const char *attribute, char *value)
PropModeReplace,
(Char *) value,
(int) strlen(value));
}
} else {
ReportIcons(("...deleting %s\n", propname));
XDeleteProperty(dpy, VShellWindow(xw), my_atom);
......