Skip to content

Commits on Source 5

-- $XTermId: INSTALL,v 1.176 2017/12/25 12:48:26 tom Exp $
-- $XTermId: INSTALL,v 1.179 2018/12/09 18:14:52 tom Exp $
-------------------------------------------------------------------------------
-- Copyright 1997-2016,2017 by Thomas E. Dickey
-- Copyright 1997-2017,2018 by Thomas E. Dickey
--
-- All Rights Reserved
--
......@@ -104,7 +104,7 @@ The options (in alphabetic order):
e.g., to make boxes. When xterm loads a font, it checks if those
characters are present, and draws its own if they are missing.
--disable-broken-st disallow broken string-terminators],
--disable-broken-st disallow broken string-terminators,
Do not compile-in code that works around a bug in some ISDN routers
(and possibly other applications written by the same people): they
......@@ -117,7 +117,7 @@ The options (in alphabetic order):
See also --enable-broken-osc
--disable-c1-print disallow -k8 option for printable 128-159],
--disable-c1-print disallow -k8 option for printable 128-159,
Use this option to suppress support for nonstandard use of codes
128-159, which normally are considered control characters. Some users
......@@ -262,9 +262,10 @@ The options (in alphabetic order):
--disable-paste64 disable support for bracketed paste mode
Do not compile-in code to support experimental bracketed paste mode,
i.e., provide functions for setting/getting the selection data.
along with functions for setting/getting the selection data, termed
"paste64".
(see ctlseqs.ms description of OSC 52).
(see ctlseqs.ms description of OSC 52, and DECSET 2004).
--disable-pty-handshake disable support for pty handshakes
......@@ -519,7 +520,8 @@ The options (in alphabetic order):
this puts xterm into a mode that sends special function-key strings to
bracket the data.
(See --enable-paste64, which fits xterm's protocol better).
(The "paste64" feature, which fits xterm's protocol better, is
configured by default).
--enable-sco-fkeys enable support for SCO-style function keys
......@@ -735,9 +737,9 @@ The options (in alphabetic order):
rule to point to the given directory.
If you have the $TERMINFO variable defined in your environment, the
configure script will use that value. If no option and no variable
are are given, the configure script uses /usr/lib/terminfo, if it
exists.
configure script may use that value, if it matches an existing
directory. If no option and no variable are are given, the configure
script uses /usr/lib/terminfo, if it exists.
You do not have to run "make install-ti", if there is already a
workable terminfo description. Be advised, however, that the
......
MANIFEST for xterm-337, version xterm-337
MANIFEST for xterm-338, version xterm-338
--------------------------------------------------------------------------------
MANIFEST this file
256colres.h resource-definitions for 256-color mode
......@@ -200,6 +200,7 @@ vttests/dynamic.pl demo for dynamic colors
vttests/dynamic.sh script to illustrate the dynamic colors control sequence
vttests/dynamic2.sh complete example of dynamic colors
vttests/fonts.sh script to demonstrate font-switching sequences
vttests/mouse-codes demo script for mouse-codes
vttests/other-sgr.sh demonstrate non-VTxx SGRs
vttests/paste64.pl script to test base64-selection option
vttests/print-vt-chars.pl demo-script
......
## $XTermId: Makefile.in,v 1.243 2018/05/03 00:30:44 tom Exp $
## $XTermId: Makefile.in,v 1.244 2018/11/22 14:36:02 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
......@@ -103,6 +103,13 @@ EXTRAHDR = @EXTRAHDRS@
EXTRASRC = @EXTRASRCS@
EXTRAOBJ = @EXTRAOBJS@
AUTO_SOURCE = \
builtin_icons.h \
VTparse.cin \
Tekparse.cin \
VTparse.hin \
Tekparse.hin
SRCS1 = button.c cachedGCs.c charproc.c charsets.c cursor.c \
data.c doublechr.c fontutils.c input.c \
linedata.c main.c menu.c misc.c \
......@@ -136,10 +143,12 @@ all : $(PROGRAMS)
@ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@
.def.cin :
$(AWK) '/^CASE_/{printf "{ %d, \"%s\" },\n", n++, $$1; }' < $< >$@
@echo "making $@ from $<"
@$(AWK) 'BEGIN{printf "/* vile:cmode */\n";}/^CASE_/{printf "{ %d, \"%s\" },\n", n++, $$1; }' < $< >$@
.def.hin :
$(AWK) '/^CASE_/{printf "#define %s %d\n", $$1, n++}' < $< >$@
@echo "making $@ from $<"
@$(AWK) 'BEGIN{printf "/* vile:cmode */\n";}/^CASE_/{printf "#define %s %d\n", $$1, n++}' < $< >$@
.man.$(manext) :
$(SHELL) ./minstall "$(INSTALL_DATA)" $< $@ $(appsdir) $(CLASS) $* $* $(pixmapdir)
......@@ -515,7 +524,9 @@ mostlyclean :
-$(RM) *$o *.[is] XTerm[1-9]*.* Xterm.log.* XtermLog.* .pure core *~ *.bak *.BAK *.out *.tmp
clean : mostlyclean
-$(RM) $(PROGRAMS) builtin_icons.h *.cin *parse.hin
-$(RM) $(PROGRAMS) $(AUTO_SOURCE)
sources : $(AUTO_SOURCE)
distclean :: clean
-$(RM) Makefile config.status config.cache config.log xtermcfg.h
......
The NEWS file was generated from xterm.log.html, which serves as the changelog
for xterm.
--------------------------------------------------------------------------------
Patch #337 - 2018/09/21
Patch #338 - 2018/12/09
* regenerated configure script (report by Sven Joachim).
* revise/improve fix for scrolling in margins (report/analysis by
Martin Hostettler):
* amend change to default-translations "select" subset to ensure that
specific key-press actions are listed before generic key-press
actions (reports by H Merijn Brand, Sven Joachim).
* ignore $TERMINFO in the configure script if it is set to a
non-directory value.
* updated configure macros:
+ CF_WITH_PCRE2, modified to work with Debian's (mis-numbered)
pcre3 package.
+ CF_CC_ENV_FLAGS , report preprocessor options in CFLAGS
+ CF_LD_RPATH_OPT , suppress check if --disable-rpath option was
given.
+ CF_XOPEN_SOURCE, add case for midnightbsd
* update config.guess, config.sub
* add a check to ensure that the filename parameter passed to
XpmReadFileToPixmap is actually a file, since that function does
not check (report by Ben Nott).
* amend solution for Debian #758633 to ensure that replies for
bracketed paste are not sent while processing a selection for
exec-formatted (Debian #913237).
* improve adjustments/clearing for double-width characters in DECERA,
DECFRA, DECSERA.
* improve adjustments/clearing for double-width characters when doing
vertical scrolling within left/right margins (patch by Martin
Hostettler).
* modify wcwidth to encode a few spacing combining marks as regular
combining characters.
* change compiled-in default for saveLines to match the resource-file
changed in patch #192 (Debian #913815).
* change default faceSize to 8.0, to simplify switching back/forth
between bitmap fonts and TrueType. This was originally (mis)set to
14.0 in patch #148.
* add fallback support in Xft configuration for missing glyphs
(prompted by discussion with Mike Burns).
* fix a problem with using direct-colors for the background color
when clearing/scrolling (report by Nicholas Marriott).
* add a "sources" rule for the makefile's generated source.
* add a short explanation in ctlseqs.ms discussing the differences in
error-recovery for malformed sequences versus unimplemented
features, and amend one case for consistency (prompted by
discussion with Martin Hostettler).
* adjusted ifdef's so that the paste64 configure option does not
automatically enable the readline-mouse configure option.
* revert the change which prevented concurrent ownership of different
selection targets, and instead modify selection storage so that
different concurrent requests for different selection targets will
be stored/retrieved independently (Debian #901249).
* remove a check which prevented returning button-codes past the
documented 4/5 for wheel mouse, and add a script mouse-codes which
makes a report showing the various mouse codes for different
button/modifier combinations (discussion with Přemysl Janouch).
* improve display and checksum for DEC Special Graphics by mapping
0x5f to 0.
* add a null-pointer check for table-ending in the extended-boolean
resource-handling (report by Felix von Leitner).
* remove stray ]'s from INSTALL-file (Larry Hynes).
dnl $XTermId: aclocal.m4,v 1.423 2018/08/12 08:58:46 tom Exp $
dnl $XTermId: aclocal.m4,v 1.424 2018/12/09 18:16:22 tom Exp $
dnl
dnl ---------------------------------------------------------------------------
dnl
......@@ -264,7 +264,7 @@ ifelse([$3],,[ :]dnl
])dnl
])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CC_ENV_FLAGS version: 8 updated: 2017/09/23 08:50:24
dnl CF_CC_ENV_FLAGS version: 9 updated: 2018/07/29 18:03:26
dnl ---------------
dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
dnl into CC. This will not help with broken scripts that wrap the compiler
......@@ -281,11 +281,28 @@ AC_DEFUN([CF_CC_ENV_FLAGS],
# This should have been defined by AC_PROG_CC
: ${CC:=cc}
AC_MSG_CHECKING(\$CFLAGS variable)
case "x$CFLAGS" in
(*-[[IUD]]*)
AC_MSG_RESULT(broken)
AC_MSG_WARN(your environment uses the CFLAGS variable to hold CPPFLAGS options)
cf_flags="$CFLAGS"
CFLAGS=
for cf_arg in $cf_flags
do
CF_ADD_CFLAGS($cf_arg)
done
;;
(*)
AC_MSG_RESULT(ok)
;;
esac
AC_MSG_CHECKING(\$CC variable)
case "$CC" in
(*[[\ \ ]]-*)
AC_MSG_RESULT(broken)
AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
AC_MSG_WARN(your environment uses the CC variable to hold CFLAGS/CPPFLAGS options)
# humor him...
cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'`
cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'`
......@@ -602,7 +619,7 @@ AC_DEFUN([CF_ERRNO],
CF_CHECK_ERRNO(errno)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_FUNC_GRANTPT version: 13 updated: 2018/06/28 04:10:16
dnl CF_FUNC_GRANTPT version: 14 updated: 2018/08/12 04:58:46
dnl ---------------
dnl Check for grantpt versus openpty, as well as functions that "should" be
dnl available if grantpt is available.
......@@ -1494,7 +1511,7 @@ AC_TRY_COMPILE([
test $cf_cv_path_lastlog != no && AC_DEFINE(USE_LASTLOG,1,[Define to 1 if we can define lastlog pathname])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_LD_RPATH_OPT version: 7 updated: 2016/02/20 18:01:19
dnl CF_LD_RPATH_OPT version: 8 updated: 2018/08/18 16:36:35
dnl ---------------
dnl For the given system and compiler, find the compiler flags to pass to the
dnl loader to use the "rpath" feature.
......@@ -1503,6 +1520,8 @@ AC_DEFUN([CF_LD_RPATH_OPT],
AC_REQUIRE([CF_CHECK_CACHE])
LD_RPATH_OPT=
if test "x$cf_cv_enable_rpath" != xno
then
AC_MSG_CHECKING(for an rpath option)
case $cf_cv_system_name in
(irix*)
......@@ -1546,6 +1565,7 @@ case "x$LD_RPATH_OPT" in
test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
;;
esac
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
......@@ -3874,7 +3894,7 @@ if test "$with_pcre" != no ; then
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_WITH_PCRE2 version: 1 updated: 2017/07/29 22:57:34
dnl CF_WITH_PCRE2 version: 2 updated: 2018/07/14 16:47:56
dnl -------------
dnl Add PCRE2 (Perl-compatible regular expressions v2) to the build if it is
dnl available and the user requests it. Assume the application will otherwise
......@@ -3891,23 +3911,28 @@ AC_ARG_WITH(pcre2,
test -z "$with_pcre2" && with_pcre2=no
AC_MSG_RESULT($with_pcre2)
if test "$with_pcre2" != no ; then
if test "x$with_pcre2" != xno ; then
CF_TRY_PKG_CONFIG(libpcre2,,[
AC_CHECK_LIB(pcre2-8,pcre2_compile_8,,
AC_MSG_ERROR(Cannot find PCRE2 library))])
CF_TRY_PKG_CONFIG(libpcre,,[
AC_MSG_ERROR(Cannot find PCRE2 library)])])
AC_DEFINE(HAVE_LIB_PCRE2,1,[Define to 1 if we can/should compile with the PCRE2 library])
# if pkgconfig gave no results, look for the libraries directly
case $LIBS in
(*pcre2-posix*)
(*pcre2-posix*|*pcreposix*)
;;
(*)
AC_CHECK_LIB(pcre2-posix,regcomp,[
AC_DEFINE(HAVE_PCRE2POSIX_H,1,[Define to 1 if we should include pcre2posix.h])
CF_ADD_LIB(pcre2-posix)],
AC_MSG_ERROR(Cannot find PCRE2 POSIX library))
[AC_CHECK_LIB(pcreposix,regcomp,[
CF_ADD_LIB(pcreposix)
],[AC_MSG_ERROR(Cannot find PCRE2 POSIX library)])])
;;
esac
# either way, check for the library header files
AC_CHECK_HEADERS(pcre2-posix.h pcreposix.h)
fi
])dnl
dnl ---------------------------------------------------------------------------
......@@ -4132,7 +4157,7 @@ then
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_XOPEN_SOURCE version: 53 updated: 2018/06/16 18:58:58
dnl CF_XOPEN_SOURCE version: 54 updated: 2018/11/07 07:43:44
dnl ---------------
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
dnl or adapt to the vendor's definitions to get equivalent functionality,
......@@ -4162,7 +4187,7 @@ case $host_os in
cf_xopen_source="-D_DARWIN_C_SOURCE"
cf_XOPEN_SOURCE=
;;
(freebsd*|dragonfly*)
(freebsd*|dragonfly*|midnightbsd*)
# 5.x headers associate
# _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
# _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
......
This diff is collapsed.
/* $XTermId: charproc.c,v 1.1608 2018/09/21 18:18:27 tom Exp $ */
/* $XTermId: charproc.c,v 1.1618 2018/12/09 14:05:20 tom Exp $ */
/*
* Copyright 1999-2017,2018 by Thomas E. Dickey
......@@ -501,9 +501,9 @@ static XtResource xterm_resources[] =
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(XtNsaveLines, XtCSaveLines, screen.savelines, DEF_SAVE_LINES),
Ires(XtNscrollBarBorder, XtCScrollBarBorder, screen.scrollBarBorder, 1),
Ires(XtNscrollLines, XtCScrollLines, screen.scrolllines, SCROLLLINES),
Ires(XtNscrollLines, XtCScrollLines, screen.scrolllines, DEF_SCROLL_LINES),
Sres(XtNinitialFont, XtCInitialFont, screen.initial_font, NULL),
Sres(XtNfont1, XtCFont1, screen.MenuFontName(fontMenu_font1), NULL),
......@@ -1881,7 +1881,7 @@ get_subparam(int p, int s)
* to be effective (more than $100 then, more than $200 in 2012)
*
* We overlooked the detail about ":" as a subparameter delimiter (documented
* in 5.4.t2 in ECMA-48). Some discussion in KDE in mid-2006 led Lars Doelle
* in 5.4.2 in ECMA-48). Some discussion in KDE in mid-2006 led Lars Doelle
* to discuss the issue with me. Lars' initial concern dealt with the fact
* that a sequence such as
* CSI 38 ; 5 ; 1 m
......@@ -1913,6 +1913,31 @@ get_subparam(int p, int s)
*
* By the way - all of the parameters are decimal integers, and missing
* parameters represent a default value. ISO-8613-6 is clear about that.
*
* Aside from ISO-8613-3, there is no standard use of ":" as a delimiter.
* ECMA-48 says only:
*
* 5.4.2 Parameter string format
*
* A parameter string which does not start with a bit combination in the
* range 03/12 to 03/15 shall have the following format:
*
* a) A parameter string consists of one or more parameter
* sub-strings, each of which represents a number in decimal
* notation.
*
* b) Each parameter sub-string consists of one or more bit
* combinations from 03/00 to 03/10; the bit combinations from
* 03/00 to 03/09 represent the digits ZERO to NINE; bit
* combination 03/10 may be used as a separator in a parameter
* sub-string, for example, to separate the fractional part of a
* decimal number from the integer part of that number.
*
* That is, there is no mention in ECMA-48 of the possibility that a parameter
* string might be a list of parameters, as done in ISO-8613-3 (nor does
* ECMA-48 provide an example where the ":" separator might be used). Because
* of this, xterm treats other cases than those needed for ISO-8613-3 as an
* error, and stops interpreting the sequence.
*/
#define extended_colors_limit(n) ((n) == 5 ? 1 : ((n) == 2 ? 3 : 0))
static Boolean
......@@ -2175,7 +2200,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
&& CharWidth(test) == CharWidth(prev)) {
putXtermCell(screen, use_row, use_col, test);
} else if (screen->char_was_written
|| getXtermCell(screen, use_row, use_col) > ' ') {
|| getXtermCell(screen, use_row, use_col) >= ' ') {
addXtermCombining(screen, use_row, use_col, c);
} else {
/*
......@@ -3065,6 +3090,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
case CASE_SGR:
for (item = 0; item < nparam; ++item) {
int op = GetParam(item);
int skip;
if_OPT_XMC_GLITCH(screen, {
Mark_XMC(xw, op);
......@@ -3075,7 +3101,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
* Only SGR 38/48 accept subparameters, and in those cases
* the values will not be seen at this point.
*/
if (param_has_subparams(item)) {
if ((skip = param_has_subparams(item))) {
switch (op) {
case 38:
/* FALLTHRU */
......@@ -3086,8 +3112,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
/* FALLTHRU */
default:
TRACE(("...unexpected subparameter in SGR\n"));
op = 9999;
ResetState(sp);
item += skip; /* ignore this */
op = 9999; /* will never use this, anyway */
break;
}
}
......@@ -5823,7 +5849,7 @@ really_set_mousemode(XtermWidget xw,
#define set_mousemode(mode) really_set_mousemode(xw, IsSM(), mode)
#if OPT_READLINE
#if OPT_PASTE64 || OPT_READLINE
#define set_mouseflag(f) \
(IsSM() \
? SCREEN_FLAG_set(screen, f) \
......@@ -6228,6 +6254,11 @@ dpmodes(XtermWidget xw, BitFunc func)
set_keyboard_type(xw, keyboardIsVT220, IsSM());
break;
#endif
#if OPT_PASTE64 || OPT_READLINE
case srm_PASTE_IN_BRACKET:
set_mouseflag(paste_brackets);
break;
#endif
#if OPT_READLINE
case srm_BUTTON1_MOVE_POINT:
set_mouseflag(click1_moves);
......@@ -6238,9 +6269,6 @@ dpmodes(XtermWidget xw, BitFunc func)
case srm_DBUTTON3_DELETE:
set_mouseflag(dclick3_deletes);
break;
case srm_PASTE_IN_BRACKET:
set_mouseflag(paste_brackets);
break;
case srm_PASTE_QUOTE:
set_mouseflag(paste_quotes);
break;
......@@ -6502,6 +6530,11 @@ savemodes(XtermWidget xw)
CursorSave(xw);
}
break;
#if OPT_PASTE64 || OPT_READLINE
case srm_PASTE_IN_BRACKET:
SCREEN_FLAG_save(screen, paste_brackets);
break;
#endif
#if OPT_READLINE
case srm_BUTTON1_MOVE_POINT:
SCREEN_FLAG_save(screen, click1_moves);
......@@ -6512,9 +6545,6 @@ savemodes(XtermWidget xw)
case srm_DBUTTON3_DELETE:
SCREEN_FLAG_save(screen, dclick3_deletes);
break;
case srm_PASTE_IN_BRACKET:
SCREEN_FLAG_save(screen, paste_brackets);
break;
case srm_PASTE_QUOTE:
SCREEN_FLAG_save(screen, paste_quotes);
break;
......@@ -6848,6 +6878,11 @@ restoremodes(XtermWidget xw)
case srm_LEGACY_FKEYS:
xw->keyboard.type = (xtermKeyboardType) screen->save_modes[DP_KEYBOARD_TYPE];
break;
#if OPT_PASTE64 || OPT_READLINE
case srm_PASTE_IN_BRACKET:
SCREEN_FLAG_restore(screen, paste_brackets);
break;
#endif
#if OPT_READLINE
case srm_BUTTON1_MOVE_POINT:
SCREEN_FLAG_restore(screen, click1_moves);
......@@ -6858,9 +6893,6 @@ restoremodes(XtermWidget xw)
case srm_DBUTTON3_DELETE:
SCREEN_FLAG_restore(screen, dclick3_deletes);
break;
case srm_PASTE_IN_BRACKET:
SCREEN_FLAG_restore(screen, paste_brackets);
break;
case srm_PASTE_QUOTE:
SCREEN_FLAG_restore(screen, paste_quotes);
break;
......@@ -9751,7 +9783,9 @@ VTDestroy(Widget w GCC_UNUSED)
if (screen->selection_atoms)
XtFree((void *) (screen->selection_atoms));
XtFree((void *) (screen->selection_data));
for (n = 0; n < MAX_SELECTIONS; ++n) {
free(screen->selected_cells[n].data_buffer);
}
TRACE_FREE_LEAK(xtermClassRec.core_class.tm_table);
TRACE_FREE_LEAK(xw->keyboard.extra_translations);
......@@ -10796,6 +10830,7 @@ reverseCgs(XtermWidget xw, unsigned attr_flags, Bool hilite, int font)
TScreen *screen = TScreenOf(xw);
CgsEnum result = gcMAX;
(void) screen;
if (ReverseOrHilite(screen, attr_flags, hilite)) {
switch (font) {
case fNorm:
......@@ -11735,11 +11770,13 @@ ReallyReset(XtermWidget xw, Bool full, Bool saved)
#if OPT_DEC_RECTOPS
screen->cur_decsace = 0;
#endif
#if OPT_PASTE64 || OPT_READLINE
screen->paste_brackets = OFF;
#endif
#if OPT_READLINE
screen->click1_moves = OFF;
screen->paste_moves = OFF;
screen->dclick3_deletes = OFF;
screen->paste_brackets = OFF;
screen->paste_quotes = OFF;
screen->paste_literal_nl = OFF;
#endif /* OPT_READLINE */
......
/* $XTermId: charsets.c,v 1.103 2018/09/08 14:17:50 tom Exp $ */
/* $XTermId: charsets.c,v 1.104 2018/09/23 16:48:58 tom Exp $ */
/*
* Copyright 1998-2017,2018 by Thomas E. Dickey
......@@ -1430,6 +1430,8 @@ xtermCharSetOut(XtermWidget xw, IChar *buf, IChar *ptr, DECNRCM_codes leftset)
else
#endif
chr = seven - 0x5f;
} else if (chr == 0x5f) {
chr = 0;
} else {
chr = seven;
}
......
......@@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2018 Free Software Foundation, Inc.
timestamp='2018-05-19'
timestamp='2018-11-28'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
......@@ -84,8 +84,6 @@ if test $# != 0; then
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
......@@ -96,34 +94,39 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
tmp=
# shellcheck disable=SC2172
trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15
trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0
set_cc_for_build() {
: "${TMPDIR=/tmp}"
# shellcheck disable=SC2039
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c" ;
for c in cc gcc c89 c99 ; do
if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
,,) echo "int x;" > "$dummy.c"
for driver in cc gcc c89 c99 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD="$driver"
break
fi
done
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
esac
}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
......@@ -138,7 +141,7 @@ Linux|GNU|GNU/*)
# We could probably try harder.
LIBC=gnu
eval "$set_cc_for_build"
set_cc_for_build
cat <<-EOF > "$dummy.c"
#include <features.h>
#if defined(__UCLIBC__)
......@@ -199,7 +202,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval "$set_cc_for_build"
set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
......@@ -389,20 +392,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo i386-pc-auroraux"$UNAME_RELEASE"
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval "$set_cc_for_build"
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH=x86_64
fi
fi
echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
case `isainfo -b` in
32)
echo i386-pc-solaris2"$UNAME_REL"
;;
64)
echo x86_64-pc-solaris2"$UNAME_REL"
;;
esac
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
......@@ -482,7 +480,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo clipper-intergraph-clix"$UNAME_RELEASE"
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval "$set_cc_for_build"
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
......@@ -579,7 +577,7 @@ EOF
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval "$set_cc_for_build"
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
......@@ -660,7 +658,7 @@ EOF
esac
fi
if [ "$HP_ARCH" = "" ]; then
eval "$set_cc_for_build"
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
......@@ -700,7 +698,7 @@ EOF
esac
if [ "$HP_ARCH" = hppa2.0w ]
then
eval "$set_cc_for_build"
set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
......@@ -726,7 +724,7 @@ EOF
echo ia64-hp-hpux"$HPUX_REV"
exit ;;
3050*:HI-UX:*:*)
eval "$set_cc_for_build"
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h>
int
......@@ -840,6 +838,17 @@ EOF
*:BSD/OS:*:*)
echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
exit ;;
arm:FreeBSD:*:*)
UNAME_PROCESSOR=`uname -p`
set_cc_for_build
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
else
echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
fi
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case "$UNAME_PROCESSOR" in
......@@ -881,7 +890,7 @@ EOF
echo "$UNAME_MACHINE"-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
echo x86_64-pc-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
......@@ -894,8 +903,8 @@ EOF
# other systems with GNU libc and userland
echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
exit ;;
i*86:Minix:*:*)
echo "$UNAME_MACHINE"-pc-minix
*:Minix:*:*)
echo "$UNAME_MACHINE"-unknown-minix
exit ;;
aarch64:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
......@@ -922,7 +931,7 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arm*:Linux:*:*)
eval "$set_cc_for_build"
set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
......@@ -971,7 +980,7 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval "$set_cc_for_build"
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
#undef ${UNAME_MACHINE}
......@@ -1285,7 +1294,7 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
eval "$set_cc_for_build"
set_cc_for_build
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
......@@ -1358,6 +1367,7 @@ EOF
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
# shellcheck disable=SC2154
if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
......@@ -1414,6 +1424,9 @@ EOF
amd64:Isilon\ OneFS:*:*)
echo x86_64-unknown-onefs
exit ;;
*:Unleashed:*:*)
echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
exit ;;
esac
echo "$0: unable to guess system type" >&2
......
This diff is collapsed.
This diff is collapsed.
dnl $XTermId: configure.in,v 1.359 2018/05/02 22:07:06 tom Exp $
dnl $XTermId: configure.in,v 1.361 2018/12/09 19:07:03 tom Exp $
dnl
dnl -----------------------------------------------------------------------------
dnl this file is part of xterm
......@@ -387,6 +387,17 @@ CF_XBOOL_RESULT(DEF_META_SENDS_ESC,meta_sends_esc,[Define to 1 if meta should se
###############################################################################
AC_CHECK_PROG(cf_tic_prog,tic,yes,no)
if test "$cf_tic_prog" = yes ; then
if test -n "$TERMINFO"
then
case "$TERMINFO" in
(/*)
test -d "$TERMINFO" || unset TERMINFO
;;
(*)
unset TERMINFO
;;
esac
fi
AC_MSG_CHECKING(for private terminfo-directory)
AC_ARG_WITH(own-terminfo,
[ --with-own-terminfo=P set default $TERMINFO (default: from environment)],
......
.\"#! troff -ms $1 -*- Nroff -*-
.\" "Xterm Control Sequences" document
.\" $XTermId: ctlseqs.ms,v 1.481 2018/09/16 21:58:34 tom Exp $
.\" $XTermId: ctlseqs.ms,v 1.485 2018/11/22 02:19:21 tom Exp $
.\"
.\"
.\" Copyright 1996-2017,2018 by Thomas E. Dickey
......@@ -70,7 +70,7 @@
.ds XT XTerm
.ds xt xterm
.ds LF Patch #336
.ds RF 2018/09/16
.ds RF 2018/11/21
.\"
.if n .pl 9999v \" no page breaks in nroff
.ND
......@@ -425,10 +425,34 @@ sequence because those cannot alter the meaning of the control sequence.
Some controls (such as \*(Os) introduce a string mode,
which is ended on a \*(ST (string terminator).
.IP
Again, the terminal should accept single-byte controls within the string.
However, \fI\*(xt\fP has a resource setting \fBbrokenLinuxOSC\fP to allow
recovery from applications which rely upon malformed palette sequences
used by the Linux console.
ECMA-48 describes only correct behavior,
telling what types of characters are expected
at each stage of the control sequences.
It says that the action taken in error recovery is implementation-dependent.
\fI\*(XT\fP decodes control sequences using a state machine.
It handles errors in decoding
i.e., unexpected characters,
by resetting to the initial (ground) state.
That is different from the treatment of unimplemented
(but correctly formatted) features.
.IP
If an application does not send the string terminator, that is also an error
from the standpoint of a user.
To accommodate users of those applications, \fI\*(xt\fP has resource
settings which allow workarounds:
.RS
.bP
The Linux console's palette sequences do not use a string terminator.
The \fBbrokenLinuxOSC\fP resource setting tells \fI\*(xt\fP to ignore
those particular sequences.
.bP
The terminal should accept single-byte controls within the string.
But some applications omit a string terminator,
like the Linux console.
The \fBbrokenStringTerm\fP resource setting tells \fI\*(xt\fP to exit
string mode if it decodes a common control character such as carriage return
before the string terminator.
.RE
.
.Sh "C1 (8-Bit) Control Characters"
.LP
......@@ -2276,13 +2300,16 @@ If the parameter is empty, \fI\*(xt\fP uses \*(cs\*0,
to specify the configurable primary/clipboard selection and cut buffer 0.
.sP
The second parameter, \*(Pd, gives the selection data.
Normally this is a string encoded in base64.
Normally this is a string encoded in base64 (RFC-4648).
The data becomes the new selection,
which is then available for pasting by other applications.
.sP
If the second parameter is a \*?,
\fI\*(xt\fP replies to the host with the selection
data encoded using the same protocol.
It uses the first selection
found by asking successively
for each item from the list of selection parameters.
.sP
If the second parameter is neither a base64 string nor \*?,
then the selection is cleared.
......@@ -2962,6 +2989,14 @@ then cursor up/down controls are sent when the terminal is displaying
the \fIAlternate Screen Buffer\fP.
The initial state of \fIAlternate Scroll\fP mode is set
using the \fBalternateScroll\fP resource.
.Ss Other buttons
.LP
Additional buttons are encoded like the wheel mice, by adding 64.
The encoding is unambiguous for buttons 6 and 7,
which are seen for some tiltable wheel mice.
However, it is not possible to use these buttons in \fI\*(xt\fP's
\fBtranslation\fP resource because their names are not in the X Toolkit's
symbol table.
.Ss Highlight tracking
.LP
Mouse highlight tracking notifies a program of a button press, receives a
......
......@@ -21,7 +21,7 @@
Thomas Dickey
XFree86 Project (1996-2006)
invisible-island.net (2006-2018)
updated for XTerm Patch #336 (2018/09/16)
updated for XTerm Patch #336 (2018/11/21)
......@@ -90,10 +90,28 @@ o Single-byte controls can be handled separately from multi-byte con-
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.
ECMA-48 describes only correct behavior, telling what types of char-
acters are expected at each stage of the control sequences. It says
that the action taken in error recovery is implementation-dependent.
XTerm decodes control sequences using a state machine. It handles
errors in decoding i.e., unexpected characters, by resetting to the
initial (ground) state. That is different from the treatment of
unimplemented (but correctly formatted) features.
If an application does not send the string terminator, that is also
an error from the standpoint of a user. To accommodate users of
those applications, xterm has resource settings which allow work-
arounds:
o The Linux console's palette sequences do not use a string termi-
nator. The brokenLinuxOSC resource setting tells xterm to
ignore those particular sequences.
o The terminal should accept single-byte controls within the
string. But some applications omit a string terminator, like
the Linux console. The brokenStringTerm resource setting tells
xterm to exit string mode if it decodes a common control charac-
ter such as carriage return before the string terminator.
C1 (8-Bit) Control Characters
......@@ -1588,12 +1606,14 @@ OSC Ps ; Pt ST
selection and cut buffer 0.
The second parameter, Pd, gives the selection data. Normally
this is a string encoded in base64. The data becomes the new
selection, which is then available for pasting by other appli-
cations.
this is a string encoded in base64 (RFC-4648). The data
becomes the new selection, which is then available for pasting
by other applications.
If the second parameter is a ? , xterm replies to the host
with the selection data encoded using the same protocol.
with the selection data encoded using the same protocol. It
uses the first selection found by asking successively for each
item from the list of selection parameters.
If the second parameter is neither a base64 string nor ? ,
then the selection is cleared.
......@@ -2163,6 +2183,15 @@ playing the Alternate Screen Buffer. The initial state of Alternate
Scroll mode is set using the alternateScroll resource.
Other buttons
Additional buttons are encoded like the wheel mice, by adding 64. The
encoding is unambiguous for buttons 6 and 7, which are seen for some
tiltable wheel mice. However, it is not possible to use these buttons
in xterm's translation resource because their names are not in the X
Toolkit's symbol table.
Highlight tracking
Mouse highlight tracking notifies a program of a button press, receives
......
xterm (338-1) UNRELEASED; urgency=medium
* New upstream release.
- Amend solution for #758633 to ensure that replies for bracketed
paste are not sent while processing a selection for exec-formatted
(Closes: #913237).
- Change compiled-in default for saveLines to match the resource-file
changed in xterm 192 (Closes: #913815).
- Revert the change which prevented concurrent ownership of different
selection targets, and instead modify selection storage so that
different concurrent requests for different selection targets will
be stored/retrieved independently (Closes: #901249).
* Update copy of XTerm FAQ to revision 1.375 (dated 2018/10/16).
-- Sven Joachim <svenjoac@gmx.de> Mon, 10 Dec 2018 18:17:03 +0100
xterm (337-1) unstable; urgency=medium
* New upstream release.
......
......@@ -19,7 +19,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF *
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
*****************************************************************************
$XTermId: xterm.faq.html,v 1.366 2018/04/15 22:11:39 tom Exp $
$XTermId: xterm.faq.html,v 1.375 2018/10/16 00:14:34 tom Exp $
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
......@@ -326,6 +326,19 @@
<h2 id="what_is_vt220-id"><a name="what_is_vt220" id=
"what_is_vt220">What is a VT220?</a></h2>
<ul>
<li><a href="#what_vt220">Why a VT220?</a></li>
<li><a href="#whatis_state_table">What is a State
Table?</a></li>
<li><a href="#why_not_vt320">Why not emulate VT320?</a></li>
<li><a href="#why_vt420">Why emulate VT420?</a></li>
<li><a href="#why_not_vt520">Why not emulate VT520?</a></li>
</ul>
<h3 id="why_vt220-id"><a name="what_vt220" id="what_vt220">Why a
VT220?</a></h3>
......@@ -345,11 +358,12 @@
curses programs.</p>
<p>Later, I noticed that xterm had some support for what would
now be termed as ISO-2022. That was a VT220 feature, rather than
VT100. There were some missing pieces. So I decided to fill in
those pieces and make xterm a VT220 emulator. (VT220s do not do
ANSI color either&mdash;the missing pieces were in other
areas).</p>
now be termed as ISO-2022. That was a VT220 feature which
preceded ISO-2022 called <em>National Replacement Character</em>
sets. In any case, it was not a VT100 feature. There were some
missing pieces. So I decided to fill in those pieces and make
xterm a VT220 emulator. (VT220s do not do ANSI color
either&mdash;the missing pieces were in other areas).</p>
<p><strong>XTerm</strong> also provides features that are in
neither VT100 nor VT220, which are used by other programs as
......@@ -379,6 +393,12 @@
implement in shell scripts than <code>ESC&nbsp;\</code>.</li>
</ul>
<p>ECMA-48 (the standard) does not describe this particular
control, but prescribes its format (an <a href=
"ctlseqs/ctlseqs.html#h2-Operating-System-Commands">operating
system command</a>). It does not use a
<strong><code>BEL</code></strong>.</p>
<p>I revised that area <a href=
"/xterm/xterm.log.html#xterm_24">starting in 1996</a>,</p>
......@@ -389,6 +409,23 @@
<li>to accept the standard string terminator as well.</li>
</ul>
<p>In addition to implementing the VT220's <em>National
Replacement Character</em> sets (see vttest <a href=
"/vttest/vttest-nrcs.html">screenshots</a>), I added other
features to emulate the successive models of DEC terminals. The
<a href=
"manpage/xterm.html#VT100-Widget-Resources:decTerminalID"><code>decTerminalID</code></a>
resource (in <a href="xterm.log.html#xterm_29">1999</a>) lets
users select the emulation to use. Because many of my changes
were <em>extensions</em> (features not in any of DEC's terminals)
and because well-behaved VT100 applications would not use
features from higher-level terminals it was not initially
important to prevent use of those by applications which assumed
they were using just a VT100. Knowledgable users could easily
configure xterm to emulate a VT220. In <a href=
"xterm.log.html#xterm_280">2012</a>, I changed the default from
VT100 to VT420.</p>
<h3 id="whatis_state_table">What is a State Table?</h3>
<p>That was mentioned regarding the title strings.
......@@ -398,6 +435,75 @@
them not do well with <a href=
"/vttest/vttest.html">vttest</a>.</p>
<h3 id="why_not_vt320">Why not emulate VT320?</h3>
<p>You could do that (by changing <code>decTerminalID</code>, but
the results were not that interesting). In retrospect, the VT320
was a stopgap implementation designed to bridge between the VT200
series and the VT420. It provided a standard codepage (for ISO
Latin-1).</p>
<p>While it had other features not found in the VT200-series,
most of those are less useful in a terminal emulator. I did adapt
the ECMA-48 <em>scrolling</em> operations which the VT320
interpreted as <em>panning</em> the visible display in the
terminal's memory. Expect some difference there (if you can find
an application on VMS which used the feature).</p>
<p>The VT320 was popular with developers of commercial terminal
emulators, whose literature referred to it as supporting ANSI
color. It did not do this.</p>
<h3 id="why_vt420">Why emulate VT420?</h3>
<p>The VT420 was interesting because it provided two features
that could be useful:</p>
<ul>
<li>rectangles</li>
<li>left/right margins (like the top/bottom scrolling
margins)</li>
</ul>
<p>A VT420, of course, supports all of the features in VT320, in
turn all of the features in VT220, and in turn VT100. Users would
not lose features by changing the default emulation to VT420. By
changing the default emulation, most users would automatically be
able to use applications (such as <code>tmux</code>) that could
perform better if the left/right margin feature is available. I
changed the emulation to VT420 in 2012 for this reason.</p>
<p>XTerm does not emulate some esoteric features (such as dual
sessions) because those require hosts using special software, and
no publicly-available documentation was available.</p>
<h3 id="why_not_vt520">Why not emulate VT520?</h3>
<p>Again, the VT500-series is less interesting because most of
the features which are not hardware-specific (such as reporting
transmission rate) are less useful.</p>
<p>However:</p>
<ul>
<li>the VT500-series provides additional codepages (like the
VT320). XTerm does that.</li>
<li>the VT500-series supports some of the ECMA-48
cursor-movement operations which had been overlooked in the
previous terminals. XTerm does that (based on ECMA-48 itself,
and later on DEC's documentation).</li>
</ul>
<p>As for the other features, most are not useful in emulation
(since they are hardware-specific). Additionally, these less-used
features are not documented precisely and since the only point of
providing them would be for successful interoperability with
legacy applications, some reverse-engineering would be needed to
provide a faithful emulation. To date there are no known terminal
emulators which do that.</p>
<h2 id="what_platforms-id"><a name="what_platforms" id=
"what_platforms">What platforms does it run on?</a></h2>
......@@ -430,7 +536,7 @@
X11R6 provided better locale support, as well as new features
such as the active icon. X11R7... not much to say there.</p>
<p>Since 2000, there have been a many changes (including new
<p>Since 2000, there have been many changes (including new
platforms such as MacOS, NetBSD, OpenBSD, etc., as well as QNX,
Cygwin, and Minix).</p>
......@@ -538,7 +644,13 @@
"https://bugzilla.gnome.org/buglist.cgi?quicksearch=vte">VTE</a>
and with <a href=
"https://bugzilla.gnome.org/buglist.cgi?quicksearch=gnome+terminal">
GNOME Terminal</a>.</li>
GNOME Terminal</a>. The attitude of the developers is that by
copying from xterm, they are <em>entitled</em> to do this
whether or not the program actually matches xterm's terminal
description. This is unchanged since the mid-2000s (see Debian
<a href=
"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=368916">#368916</a>
for example).</li>
<li>Konsole does this as well&mdash;intentionally as shown in
<a href="https://bugs.kde.org/show_bug.cgi?id=145977"><em>KDE
......@@ -7067,15 +7179,61 @@ There are no docs for the gnome-terminal command line options.
2013. Here are a few links for that process:</p>
<ul>
<li><a href=
"https://git.gnome.org/browse/gnome-terminal/commit/?id=13ece45d6398e0ebe9aa06cc8da2148534ca8af6">
<em>help: update introduction.page</em></a> (2013-01-10)</li>
<li><a href=
"https://git.gnome.org/browse/gnome-terminal/commit/?id=dd1c5125c785f644954010052ee3e4c7783c08da">
<em>help: review</em></a></li>
<em>help: review</em></a> (2013-01-09)</li>
<li><a href=
"https://git.gnome.org/browse/gnome-terminal/commit/?id=317b05f46807ea60fbd6a0ed493824a2269dcc60">
<em>help: modified help in accordance with last
review</em></a></li>
<em>help: modified help in accordance with last review</em></a>
(2013-01-09)</li>
<li><a href=
"https://git.gnome.org/browse/gnome-terminal/commit/?id=13ece45d6398e0ebe9aa06cc8da2148534ca8af6">
<em>help: write instroduction.page</em></a> (2013-01-08)</li>
<li><a href=
"https://git.gnome.org/browse/gnome-terminal/commit/?id=8a4b9e67bc8f6a19e62c58650a635de6178911bd">
<em>help: start rewrite in Mallard</em></a> (2013-01-08)</li>
</ul>
<p>The document editors removed this statement</p>
<blockquote class="code-block">
<p>Run any application that is designed to run on VT102, VT220,
and <code>xterm</code> terminals</p>
</blockquote>
<p>as well as the extended comment about the <a href=
"#vte:xconsortium">X Consortium</a>, and replaced it with a less
specific statement.</p>
<blockquote class="code-block">
<p><code>Terminal</code> is a terminal emulator application for
accessing a UNIX shell environment which can be used to run
programs available on your system.</p>
<p><code>Terminal</code> supports escape sequences that control
cursor position and colors.</p>
</blockquote>
<p>The assertion about GNOME-Terminal's support for
&ldquo;any&rdquo; persists in its <a href=
"https://packages.debian.org/sid/gnome-terminal">package
description</a> in Debian as of 2018:</p>
<blockquote class="code-block">
<ul>
<li>Access a UNIX shell in the GNOME environment.</li>
<li>Run any application that is designed to run on VT102,
VT220, and xterm terminals.</li>
</ul>
</blockquote>
<p>Whether the revised manual is improved or even helpful is
debatable. For instance, it tells the reader how to turn the
......@@ -7271,7 +7429,7 @@ all: Use terminfo instead of termcap
<p>As a minor improvement, those changes removed some of the code
whose origin was cut/paste from xterm. But that does not mean
that the VTE developers stopped that practice. For instance, a
recent change <a href=
change in late 2017 <a href=
"https://en.wikipedia.org/w/index.php?title=ANSI_escape_code&amp;type=revision&amp;diff=816842550&amp;oldid=815750533">
here</a> reminded me to check what VTE does when saving/restoring
the cursor position. It turns out that it does something similar,
......@@ -7296,7 +7454,104 @@ all: Use terminfo instead of termcap
<p>VTE developers do more than copy from xterm, of course. There
are other programs (such as Konsole and Terminal.app) which get
similar treatment.</p>
similar treatment. Because they tend to copy from others rather
than doing their own solutions, they have not acquired the
experience to see why features were added or modified (or
removed), just that it is there. For instance:</p>
<ul>
<li>
<p>In a recent rewrite (early 2018), they introduced a
skeleton of code from Paul Williams' sample parser. However,
that is only a skeleton. For the flesh &ndash; the usual
approach (see above).</p>
<p>Two thirds of the functions listed in the skeleton are
no-ops (<a href=
"https://gitlab.gnome.org/GNOME/vte/blob/86e1d0883b88d4899c9b398d9f0a1c51b9d86e8d/src/parser-cmd.hh#L125">not
implemented</a>). Some of those listed as implemented do not
work (see vttest <a href=
"/vttest/vttest-codepages.html#ISO-Latin-1">screenshot</a>).</p>
<p>Oddly enough, the developers decided to make the program
<a href=
"https://gitlab.gnome.org/GNOME/vte/blob/86e1d0883b88d4899c9b398d9f0a1c51b9d86e8d/src/vteseq.cc#L2316">
claim that it is a VT525</a>, though the skeleton
demonstrates that it lacks almost all of features provided by
the corresponding hardware terminal. In October 2018, the
listing shows mostly a subset of VT100, with some
(longstanding) features adapted from xterm, and a few
inspired by ECMA-48.</p>
</li>
<li>
<p>The latter requires some comment: xterm's
control-sequences document has mentioned ISO-6429 and ECMA-48
since its earliest version. VTE's developers used that as a
reference <a href=
"https://bugzilla.gnome.org/buglist.cgi?quicksearch=ctlseqs">(see
bug reports)</a> along with xterm's source-code rather than
<a href=
"https://bugzilla.gnome.org/buglist.cgi?quicksearch=ecma-48">ECMA-48</a>
or DEC's manuals until around the end of 2016.</p>
</li>
<li>
<p>They did (eventually) read documentation referred to by
xterm's documentation. But that took a while, and they began
copying from those sources before understanding the tradeoffs
in those. Late in 2016, they started copying features
mentioned in ECMA-48. The motivation for that appears to be
(unsurprisingly) copying from yet another source, e.g.,
<a href="https://github.com/kovidgoyal/kitty">kitty</a> (yet
another copyist: see <a href=
"https://github.com/jwilm/alacritty">alacritty</a>, but also
see <a href="https://github.com/jwilm/vte">this</a>).</p>
</li>
<li>
<p>Introducing those ECMA-48 features caused additional
failures for VTE versus <a href=
"/vttest/vttest.html">vttest</a>, which the VTE developers
solved by making a copy of vttest, to &ldquo;fix&rdquo; the
bug. The problematic feature dealt with clearing tab-stops
(selection 2).</p>
<p>ECMA-48 specifies the <em>active line</em> in selection 2.
For an explanation of the term, see ECMA-48 section
<em><strong>6.1.5</strong> Relationship between active data
position and active presentation position</em>. This is
distinct from the feature which DEC's terminals
supported.</p>
<p>The VT520 manual is explicit in this case (only selections
0 and 3 are supported). Per Lindberg's 1985 test demonstrated
that the unsupported selection 2 was ignored in a VT100.</p>
</li>
<li>
<p>The VT520 did not support the other selection (2) because
that would have been used to support bi-directional text.
There is no point in having two differently-worded
descriptions of the same identical feature.</p>
<p>At the time the VTE developers copied the feature, they
had not begun to develop support bi-directional text (see for
example <a href=
"https://bugzilla.gnome.org/show_bug.cgi?id=321490"><em>#321490
(vtebidi)</em></a> and <a href=
"https://bugzilla.gnome.org/show_bug.cgi?id=767529"><em>#767529
(vteemoji)</em></a>.</p>
<p>At this writing (two years later), the developers are
talking about working on that. The tab-clear operation is
still <a href=
"https://gitlab.gnome.org/GNOME/vte/blob/86e1d0883b88d4899c9b398d9f0a1c51b9d86e8d/src/vteseq.cc#L7710">
identical in VTE</a> for both selections 2 and 3, and does
not implement any of the features from ECMA-48
<strong>not</strong> in a DEC terminal.</p>
</li>
</ul>
<p>Other problems with VTE &mdash;</p>
......
/* $XTermId: fontutils.c,v 1.574 2018/08/02 21:28:05 tom Exp $ */
/* $XTermId: fontutils.c,v 1.605 2018/12/02 21:55:42 tom Exp $ */
/*
* Copyright 1998-2017,2018 by Thomas E. Dickey
......@@ -2209,16 +2209,16 @@ xtermSetCursorBox(TScreen *screen)
screen->box = VTbox;
}
#define CACHE_XFT(dst,src) if (src != 0) {\
failed += checkXft(xw, &(dst[fontnum]), src);\
#define CACHE_XFT(dst,src) if (src.font != 0) {\
failed += checkXft(xw, &(dst[fontnum]), &src);\
TRACE(("Xft metrics %s[%d] = %d (%d,%d)%s advance %d, actual %d%s\n",\
#dst,\
fontnum,\
src->height,\
src->ascent,\
src->descent,\
((src->ascent + src->descent) > src->height ? "*" : ""),\
src->max_advance_width,\
src.font->height,\
src.font->ascent,\
src.font->descent,\
((src.font->ascent + src.font->descent) > src.font->height ? "*" : ""),\
src.font->max_advance_width,\
dst[fontnum].map.min_width,\
dst[fontnum].map.mixed ? " mixed" : ""));\
}
......@@ -2292,7 +2292,7 @@ dumpXft(XtermWidget xw, XTermXftFonts *data)
TRACE((" data range %#6x..%#6x\n", first, last));
for (c = first; c <= last; ++c) {
if (FcCharSetHasChar(xft->charset, c)) {
int width = my_wcwidth((int) c);
int width = CharWidth(c);
XGlyphInfo extents;
XftTextExtents32(XtDisplay(xw), xft, &c, 1, &extents);
......@@ -2311,15 +2311,16 @@ dumpXft(XtermWidget xw, XTermXftFonts *data)
#endif
static int
checkXft(XtermWidget xw, XTermXftFonts *data, XftFont *xft)
checkXft(XtermWidget xw, XTermXftFonts *target, XTermXftFonts *source)
{
FcChar32 c;
Dimension width = 0;
int failed = 0;
data->font = xft;
data->map.min_width = 0;
data->map.max_width = (Dimension) xft->max_advance_width;
target->font = source->font;
target->pattern = source->pattern;
target->map.min_width = 0;
target->map.max_width = (Dimension) source->font->max_advance_width;
/*
* For each ASCII or ISO-8859-1 printable code, ask what its width is.
......@@ -2331,27 +2332,29 @@ checkXft(XtermWidget xw, XTermXftFonts *data, XftFont *xft)
for (c = 32; c < 256; ++c) {
if (c >= 127 && c <= 159)
continue;
if (FcCharSetHasChar(xft->charset, c)) {
if (FcCharSetHasChar(source->font->charset, c)) {
XGlyphInfo extents;
XftTextExtents32(XtDisplay(xw), xft, &c, 1, &extents);
if (width < extents.width && extents.width <= data->map.max_width) {
XftTextExtents32(XtDisplay(xw), source->font, &c, 1, &extents);
if (width >= extents.width)
continue;
if (extents.width > target->map.max_width)
continue;
width = extents.width;
}
}
}
/*
* 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;
if (xtermXftLastChar(source->font) >= 256) {
width = target->map.max_width;
}
}
data->map.min_width = width;
data->map.mixed = (data->map.max_width >= (data->map.min_width + 1));
target->map.min_width = width;
target->map.mixed = (target->map.max_width >= (target->map.min_width + 1));
return failed;
}
......@@ -2390,6 +2393,7 @@ reportXftFonts(XtermWidget xw,
source = 0;
}
}
fflush(stdout);
}
}
#else
......@@ -2428,6 +2432,30 @@ maybeXftCache(XtermWidget xw, XftFont *font)
return result;
}
/*
* Drop an entry from the cache, and close the font.
*/
void
closeCachedXft(TScreen *screen, XftFont *font)
{
if (font != 0) {
ListXftFonts *p, *q;
for (p = screen->list_xft_fonts, q = 0; p != 0; q = p, p = p->next) {
if (p->font == font) {
XftFontClose(screen->display, font);
if (q != 0) {
q->next = p->next;
} else {
screen->list_xft_fonts = p->next;
}
free(p);
break;
}
}
}
}
static XftFont *
xtermOpenXft(XtermWidget xw, const char *name, XftPattern *pat, const char *tag)
{
......@@ -2436,8 +2464,14 @@ xtermOpenXft(XtermWidget xw, const char *name, XftPattern *pat, const char *tag)
XftResult status;
XftFont *result = 0;
TRACE(("xtermOpenXft(name=%s, tag=%s)\n", name, tag));
if (pat != 0) {
XftPattern *match = XftFontMatch(dpy, DefaultScreen(dpy), pat, &status);
XftPattern *match;
FcConfigSubstitute(NULL, pat, FcMatchPattern);
XftDefaultSubstitute(dpy, DefaultScreen(dpy), pat);
match = FcFontMatch(NULL, pat, &status);
if (match != 0) {
result = XftFontOpenPattern(dpy, match);
if (result != 0) {
......@@ -2808,8 +2842,23 @@ void
xtermCloseXft(TScreen *screen, XTermXftFonts *pub)
{
if (pub->font != 0) {
XftFontClose(screen->display, pub->font);
Cardinal n;
closeCachedXft(screen, pub->font);
pub->font = 0;
if (pub->pattern) {
XftPatternDestroy(pub->pattern);
}
if (pub->fontset) {
XftFontSetDestroy(pub->fontset);
}
for (n = 0; n < MAX_XFT_CACHE; ++n) {
if (pub->cache[n].font) {
closeCachedXft(screen, pub->cache[n].font);
}
}
}
}
......@@ -2882,16 +2931,16 @@ xtermComputeFontInfo(XtermWidget xw,
*/
if (UsingRenderFont(xw) && fontnum >= 0) {
String face_name = getFaceName(xw, False);
XftFont *norm = screen->renderFontNorm[fontnum].font;
XftFont *bold = screen->renderFontBold[fontnum].font;
XftFont *ital = screen->renderFontItal[fontnum].font;
XTermXftFonts norm = screen->renderFontNorm[fontnum];
XTermXftFonts bold = screen->renderFontBold[fontnum];
XTermXftFonts ital = screen->renderFontItal[fontnum];
#if OPT_RENDERWIDE
XftFont *wnorm = screen->renderWideNorm[fontnum].font;
XftFont *wbold = screen->renderWideBold[fontnum].font;
XftFont *wital = screen->renderWideItal[fontnum].font;
XTermXftFonts wnorm = screen->renderWideNorm[fontnum];
XTermXftFonts wbold = screen->renderWideBold[fontnum];
XTermXftFonts wital = screen->renderWideItal[fontnum];
#endif
if (norm == 0 && face_name) {
if (norm.font == 0 && face_name) {
XftPattern *pat;
double face_size;
......@@ -2899,6 +2948,9 @@ xtermComputeFontInfo(XtermWidget xw,
fontnum, face_name,
xw->misc.face_size[fontnum]));
TRACE(("Using Xft %d\n", XftVersion));
TRACE(("Using FontConfig %d\n", FC_VERSION));
fillInFaceSize(xw, fontnum);
face_size = xw->misc.face_size[fontnum];
......@@ -2913,11 +2965,11 @@ xtermComputeFontInfo(XtermWidget xw,
#define BoldXftPattern(norm) \
XFT_WEIGHT, XftTypeInteger, XFT_WEIGHT_BOLD, \
XFT_CHAR_WIDTH, XftTypeInteger, norm->max_advance_width
XFT_CHAR_WIDTH, XftTypeInteger, norm.font->max_advance_width
#define ItalXftPattern(norm) \
XFT_SLANT, XftTypeInteger, XFT_SLANT_ITALIC, \
XFT_CHAR_WIDTH, XftTypeInteger, norm->max_advance_width
XFT_CHAR_WIDTH, XftTypeInteger, norm.font->max_advance_width
#if OPT_WIDE_ATTRS
#define HAVE_ITALICS 1
......@@ -2930,25 +2982,28 @@ xtermComputeFontInfo(XtermWidget xw,
#endif
if ((pat = XftNameParse(face_name)) != 0) {
#define OPEN_XFT(tag) xtermOpenXft(xw, face_name, pat, tag)
XftPatternBuild(pat,
#define OPEN_XFT(name, tag) name.font = xtermOpenXft(xw, face_name, name.pattern, tag)
norm.pattern = XftPatternDuplicate(pat);
XftPatternBuild(norm.pattern,
NormXftPattern,
(void *) 0);
norm = OPEN_XFT("normal");
OPEN_XFT(norm, "normal");
if (norm != 0) {
XftPatternBuild(pat,
if (norm.font != 0) {
bold.pattern = XftPatternDuplicate(norm.pattern);
XftPatternBuild(bold.pattern,
BoldXftPattern(norm),
(void *) 0);
bold = OPEN_XFT("bold");
OPEN_XFT(bold, "bold");
#if HAVE_ITALICS
if (FIND_ITALICS) {
XftPatternBuild(pat,
ital.pattern = XftPatternDuplicate(norm.pattern);
XftPatternBuild(ital.pattern,
NormXftPattern,
ItalXftPattern(norm),
(void *) 0);
ital = OPEN_XFT("italic");
OPEN_XFT(ital, "italic");
}
#endif
#undef OPEN_XFT
......@@ -2975,8 +3030,8 @@ xtermComputeFontInfo(XtermWidget xw,
* See xtermXftDrawString().
*/
#if OPT_RENDERWIDE
if (norm != 0 && screen->wide_chars) {
int char_width = norm->max_advance_width * 2;
if (norm.font != 0 && screen->wide_chars) {
int char_width = norm.font->max_advance_width * 2;
#ifdef FC_ASPECT
double aspect = ((FirstItemOf(xw->work.fonts.xft.list_w)
|| screen->renderFontNorm[fontnum].map.mixed)
......@@ -2995,30 +3050,33 @@ xtermComputeFontInfo(XtermWidget xw,
XFT_SPACING, XftTypeInteger, XFT_MONO
if (face_name && (pat = XftNameParse(face_name)) != 0) {
#define OPEN_XFT(tag) xtermOpenXft(xw, face_name, pat, tag)
XftPatternBuild(pat,
#define OPEN_XFT(name, tag) name.font = xtermOpenXft(xw, face_name, name.pattern, tag)
wnorm.pattern = XftPatternDuplicate(pat);
XftPatternBuild(wnorm.pattern,
WideXftPattern,
XFT_CHAR_WIDTH, XftTypeInteger, char_width,
#ifdef FC_ASPECT
FC_ASPECT, XftTypeDouble, aspect,
#endif
(void *) 0);
wnorm = OPEN_XFT("wide");
OPEN_XFT(wnorm, "wide");
if (wnorm != 0) {
if (wnorm.font != 0) {
wbold.pattern = XftPatternDuplicate(wnorm.pattern);
XftPatternBuild(pat,
WideXftPattern,
BoldXftPattern(wnorm),
(void *) 0);
wbold = OPEN_XFT("wide-bold");
OPEN_XFT(wbold, "wide-bold");
#if HAVE_ITALICS
if (FIND_ITALICS) {
wital.pattern = XftPatternDuplicate(wnorm.pattern);
XftPatternBuild(pat,
WideXftPattern,
ItalXftPattern(wnorm),
(void *) 0);
wital = OPEN_XFT("wide-italic");
OPEN_XFT(wital, "wide-italic");
}
#endif
#undef OPEN_XFT
......@@ -3032,16 +3090,16 @@ xtermComputeFontInfo(XtermWidget xw,
}
#endif /* OPT_RENDERWIDE */
}
if (norm == 0) {
if (norm.font == 0) {
TRACE(("...no TrueType font found for number %d, disable menu entry\n", fontnum));
xw->work.render_font = False;
update_font_renderfont();
/* now we will fall through into the bitmap fonts */
} else {
setBrokenBoxChars(xw, False);
setRenderFontsize(xw, win, norm, NULL);
setRenderFontsize(xw, win, bold, "bold");
setRenderFontsize(xw, win, ital, "ital");
setRenderFontsize(xw, win, norm.font, NULL);
setRenderFontsize(xw, win, bold.font, "bold");
setRenderFontsize(xw, win, ital.font, "ital");
#if OPT_BOX_CHARS
setupPackedFonts(xw);
......@@ -3173,7 +3231,7 @@ xtermMissingChar(unsigned ch, XTermFonts * font)
if (pc == 0 || CI_NONEXISTCHAR(pc)) {
TRACE2(("xtermMissingChar %#04x (!exists), %d cells\n",
ch, my_wcwidth((wchar_t) ch)));
ch, CharWidth(ch)));
result = True;
}
if (ch < KNOWN_MISSING) {
......@@ -3572,9 +3630,215 @@ xtermDrawBoxChar(XtermWidget xw,
#endif /* OPT_BOX_CHARS */
#if OPT_RENDERFONT
/*
* Check if the glyph is defined in the given font, and (try to) filter out
* cases where double-width glyphs are stuffed into a single-width outline.
*/
static Boolean
foundXftGlyph(XtermWidget xw, XftFont *font, unsigned wc)
{
TScreen *screen = TScreenOf(xw);
Boolean result = False;
if (XftGlyphExists(screen->display, font, wc)) {
int expect;
if ((expect = CharWidth(wc)) > 0) {
XGlyphInfo gi;
int actual;
XftTextExtents32(screen->display, font, &wc, 1, &gi);
/*
* Some (more than a few) fonts are sloppy; allow 10% outside
* the bounding box to accommodate them.
*/
actual = ((gi.xOff * 10) >= (11 * FontWidth(screen))) ? 2 : 1;
if (actual <= expect) {
/* allow double-cell if wcwidth agrees */
result = True;
} else {
TRACE(("SKIP U+%04X %d vs %d (%d vs %d)\n",
wc, gi.xOff, FontWidth(screen), actual, expect));
}
} else {
result = True;
}
}
return result;
}
XftFont *
findXftGlyph(XtermWidget xw, XftFont *given, unsigned wc)
{
TScreen *screen = TScreenOf(xw);
XTermXftFonts *which = 0;
XftFont *result = 0;
/* workaround for interface changes... */
int fontnum = screen->menu_font_number;
static int table[] =
{
offsetof(TScreen, renderFontNorm),
offsetof(TScreen, renderFontBold),
offsetof(TScreen, renderFontItal),
#if OPT_RENDERWIDE
offsetof(TScreen, renderWideNorm),
offsetof(TScreen, renderWideBold),
offsetof(TScreen, renderWideItal),
#endif
};
Cardinal n;
FcResult status;
const char *tag = 0;
/* ignore codes in private use areas */
if ((wc >= 0xe000 && wc <= 0xf8ff)
|| (wc >= 0xf0000 && wc <= 0xffffd)
|| (wc >= 0x100000 && wc <= 0x10fffd)) {
return 0;
}
/* the end of the BMP is reserved for non-characters */
if (wc >= 0xfff0 && wc <= 0xffff)
return 0;
for (n = 0; n < XtNumber(table); ++n) {
XTermXftFonts *check = (XTermXftFonts *) ((void *) ((char *) screen
+ table[n]));
if (check[fontnum].font == given) {
which = &check[fontnum];
tag = whichFontEnum(n);
break;
}
}
if (which != 0) {
if (which->fontset == 0) {
which->fontset = FcFontSort(0, which->pattern, 1, 0, &status);
}
if (which->fontset != 0) {
XftFont *check;
for (n = 0; n < XtNumber(which->cache); ++n) {
if ((check = which->cache[n].font) == 0) {
break;
}
if (foundXftGlyph(xw, check, wc)) {
result = check;
which->cache[n].usage = which->cache_used++;
TRACE_FALLBACK(xw, "old", wc, (int) n, result);
break;
}
}
if (result == 0) {
FcPattern *myPattern;
FcPattern *myReport = 0;
FcPattern *matchedFont;
FcFontSet *myFontSets[1];
FcCharSet *myCharSet;
myFontSets[0] = which->fontset;
myPattern = FcPatternDuplicate(which->pattern);
myCharSet = FcCharSetCreate();
FcCharSetAddChar(myCharSet, wc);
FcPatternAddCharSet(myPattern, FC_CHARSET, myCharSet);
FcPatternAddBool(myPattern, FC_SCALABLE, FcTrue);
FcPatternAddInteger(myPattern, FC_CHAR_WIDTH, given->max_advance_width);
FcConfigSubstitute(FcConfigGetCurrent(),
myPattern,
FcMatchPattern);
FcDefaultSubstitute(myPattern);
matchedFont = FcFontSetMatch(FcConfigGetCurrent(),
myFontSets,
XtNumber(myFontSets),
myPattern,
&status);
/*
* Close the least-recently-used entry.
*/
if (n >= XtNumber(which->cache)) {
Cardinal m;
unsigned long level = which->cache_used;
Cardinal unuse = --n;
TRACE(("FALLBACK overflow - reuse least-recently-used entry\n"));
for (m = 0; m < XtNumber(which->cache); ++m) {
if (level > which->cache[m].usage) {
level = which->cache[m].usage;
unuse = m;
}
}
TRACE(("...that is %d\n", unuse));
/* reset usage counts to avoid overflow */
if (level--) {
for (m = 0; m < XtNumber(which->cache); ++m) {
which->cache[m].usage -= level;
}
which->cache_used -= level;
}
n = unuse;
}
if (resource.reportFonts) {
myReport = FcPatternDuplicate(matchedFont);
}
check = XftFontOpenPattern(screen->display, matchedFont);
if (check != 0) {
Cardinal m;
Boolean giveup = False;
/*
* When Xft finishes scanning a pattern, it starts all over
* again without returning an error. This check for
* duplicates is a workaround for that issue.
*/
for (m = 0; m <= n; ++m) {
if (check == which->cache[n].font) {
giveup = True;
break;
}
}
if (giveup) {
TRACE(("found duplicate - stop\n"));
XftFontClose(screen->display, check);
} else if (foundXftGlyph(xw, check, wc)) {
if (resource.reportFonts) {
printf("Opened fallback font #%d for U+%04X, width=%d\n",
n + 1, wc, given->max_advance_width);
}
reportXftFonts(xw, check, "fallback", tag, myReport);
closeCachedXft(screen, which->cache[n].font);
(void) maybeXftCache(xw, check);
which->cache[n].font = check;
which->cache[n].usage = which->cache_used++;
result = check;
TRACE_FALLBACK(xw, "new", wc, (int) n, result);
} else {
if (resource.reportFonts) {
printf("Cannot find fallback font for U+%04X, width=%d\n",
wc, given->max_advance_width);
}
XftFontClose(screen->display, check);
}
}
if (resource.reportFonts) {
FcPatternDestroy(myReport);
}
FcPatternDestroy(myPattern);
FcCharSetDestroy(myCharSet);
}
}
}
return result;
}
/*
* Check if the given character has a glyph known to Xft.
* Check if the given character has a glyph known to Xft. If it is missing,
* try first to replace the font with a fallback that provides the glyph.
* If it is unable to provide a font containing the glyph, return true.
*
* see xc/lib/Xft/xftglyphs.c
*/
......
/* $XTermId: fontutils.h,v 1.124 2018/08/02 21:28:47 tom Exp $ */
/* $XTermId: fontutils.h,v 1.128 2018/11/29 00:03:41 tom Exp $ */
/*
* Copyright 1998-2017,2018 by Thomas E. Dickey
......@@ -147,7 +147,9 @@ extern void xtermSaveVTFonts (XtermWidget /* xw */);
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 *findXftGlyph (XtermWidget /* xw */, XftFont * /* given */, unsigned /* wc */);
extern XftFont *getXftFont (XtermWidget /* xw */, VTFontEnum /* which */, int /* fontnum */);
extern void closeCachedXft (TScreen * /* screen */, XftFont * /* font */);
extern void xtermCloseXft (TScreen * /* screen */, XTermXftFonts * /* pub */);
#endif
......
/* $XTermId: main.h,v 1.65 2018/04/30 00:59:01 tom Exp $ */
/* $XTermId: main.h,v 1.67 2018/11/25 13:55:05 tom Exp $ */
/*
* Copyright 2000-2016,2018 by Thomas E. Dickey
......@@ -92,7 +92,7 @@
#endif
#ifndef DEFFACESIZE
#define DEFFACESIZE "14.0"
#define DEFFACESIZE "8.0"
#endif
#ifndef DEF_ALLOW_COLOR
......@@ -201,6 +201,14 @@
#endif
#endif
#ifndef DEF_SAVE_LINES
#define DEF_SAVE_LINES 1024
#endif
#ifndef DEF_SCROLL_LINES
#define DEF_SCROLL_LINES 1
#endif
#ifndef DEF_TITLE_MODES
#define DEF_TITLE_MODES 0
#endif
......
/* $XTermId: misc.c,v 1.845 2018/08/25 00:54:35 tom Exp $ */
/* $XTermId: misc.c,v 1.849 2018/12/09 14:54:28 tom Exp $ */
/*
* Copyright 1999-2017,2018 by Thomas E. Dickey
......@@ -3165,12 +3165,20 @@ ManipulateSelectionData(XtermWidget xw, TScreen *screen, char *buf, int final)
}
} else {
if (AllowWindowOps(xw, ewSetSelection)) {
TRACE(("Setting selection with %s\n", buf));
char *old = buf;
TRACE(("Setting selection(%s) with %s\n", used, buf));
screen->selection_time =
XtLastTimestampProcessed(TScreenOf(xw)->display);
ClearSelectionBuffer(screen);
while (*buf != '\0')
AppendToSelectionBuffer(screen, CharOf(*buf++));
for (j = 0, buf = old; j < n; ++j) {
ClearSelectionBuffer(screen, select_args[j]);
while (*buf != '\0') {
AppendToSelectionBuffer(screen,
CharOf(*buf++),
select_args[j]);
}
}
CompleteSelection(xw, select_args, n);
}
free(select_args);
......@@ -5017,6 +5025,11 @@ do_dec_rqm(XtermWidget xw, int nparams, int *params)
result = MdBool(xw->keyboard.type == keyboardIsVT220);
break;
#endif
#if OPT_PASTE64 || OPT_READLINE
case srm_PASTE_IN_BRACKET:
result = MdBool(SCREEN_FLAG(screen, paste_brackets));
break;
#endif
#if OPT_READLINE
case srm_BUTTON1_MOVE_POINT:
result = MdBool(SCREEN_FLAG(screen, click1_moves));
......@@ -5027,9 +5040,6 @@ do_dec_rqm(XtermWidget xw, int nparams, int *params)
case srm_DBUTTON3_DELETE:
result = MdBool(SCREEN_FLAG(screen, dclick3_deletes));
break;
case srm_PASTE_IN_BRACKET:
result = MdBool(SCREEN_FLAG(screen, paste_brackets));
break;
case srm_PASTE_QUOTE:
result = MdBool(SCREEN_FLAG(screen, paste_quotes));
break;
......@@ -5144,8 +5154,8 @@ x_find_icon(char **work, int *state, const char *filename, const char *suffix)
*work = result;
}
*state += 1;
TRACE(("x_find_icon %d:%s\n", *state, result));
}
TRACE(("x_find_icon %d:%s ->%s\n", *state, filename, NonNull(result)));
return result;
}
......@@ -5231,21 +5241,31 @@ xtermLoadIcon(XtermWidget xw, const char *icon_hint)
Pixmap resIcon = 0;
Pixmap shapemask = 0;
XpmAttributes attributes;
struct stat sb;
attributes.depth = (unsigned) getVisualDepth(xw);
attributes.valuemask = XpmDepth;
if (XpmReadFileToPixmap(dpy,
if (IsEmpty(workname)
|| lstat(workname, &sb) != 0
|| !S_ISREG(sb.st_mode)) {
TRACE(("...failure (no such file)\n"));
} else {
int rc = XpmReadFileToPixmap(dpy,
DefaultRootWindow(dpy),
workname,
&resIcon,
&shapemask,
&attributes) == XpmSuccess) {
&attributes);
if (rc == XpmSuccess) {
myIcon = resIcon;
myMask = shapemask;
TRACE(("...success\n"));
ReportIcons(("found/loaded icon-file %s\n", workname));
break;
} else {
TRACE(("...failure (%s)\n", XpmGetErrorString(rc)));
}
}
}
}
......