]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.0 - patch 20180121
authorThomas E. Dickey <dickey@invisible-island.net>
Mon, 22 Jan 2018 01:39:40 +0000 (01:39 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Mon, 22 Jan 2018 01:39:40 +0000 (01:39 +0000)
> terminfo changes:
+ add xterm+noalt, xterm+titlestack, xterm+alt1049, xterm+alt+title
  blocks from xterm #331 -TD
+ add xterm+direct, xterm+indirect, xterm-direct entries from xterm
  #331 -TD
+ modify xterm+256color and xterm+256setaf to use correct number of
  color pairs, for ncurses 6.1 -TD
+ add rs1 capability to xterm-256color -TD
+ modify xterm-r5, xterm-r6 and xterm-xf86-v32 to use xterm+kbs to
  match xterm #272, reflecting packager's changes -TD
+ remove "boolean" Se, Ss from st-0.7 -TD
+ add konsole-direct and st-direct -TD
+ remove unsupported "Tc" capability from st-0.7; use st-direct if
  direct-colors are wanted -TD
+ add vte-direct -TD
+ add XT, hpa, indn, and vpa to screen, and invis, E3 to tmux (patch by
  Pierre Carru)
+ use xterm+sm+1006 in xterm-new, vte-2014 -TD
+ use xterm+x11mouse in iterm, iterm2, mlterm3 because xterm's 1006
  mode does not work with those programs.  konsole is debatable -TD
+ add "termite" entry (report by Markus Pfeiffer) -TD
> merge branch begun April 2, 2017 which provides these features:
+ support read/write new binary-format for terminfo which stores
  numeric capabilities as a signed 32-bit integer.  The test programs
  such as picsmap, ncurses were created or updated during 2017 to use
  this feature.
+ the new format is written by the wide-character configuration of
  tic when it finds a numeric capability larger than 32767.
+ other applications such as infocmp built with the wide-character
  ncurses library work as expected.
+ applications built with the "narrow" (8-bit) configuration will
  read the new format, but will limit those extended values to 32767.
+ in either wide/narrow configuration, the structure defined in
  term.h still uses signed 16-bit values.
+ because it is incompatible with the legacy (mid-1980s) binary format,
  a new magic value is provided for the "file" program.
+ the term.5 manual page is updated to describe this new format.
+ the limit on file-size for compiled terminfo is increased in the
  wide-character configuration to 32768.

17 files changed:
NEWS
VERSION
dist.mk
include/tic.h
man/term.5
misc/magic
misc/terminfo.src
ncurses/curses.priv.h
ncurses/tinfo/parse_entry.c
ncurses/tinfo/read_entry.c
ncurses/tinfo/write_entry.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec

diff --git a/NEWS b/NEWS
index 073422d0ccfd2266560d3ac8d45640ae7fa0657b..cc844f86e8447ac94c64f5fd2802332981202945 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3061 2018/01/16 09:15:38 tom Exp $
+-- $Id: NEWS,v 1.3065 2018/01/22 01:18:36 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,47 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20180121 pre-release
+       > terminfo changes:
+       + add xterm+noalt, xterm+titlestack, xterm+alt1049, xterm+alt+title
+         blocks from xterm #331 -TD
+       + add xterm+direct, xterm+indirect, xterm-direct entries from xterm
+         #331 -TD
+       + modify xterm+256color and xterm+256setaf to use correct number of
+         color pairs, for ncurses 6.1 -TD
+       + add rs1 capability to xterm-256color -TD
+       + modify xterm-r5, xterm-r6 and xterm-xf86-v32 to use xterm+kbs to
+         match xterm #272, reflecting packager's changes -TD
+       + remove "boolean" Se, Ss from st-0.7 -TD
+       + add konsole-direct and st-direct -TD
+       + remove unsupported "Tc" capability from st-0.7; use st-direct if
+         direct-colors are wanted -TD
+       + add vte-direct -TD
+       + add XT, hpa, indn, and vpa to screen, and invis, E3 to tmux (patch by
+         Pierre Carru)
+       + use xterm+sm+1006 in xterm-new, vte-2014 -TD
+       + use xterm+x11mouse in iterm, iterm2, mlterm3 because xterm's 1006
+         mode does not work with those programs.  konsole is debatable -TD
+       + add "termite" entry (report by Markus Pfeiffer) -TD
+       > merge branch begun April 2, 2017 which provides these features:
+       + support read/write new binary-format for terminfo which stores
+         numeric capabilities as a signed 32-bit integer.  The test programs
+         such as picsmap, ncurses were created or updated during 2017 to use
+         this feature.
+       + the new format is written by the wide-character configuration of
+         tic when it finds a numeric capability larger than 32767.
+       + other applications such as infocmp built with the wide-character
+         ncurses library work as expected.
+       + applications built with the "narrow" (8-bit) configuration will
+         read the new format, but will limit those extended values to 32767.
+       + in either wide/narrow configuration, the structure defined in
+         term.h still uses signed 16-bit values.
+       + because it is incompatible with the legacy (mid-1980s) binary format,
+         a new magic value is provided for the "file" program.
+       + the term.5 manual page is updated to describe this new format.
+       + the limit on file-size for compiled terminfo is increased in the
+         wide-character configuration to 32768.
+
 20180120
        + build-fix in picsmap.c for stdint.h existence.
        + add --disable-stripping option to configure scripts.
diff --git a/VERSION b/VERSION
index 54b7f0aa4388dadb32f1eca223ccddd5b8eae091..d1297e7d225ab16cf7b58aa09e5fbc144eabe8fb 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:9  6.0     20180120
+5:0:9  6.0     20180121
diff --git a/dist.mk b/dist.mk
index c74a21be37fa852aed9a418b3222914244d91d72..35191a663fea62a12a9febbb3759ab48d3585866 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1204 2018/01/16 01:53:47 tom Exp $
+# $Id: dist.mk,v 1.1205 2018/01/21 00:48:08 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 0
-NCURSES_PATCH = 20180120
+NCURSES_PATCH = 20180121
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index ec6cd43a1094669baf5fc8e4fb4b71efe3febcec..ec03f75a2ac58b94c3a45c12ceaf5140c9eb2d5c 100644 (file)
@@ -33,7 +33,7 @@
  ****************************************************************************/
 
 /*
- * $Id: tic.h,v 1.74 2017/07/22 16:25:10 tom Exp $
+ * $Id: tic.h,v 1.75 2017/07/29 23:21:06 tom Exp $
  *     tic.h - Global variables and structures for the terminfo compiler.
  */
 
@@ -49,7 +49,7 @@ extern "C" {
 #include <curses.h>    /* for the _tracef() prototype, ERR/OK, bool defs */
 
 /*
-** The format of compiled terminfo files is as follows:
+** The format of SVr2 compiled terminfo files is as follows:
 **
 **             Header (12 bytes), containing information given below
 **             Names Section, containing the names of the terminal
@@ -65,6 +65,11 @@ extern "C" {
 **             String Table, containing the actual characters of the string
 **                             capabilities.
 **
+** In the SVr2 format, "short" means signed 16-bit numbers, which is sometimes
+** inconvenient.  The numbers are signed, to provide for absent and canceled
+** values.  ncurses6.1 introduced an extension to this compiled format, by
+** making the Number Section a list of signed 32-bit integers.
+**
 **     NOTE that all short integers in the file are stored using VAX/PDP-style
 **     byte-order, i.e., least-significant byte first.
 **
@@ -77,6 +82,7 @@ extern "C" {
 */
 
 #define MAGIC          0432    /* first two bytes of a compiled entry */
+#define MAGIC2         01036   /* first two bytes of a compiled 32-bit entry */
 
 #undef  BYTE
 #define BYTE(p,n)      (unsigned char)((p)[n])
@@ -85,7 +91,7 @@ extern "C" {
 #define IS_NEG2(p)     ((BYTE(p,0) == 0376) && (BYTE(p,1) == 0377))
 #define LOW_MSB(p)     (BYTE(p,0) + 256*BYTE(p,1))
 
-#define IS_TIC_MAGIC(p)        (LOW_MSB(p) == MAGIC)
+#define IS_TIC_MAGIC(p)        (LOW_MSB(p) == MAGIC || LOW_MSB(p) == MAGIC2)
 
 #define quick_prefix(s) (!strncmp((s), "b64:", 4) || !strncmp((s), "hex:", 4))
 
@@ -94,7 +100,14 @@ extern "C" {
  * given implementation may exceed.
  */
 #define MAX_NAME_SIZE  512     /* maximum legal name field size (XSI:127) */
-#define MAX_ENTRY_SIZE 4096    /* maximum legal entry size */
+#define MAX_ENTRY_SIZE1        4096    /* maximum legal entry size (SVr2) */
+#define MAX_ENTRY_SIZE2        32768   /* maximum legal entry size (ncurses6.1) */
+
+#if NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR
+#define MAX_ENTRY_SIZE MAX_ENTRY_SIZE2
+#else
+#define MAX_ENTRY_SIZE MAX_ENTRY_SIZE1
+#endif
 
 /*
  * The maximum size of individual name or alias is guaranteed in XSI to be at
@@ -121,7 +134,8 @@ extern "C" {
 #define DEBUG_LEVEL(n) ((n) << TRACE_SHIFT)
 
 #define set_trace_level(n) \
-       _nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL), \
+       _nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL) \
+                    + DEBUG_LEVEL(MAX_DEBUG_LEVEL) - 1, \
        _nc_tracing |= DEBUG_LEVEL(n)
 
 #ifdef TRACE
index 571b9f556696b89c8ad2d9b324f406c1c0d2e862..d4519dffe1b86ac5fa7a6d887af0d53413b3175b 100644 (file)
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: term.5,v 1.26 2017/02/18 16:58:21 tom Exp $
+.\" $Id: term.5,v 1.27 2017/12/16 21:27:20 tom Exp $
 .TH term 5
 .ie \n(.g .ds `` \(lq
 .el       .ds `` ``
 .ie \n(.g .ds '' \(rq
 .el       .ds '' ''
+.de NS
+.ie n  .sp
+.el    .sp .5
+.ie n  .in +4
+.el    .in +2
+.nf
+.ft C                  \" Courier
+..
+.de NE
+.fi
+.ft R
+.in -4
+..
+.de bP
+.ie n  .IP \(bu 4
+.el    .IP \(bu 2
+..
 .ds n 5
 .ds d @TERMINFO@
 .SH NAME
@@ -72,7 +89,7 @@ ncurses distinguishes the two cases in the TERMINFO and TERMINFO_DIRS
 environment variable by assuming a directory tree for entries that
 correspond to an existing directory,
 and hashed database otherwise.
-.SS STORAGE FORMAT
+.SS LEGACY STORAGE FORMAT
 The format has been chosen so that it will be the same on all hardware.
 An 8 or more bit byte is assumed, but no assumptions about byte ordering
 or sign extension are made.
@@ -196,7 +213,27 @@ The extended string table contains values for string capabilities.
 After the end of these values, it contains the names for each of
 the extended capabilities in order, e.g., booleans, then numbers and
 finally strings.
+.PP
+Applications which manipulate terminal data can use the definitions
+described in \fBterm_variables\fP(3X) which associate the long capability
+names with members of a \fBTERMTYPE\fP structure.
 .
+.SS EXTENDED NUMBER FORMAT
+.PP
+On occasion, 16-bit signed integers are not large enough.
+With ncurses 6.1, a new format is introduced by making a few changes
+to the legacy format:
+.bP
+a different magic number (0542)
+.bP
+changing the type for the \fInumber\fP array from signed 16-bit integers
+to signed 32-bit integers.
+.PP
+To maintain compatibility, the library presents the same data structures
+to direct users of the \fBTERMTYPE\fP structure as in previous formats.
+However, that cannot provide callers with the extended numbers.
+The library uses a similar but hidden data structure \fBTERMTYPE2\fP
+to provide data for the terminfo functions.
 .SH PORTABILITY
 Note that it is possible for
 .B setupterm
@@ -224,18 +261,32 @@ diverged from System V terminfo after SVr1, and have added extension
 capabilities to the string table that (in the binary format) collide with
 System V and XSI Curses extensions.  See \fBterminfo\fR(\*n) for detailed
 discussion of terminfo source compatibility issues.
+.PP
+Direct access to the \fBTERMTYPE\fP structure is provided for legacy
+applications.
+Portable applications should use the \fBtigetflag\fP and related functions
+described in \fBcurs_terminfo\fP(3X) for reading terminal capabilities.
+.PP
+A small number of terminal descriptions use uppercase characters in
+their names.
+If the underlying filesystem ignores the difference between
+uppercase and lowercase,
+ncurses represents the \*(``first character\*('' of the terminal name used as
+the intermediate level of a directory tree in (two-character) hexadecimal form.
 .SH EXAMPLE
-As an example, here is a hex dump of the description for the Lear-Siegler
+As an example, here is a description for the Lear-Siegler
 ADM\-3, a popular though rather stupid early terminal:
-.nf
-.sp
+.NS
 adm3a|lsi adm3a,
         am,
         cols#80, lines#24,
         bel=^G, clear=\032$<1>, cr=^M, cub1=^H, cud1=^J,
         cuf1=^L, cup=\\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
         home=^^, ind=^J,
-.sp
+.NS
+.PP
+and a hexadecimal dump of the compiled terminal description:
+.NS
 .ft CW
 \s-20000  1a 01 10 00 02 00 03 00  82 00 31 00 61 64 6d 33  ........ ..1.adm3
 0010  61 7c 6c 73 69 20 61 64  6d 33 61 00 00 01 50 00  a|lsi ad m3a...P.
@@ -260,11 +311,16 @@ adm3a|lsi adm3a,
 0140  25 70 32 25 7b 33 32 7d  25 2b 25 63 00 0a 00 1e  %p2%{32} %+%c....
 0150  00 08 00 0c 00 0b 00 0a  00                       ........ .\s+2
 .ft R
-.fi
+.NE
 .sp
 .SH LIMITS
-Some limitations: total compiled entries cannot exceed 4096 bytes.
-The name field cannot exceed 128 bytes.
+Some limitations:
+.bP
+total compiled entries cannot exceed 4096 bytes in the legacy format.
+.bP
+total compiled entries cannot exceed 32768 bytes in the extended format.
+.bP
+the name field cannot exceed 128 bytes.
 .SH FILES
 \*d/*/*        compiled terminal capability data base
 .SH SEE ALSO
@@ -275,5 +331,9 @@ Thomas E. Dickey
 extended terminfo format for ncurses 5.0
 .br
 hashed database support for ncurses 5.6
+.br
+extended number support for ncurses 6.1
 .sp
 Eric S. Raymond
+.br
+documented legacy terminfo format, e.g., from pcurses.
index 7e20f436e7cf06db789dd1b59c71ecc57eff7234..d7c600e796ed21b9631a529356d2869d8121c1a5 100644 (file)
@@ -1,6 +1,6 @@
-# $Id: magic,v 1.1 2015/05/02 18:49:38 tom Exp $
+# $Id: magic,v 1.2 2018/01/05 01:42:08 tom Exp $
 ##############################################################################
-# Copyright (c) 2015 Free Software Foundation, Inc.                          #
+# Copyright (c) 2015-2017,2018 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# for reference, from file 5.22:
-0      string          \032\001        Compiled terminfo entry
-# ncurses-specific
-0       string          \210\210        Screen-dump (ncurses)
+# for reference, from file 5.30:
+#------------------------------------------------------------------------------
+# @File: terminfo,v 1.7 2016/03/17 21:02:29 christos Exp @
+# terminfo:  file(1) magic for terminfo
+#
+# URL: https://invisible-island.net/ncurses/man/term.5.html
+# URL: https://invisible-island.net/ncurses/man/scr_dump.5.html
+#
+# Workaround for Targa image type by Joerg Jenderek
+# GRR: line below too general as it catches also
+# Targa image type 1 with 26 long identification field
+# and HELP.DSK
+0      string          \032\001
+# 5th character of terminal name list, but not Targa image pixel size (15 16 24 32)
+>16    ubyte           >32
+# namelist, if more than 1 separated by "|" like "st|stterm| simpleterm 0.4.1"
+>>12   regex           \^[a-zA-Z0-9][a-zA-Z0-9.][^|]*  Compiled terminfo entry "%-s"
+!:mime application/x-terminfo
+# no extension
+#!:ext
+#
+#------------------------------------------------------------------------------
+# The following was added for ncurses6 development:
+#------------------------------------------------------------------------------
+#
+0      string          \036\002
+# imitate the legacy compiled-format, to get the entry-name printed
+>16    ubyte           >32
+# namelist, if more than 1 separated by "|" like "st|stterm| simpleterm 0.4.1"
+>>12   regex           \^[a-zA-Z0-9][a-zA-Z0-9.][^|]*  Compiled 32-bit terminfo entry "%-s"
+!:mime application/x-terminfo2
+#
+# While the compiled terminfo uses little-endian format irregardless of
+# platform, SystemV screen dumps do not.  They came later, and that detail was
+# overlooked.
+#
+# AIX and HPUX use the SVr4 big-endian format
+# Solaris uses the SVr3 formats (sparc and x86 differ endian-ness)
+0      beshort         0433            SVr2 curses screen image, big-endian
+0      beshort         0434            SVr3 curses screen image, big-endian
+0      beshort         0435            SVr4 curses screen image, big-endian
+#
+0      leshort         0433            SVr2 curses screen image, little-endian
+0      leshort         0434            SVr3 curses screen image, little-endian
+0      leshort         0435            SVr4 curses screen image, little-endian
+#
+# Rather than SVr4, Solaris "xcurses" writes this header:
+0      regex           \^MAX=[0-9]+,[0-9]+$
+>1     regex           \^BEG=[0-9]+,[0-9]+$
+>2     regex           \^SCROLL=[0-9]+,[0-9]+$
+>3     regex           \^VMIN=[0-9]+$
+>4     regex           \^VTIME=[0-9]+$
+>5     regex           \^FLAGS=0x[[:xdigit:]]+$
+>6     regex           \^FG=[0-9],[0-9]+$
+>7     regex           \^BG=[0-9]+,[0-9]+,     Solaris xcurses screen image
+#
+# ncurses5 (and before) did not use a magic number, making screen dumps "data".
+# ncurses6 (2015) uses this format, ignoring byte-order
+0      string  \210\210\210\210ncurses ncurses6 screen image
+#
+# PDCurses added this in 2005
+0      string          PDC\001         PDCurses screen image
index c2437c63c54523c30b97034408f277020b90d895..fd69ceb38e0987100be8a3ca9d4f5ae7f15a8686 100644 (file)
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #      bug-ncurses@gnu.org
 #
-#      $Revision: 1.644 $
-#      $Date: 2017/11/18 21:38:11 $
+#      $Revision: 1.650 $
+#      $Date: 2018/01/22 01:14:23 $
 #
 # The original header is preserved below for reference.  It is noted that there
 # is a "newer" version which differs in some cosmetic details (but actually
@@ -1413,7 +1413,7 @@ iTerm.app|iterm|iTerm.app terminal emulator for Mac OS X,
        tbc=\E[3g, tsl=\E]2;, u6=\E[%i%d;%dR, u7=\E[6n,
        u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd, TS=\E]2;,
        kEND5=\E[1;5F, kHOM5=\E[1;5H, use=vt100+keypad,
-       use=xterm+256setaf,
+       use=xterm+x11mouse, use=xterm+256setaf,
 
 # iTerm2 3.0.15
 #
@@ -1444,6 +1444,8 @@ iTerm.app|iterm|iTerm.app terminal emulator for Mac OS X,
 # Italic text did not work initially, apparently because upgrading did not
 # add/change that preference (set in Preferences, Profiles, Text).  A new
 # install of iTerm 3.0.15 provides italics by default (blinking text:no).
+#
+# 2018/01/21: found xterm+sm+1006 did not work with version 3.1.5
 iTerm2.app|iterm2|terminal emulator for Mac OS X,
        blink@, dim=\E[2m, kEND=\E[1;2F, kHOM=\E[1;2H, ka1@, ka3@,
        kb2@, kc1@, kc3@, kent@, kf13=\E[1;2P, kf14=\E[1;2Q,
@@ -1948,7 +1950,7 @@ kon|kon2|jfbterm|Kanji ON Linux console,
 # Not used here, the program recognizes escapes for italic, underline and
 # dim, rendering those as green, cyan and gray respectively.
 fbterm|FbTerm for Linux with framebuffer,
-       colors#0x100, pairs#0x7fff,
+       colors#0x100, pairs#0x10000,
        acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260i
             \316j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u
             \264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
@@ -3813,7 +3815,10 @@ crt|crt-vt220|CRT 2.3 emulating VT220,
 #
 # Several features such as backspace/delete are optional; this entry documents
 # the default behavior -TD
-
+#
+# PuTTY recognizes xterm's 1049 mode for switching to/from alternate screen,
+# but implements it incorrectly as mentioned here:
+#      http://stackoverflow.com/questions/24613237/terminal-retains-bg-color-after-closing-vim-using-color-scheme-and-putty-256co/37869114#37869114
 putty|PuTTY terminal emulator,
        am, bce, bw, ccc, mir, msgr, xenl, xon, XT,
        colors#8, it#8, ncv#22, pairs#64, U8#1,
@@ -4135,21 +4140,20 @@ xterm-r5|xterm R5 version,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
        el=\E[K, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@,
-       il=\E[%p1%dL, il1=\E[L, ind=\n, kbs=^H, kcub1=\EOD,
-       kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~,
-       kdl1=\E[31~, kel=\E[8~, kend=\E[4~, kf0=\EOq, kf1=\E[11~,
-       kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf2=\E[12~,
-       kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~,
-       kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~,
-       kil1=\E[30~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, rc=\E8,
-       rev=\E[7m, ri=\EM, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[m,
-       rmul=\E[m,
+       il=\E[%p1%dL, il1=\E[L, ind=\n, kcub1=\EOD, kcud1=\EOB,
+       kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, kdl1=\E[31~,
+       kel=\E[8~, kend=\E[4~, kf0=\EOq, kf1=\E[11~, kf10=\E[21~,
+       kf11=\E[23~, kf12=\E[24~, kf2=\E[12~, kf3=\E[13~,
+       kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
+       kf9=\E[20~, khome=\E[1~, kich1=\E[2~, kil1=\E[30~,
+       kmous=\E[M, knp=\E[6~, kpp=\E[5~, rc=\E8, rev=\E[7m, ri=\EM,
+       rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m,
        rs2=\E>\E[?1;3;4;5;6l\E[4l\E[?7h\E[m\E[r\E[2J\E[H,
        sc=\E7,
        sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1
            %;m,
        sgr0=\E[m, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m,
-       smul=\E[4m, tbc=\E[3g, use=vt100+enq,
+       smul=\E[4m, tbc=\E[3g, use=vt100+enq, use=xterm+kbs,
 # Compatible with the R6 xterm
 # (from XFree86 3.2 distribution, <acsc> and <it> added, <blink@> removed)
 # added khome/kend, hts based on the R6 xterm code - TD
@@ -4166,7 +4170,7 @@ xterm-r6|xterm X11R6 version,
        dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
        el=\E[K, enacs=\E)0, home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL,
        il1=\E[L, ind=\n,
-       is2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, kbs=^H,
+       is2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8,
        kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
        kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~,
        kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~,
@@ -4180,7 +4184,7 @@ xterm-r6|xterm X11R6 version,
        rs2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, sc=\E7,
        sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h,
        smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m, tbc=\E[3g,
-       use=vt100+enq,
+       use=xterm+kbs, use=vt100+enq,
 xterm-old|antique xterm version,
        use=xterm-r6,
 # This is the base xterm entry for the xterm supplied with XFree86 3.2 & up.
@@ -4200,18 +4204,18 @@ xterm-xf86-v32|xterm terminal emulator (XFree86 3.2 Window System),
        ht=^I, hts=\EH, ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL,
        il1=\E[L, ind=\n,
        is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>,
-       kbeg=\EOE, kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC,
-       kcuu1=\EOA, kdch1=^?, kend=\EOF, kf1=\E[11~, kf10=\E[21~,
-       kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
-       kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
-       kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf3=\E[13~,
-       kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
-       kf9=\E[20~, kfnd=\E[1~, khome=\EOH, kich1=\E[2~,
-       kmous=\E[M, knp=\E[6~, kpp=\E[5~, kslt=\E[4~, meml=\El,
-       memu=\Em, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmam=\E[?7l,
-       rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>,
-       rmso=\E[27m, rmul=\E[24m, rs1=^O,
-       rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7,
+       kbeg=\EOE, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+       kdch1=^?, kend=\EOF, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~,
+       kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~,
+       kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~,
+       kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~,
+       kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+       kfnd=\E[1~, khome=\EOH, kich1=\E[2~, kmous=\E[M, knp=\E[6~,
+       kpp=\E[5~, kslt=\E[4~, meml=\El, memu=\Em, rc=\E8, rev=\E[7m,
+       ri=\EM, rmacs=^O, rmam=\E[?7l, rmcup=\E[2J\E[?47l\E8,
+       rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m,
+       rs1=^O, rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>,
+       sc=\E7,
        setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}
             %=%t3%e%p1%d%;m,
        setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}
@@ -4220,7 +4224,7 @@ xterm-xf86-v32|xterm terminal emulator (XFree86 3.2 Window System),
            %;m%?%p9%t\016%e\017%;,
        sgr0=\E[m\017, smacs=^N, smam=\E[?7h, smcup=\E7\E[?47h,
        smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
-       tbc=\E[3g, vpa=\E[%i%p1%dd, use=vt100+enq,
+       tbc=\E[3g, vpa=\E[%i%p1%dd, use=xterm+kbs, use=vt100+enq,
        use=ecma+color, use=vt220+keypad,
 
 # This is the stock xterm entry supplied with XFree86 3.3, which uses VT100
@@ -4284,8 +4288,8 @@ xterm-xfree86|xterm terminal emulator (XFree86),
 xterm-new|modern xterm terminal emulator,
        npc,
        indn=\E[%p1%dS, kb2=\EOE, kcbt=\E[Z, kent=\EOM,
-       rin=\E[%p1%dT, use=ansi+rep, use=ansi+enq,
-       use=xterm+pcfkeys, use=xterm+tmux, use=ecma+strikeout,
+       rin=\E[%p1%dT, use=ansi+rep, use=ecma+strikeout,
+       use=xterm+sm+1006, use=xterm+pcfkeys, use=xterm+tmux,
        use=xterm-basic,
 
 # This fragment is for people who cannot agree on what the backspace key
@@ -4442,6 +4446,19 @@ xterm+pc+edit|fragment for pc-style editing keypad,
 xterm+vt+edit|fragment for vt220-style editing keypad,
        kfnd=\E[1~, kslt=\E[4~,
 
+# These variations for alternate-screen and title-stacking were introduced by
+# xterm patch #331:
+xterm+noalt|xterm without altscreen,
+       rmcup@, smcup@,
+
+xterm+alt1049|xterm 90 feature,
+       rmcup=\E[?1049l, smcup=\E[?1049h,
+
+xterm+titlestack|xterm 251 feature,
+       rmcup=\E[23;0;0t, smcup=\E[22;0;0t,
+
+xterm+alt+title|xterm 90 and 251 features combined,
+       rmcup=\E[?1049l\E[23;0;0t, smcup=\E[?1049h\E[22;0;0t,
 #
 # Those chunks use the new-style (the xterm oldFunctionKeys resource is false).
 # Alternatively, the same scheme with old-style function keys as in xterm-r6
@@ -4472,21 +4489,21 @@ xterm-basic|modern xterm terminal emulator - common,
        il=\E[%p1%dL, il1=\E[L, ind=\n, invis=\E[8m,
        is2=\E[!p\E[?3;4l\E[4l\E>, kmous=\E[M, meml=\El,
        memu=\Em, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM,
-       rmacs=\E(B, rmam=\E[?7l, rmcup=\E[?1049l, rmir=\E[4l,
-       rmkx=\E[?1l\E>, rmm=\E[?1034l, rmso=\E[27m, rmul=\E[24m,
-       rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7,
-       setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
+       rmacs=\E(B, rmam=\E[?7l, rmir=\E[4l, rmkx=\E[?1l\E>,
+       rmm=\E[?1034l, rmso=\E[27m, rmul=\E[24m, rs1=\Ec,
+       rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7, setab=\E[4%p1%dm,
+       setaf=\E[3%p1%dm,
        setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}
             %=%t3%e%p1%d%;m,
        setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}
             %=%t3%e%p1%d%;m,
        sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;
            %?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
-       sgr0=\E(B\E[m, smacs=\E(0, smam=\E[?7h, smcup=\E[?1049h,
-       smir=\E[4h, smkx=\E[?1h\E=, smm=\E[?1034h, smso=\E[7m,
-       smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd, E3=\E[3J,
-       use=ecma+italics, use=ansi+pp, use=xterm+kbs,
-       use=vt100+enq,
+       sgr0=\E(B\E[m, smacs=\E(0, smam=\E[?7h, smir=\E[4h,
+       smkx=\E[?1h\E=, smm=\E[?1034h, smso=\E[7m, smul=\E[4m,
+       tbc=\E[3g, vpa=\E[%i%p1%dd, E3=\E[3J, use=ecma+italics,
+       use=ansi+pp, use=xterm+kbs, use=xterm+alt+title,
+       use=ansi+enq,
 
 # From: David J. MacKenzie <djm@va.pubnix.com>, 14 Nov 1997
 # In retrospect, something like xterm-r6 was intended here -TD
@@ -4509,7 +4526,7 @@ xterm-16color|xterm with 16 colors like aixterm,
 # xterm patch #111 (1999/7/10) -TD
 xterm+256color|xterm 256-color feature,
        ccc,
-       colors#0x100, pairs#0x7fff,
+       colors#0x100, pairs#0x10000,
        initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*
              %{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
        oc=\E]104\007,
@@ -4522,7 +4539,7 @@ xterm+256color|xterm 256-color feature,
 # palette is hardcoded...
 xterm+256setaf|xterm 256-color (set-only),
        ccc@,
-       colors#0x100, pairs#0x7fff,
+       colors#0x100, pairs#0x10000,
        initc@, op=\E[39;49m,
        setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;
              5;%p1%d%;m,
@@ -4556,6 +4573,61 @@ xterm-88color|xterm with 88 colors,
        rs1=\Ec\E]104\007, use=xterm+88color,
        use=xterm-256color,
 
+# Emacs 26.1 and later support direct color mode in terminals, using a
+# combination of user-defined capabilities and ncurses-dependent function
+# calls.  We will not include that here.  
+#
+# Here is a first revision, which (disregarding the reuse of colors 1-7 which
+# is of interest only to the numerically illiterate), is compatible with other
+# terminal descriptions written for curses.  It relies upon the extended range
+# for numeric capabilities provided in ncurses 6.1:
+xterm+direct2|xterm with direct-color indexing,
+       RGB,
+       colors#0x1000000, pairs#0x10000,
+       initc@, op=\E[39;49m,
+       setab=\E[%?%p1%{8}%<%t4%p1%d%e48\:2\:%p1%{65536}%/%d\:%p1
+             %{256}%/%{255}%&%d\:%p1%{255}%&%d%;m,
+       setaf=\E[%?%p1%{8}%<%t3%p1%d%e38\:2\:%p1%{65536}%/%d\:%p1
+             %{256}%/%{255}%&%d\:%p1%{255}%&%d%;m,
+       setb@, setf@,
+xterm-direct2|xterm with direct-color indexing (old),
+       use=xterm+direct2, use=xterm+titlestack, use=xterm,
+
+# That in turn had a problem: in the original patch submitted for KDE konsole
+# in 2006, the submitter and the developer alike overlooked a "color space
+# identifier" parameter.  This version provides for that parameter:
+xterm+direct|xterm with direct-color indexing,
+       RGB,
+       colors#0x1000000, pairs#0x10000,
+       initc@, op=\E[39;49m,
+       setab=\E[%?%p1%{8}%<%t4%p1%d%e48\:2\:\:%p1%{65536}%/%d\:%p1
+             %{256}%/%{255}%&%d\:%p1%{255}%&%d%;m,
+       setaf=\E[%?%p1%{8}%<%t3%p1%d%e38\:2\:\:%p1%{65536}%/%d\:%p1
+             %{256}%/%{255}%&%d\:%p1%{255}%&%d%;m,
+       setb@, setf@,
+xterm-direct|xterm with direct-color indexing,
+       use=xterm+direct, use=xterm,
+
+# Meanwhile, in KDE #107487, the patch submitter and the developer both saw
+# that xterm's original implementation should have used colons for the
+# subparameter separators, but chose not to correct this in konsole.  As of
+# late 2017, konsole still accepts only the nonstandard semicolon delimiters.
+xterm+indirect|xterm with direct-color indexing (old),
+       RGB,
+       colors#0x1000000, pairs#0x10000,
+       initc@, op=\E[39;49m,
+       setab=\E[%?%p1%{8}%<%t4%p1%d%e48;2;%p1%{65536}%/%d;%p1%{256}
+             %/%{255}%&%d;%p1%{255}%&%d%;m,
+       setaf=\E[%?%p1%{8}%<%t3%p1%d%e38;2;%p1%{65536}%/%d;%p1%{256}
+             %/%{255}%&%d;%p1%{255}%&%d%;m,
+       setb@, setf@,
+konsole-direct|konsole with direct-color indexing,
+       use=xterm+indirect, use=konsole,
+st-direct|st with direct-color indexing,
+       use=xterm+indirect, use=st,
+vte-direct|vte with direct-color indexing,
+       use=xterm+direct, use=vte,
+
 # This chunk is based on suggestions by Ailin Nemui and Nicholas Marriott, who
 # asked for some of xterm's advanced features to be added to its terminfo
 # entry.  It defines extended capabilities not found in standard terminfo or
@@ -4630,8 +4702,8 @@ xterm-8bit|xterm terminal emulator 8-bit controls (X Window System),
        sgr0=\2330m\E(B, smacs=\E(0, smam=\233?7h,
        smcup=\233?1049h, smir=\2334h, smkx=\233?1h\E=,
        smso=\2337m, smul=\2334m, tbc=\2333g, u6=\233[%i%d;%dR,
-       u7=\E[6n, u8=\233[?1;2c, u9=\E[c, vpa=\233%i%p1%dd,
-       use=xterm+kbs,
+       u7=\E[6n, u8=\233[?%[;0123456789]c, u9=\E[c,
+       vpa=\233%i%p1%dd, use=xterm+kbs,
 
 xterm-hp|xterm with hpterm function keys,
        kclr=\EJ, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA,
@@ -5178,7 +5250,7 @@ vte-2014|VTE 0.35.1,
        ncv@,
        cbt=\E[Z, el1=\E[1K, flash=\E[?5h$<100/>\E[?5l,
        ich=\E[%p1%d@, indn=\E[%p1%dS, kent=\EOM, rin=\E[%p1%dT,
-       use=xterm+pcfkeys, use=vte-2012,
+       use=xterm+sm+1006, use=xterm+pcfkeys, use=vte-2012,
 
 vte|VTE aka GNOME Terminal,
        use=vte-2014,
@@ -5197,6 +5269,52 @@ gnome-256color|GNOME Terminal with xterm 256-colors,
 xfce|Xfce Terminal,
        use=vte-2008,
 
+# TERMITE
+#
+# https://github.com/thestinger/termite
+#
+# A review requires install of Arch Linux since Fedora and Debian don't have
+# this program.  It uses "vte3-ng" (a conflicting package), which is here:
+#      https://github.com/thestinger/vte-ng
+# which (based on the default branch setting) seems to be a fork of vte
+# 0.48.2, and is noted as such in Arch:
+#      https://www.archlinux.org/packages/community/x86_64/vte3-ng/
+# It won't be merged:
+#      https://bugzilla.gnome.org/show_bug.cgi?id=679658#c10
+#      https://bugzilla.gnome.org/show_bug.cgi?id=78291
+# but perhaps made obsolete.
+#
+# The entry as given was mislabeled "xterm-termite" (it is not xterm), and
+# was mostly cut/paste from xterm-256color, but since VTE does not actually
+# implement several of the features in that terminal description, this one is
+# trimmed to eliminate those.  Also, since it is a slightly older version of
+# VTE, it lacks a few more features (again, trimmed).
+termite|VTE-based terminal,
+       am, ccc, km, mir, msgr, npc, xenl,
+       cols#80, it#8, lines#24, ncv@,
+       acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxy
+            yzz{{||}}~~,
+       bel=^G, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
+       clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=\r,
+       csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+       cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
+       cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+       dch=\E[%p1%dP, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K,
+       flash=\E[?5h$<100/>\E[?5l, home=\E[H, hpa=\E[%i%p1%dG,
+       ht=^I, hts=\EH, ind=\n, indn=\E[%p1%dS, invis=\E[8m,
+       is2=\E[!p\E[?3;4l\E[4l\E>, kb2=\EOE, kbs=^?, kcbt=\E[Z,
+       kent=\EOM, kmous=\E[M, rc=\E8, rev=\E[7m, ri=\EM,
+       rin=\E[%p1%dT, ritm=\E[23m, rmacs=\E(B, rmam=\E[?7l,
+       rmcup=\E[?1049l, rmkx=\E[?1l\E>, rmso=\E[27m,
+       rmul=\E[24m, rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7,
+       sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|
+           %t;7%;%?%p7%t;8%;m,
+       sgr0=\E(B\E[m, sitm=\E[3m, smacs=\E(0, smam=\E[?7h,
+       smcup=\E[?1049h, smkx=\E[?1h\E=, smso=\E[7m, smul=\E[4m,
+       tbc=\E[3g, vpa=\E[%i%p1%dd, use=ansi+idc, use=ansi+idl,
+       use=ansi+enq, use=xterm+256color, use=ecma+color,
+       use=xterm+pcfkeys, use=xterm+sl-twm,
+
 #### Other GNOME
 # Multi-Gnome-Terminal 1.6.2
 #
@@ -5314,11 +5432,13 @@ mlterm|multi lingual terminal emulator,
 
 # Tested mlterm 3.2.2:
 # mlterm 3.x has made changes, but they are not reflected in the included
-# mlterm.ti; this entry is based on testing with tack and vttest -TD
+# mlterm.ti; this entry is based on testing with ncurses, tack and vttest -TD
+# 2018/01/21: found xterm+sm+1006 did not work with version 3.3.8
 mlterm3|multi lingual terminal emulator,
        kf1=\E[11~, kf2=\E[12~, kf3=\E[13~, kf4=\E[14~,
        use=ecma+italics, use=xterm+app, use=xterm+pcf0,
-       use=xterm+pcc2, use=xterm+pce2, use=mlterm2,
+       use=xterm+pcc2, use=xterm+pce2, use=xterm+x11mouse,
+       use=mlterm2,
 
 # This is mlterm 2.9.3's mlterm.ti, with some additions/corrections -TD
 #
@@ -5676,7 +5796,7 @@ aterm|AfterStep terminal,
 # xiterm  0.5-5.2
 # This is not based on xterm's source...
 # vttest shows several problems with keyboard, cursor-movements.
-# see also http://invisible-island.net/xterm/xterm.faq.html#bug_xiterm
+# see also https://invisible-island.net/xterm/xterm.faq.html#bug_xiterm
 xiterm|internationalized terminal emulator for X,
        km@,
        kbs=^?, kdch1=\E[3~, use=klone+color, use=xterm-r6,
@@ -5957,7 +6077,7 @@ st|stterm| simpleterm,
 #      has control cursor-keys, alt cursor-keys, still no combinations
 #      has control pageup/down
 st-0.7|simpleterm 0.7,
-       ccc, Se, Ss,
+       ccc,
        dim=\E[2m,
        initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*
              %{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
@@ -6003,7 +6123,7 @@ st-0.7|simpleterm 0.7,
 # still has no function keys past kf36 (no combinations of modifiers)
 # no application keypad mode, e.g, kent.
 st-0.6|simpleterm 0.6,
-       am, bce, hs, mir, msgr, npc, xenl, Tc, XT,
+       am, bce, hs, mir, msgr, npc, xenl, XT,
        colors#8, cols#80, it#8, lines#24, pairs#64,
        acsc=+C\,D-A.B0E``aaffgghFiGjjkkllmmnnooppqqrrssttuuvvwwxxyy
             zz{{||}}~~,
@@ -6150,7 +6270,7 @@ st-256color|stterm-256color|simpleterm with 256 colors,
 # e) removed km
 terminator|Terminator no line wrap,
        eo, mir, msgr, xenl, xon,
-       colors#0x100, cols#80, it#8, lines#24, lm#0, pairs#0x7fff,
+       colors#0x100, cols#80, it#8, lines#24, lm#0, pairs#0x10000,
        acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bold=\E[1m, civis=\E[?25l, clear=\E[H\E[2J,
        cnorm=\E[?25h, cr=\r, csr=\E[%i%p1%d;%p2%dr,
@@ -6423,7 +6543,7 @@ dumb-emacs-ansi|Emacs dumb terminal with ANSI color codes,
 # sgr are not impacted (because that usually resets all capabilities before
 # setting any), but termcap applications do not use sgr -TD
 screen|VT 100/ANSI X3.64 virtual terminal,
-       OTbs, OTpt, am, km, mir, msgr, xenl, G0,
+       OTbs, OTpt, am, km, mir, msgr, xenl, G0, XT,
        colors#8, cols#80, it#8, lines#24, ncv@, pairs#64, U8#1,
        acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxy
             yzz{{||}}~~,
@@ -6434,10 +6554,11 @@ screen|VT 100/ANSI X3.64 virtual terminal,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM,
        cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
        dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
-       enacs=\E(B\E)0, flash=\Eg, home=\E[H, ht=^I, hts=\EH,
-       ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=\n, is2=\E)0,
-       kbs=^H, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC,
-       kcuu1=\EOA, kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~,
+       enacs=\E(B\E)0, flash=\Eg, home=\E[H, hpa=\E[%i%p1%dG,
+       ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L,
+       ind=\n, indn=\E[%p1%dS, is2=\E)0, kbs=^H, kcbt=\E[Z,
+       kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+       kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~,
        kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS,
        kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
        khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
@@ -6447,8 +6568,8 @@ screen|VT 100/ANSI X3.64 virtual terminal,
        sgr=\E[0%?%p6%t;1%;%?%p1%t;3%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;
            5%;%?%p5%t;2%;m%?%p9%t\016%e\017%;,
        sgr0=\E[m\017, smacs=^N, smcup=\E[?1049h, smir=\E[4h,
-       smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g, E0=\E(B,
-       S0=\E(%p1%c, use=ecma+color,
+       smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g,
+       vpa=\E[%i%p1%dd, E0=\E(B, S0=\E(%p1%c, use=ecma+color,
 # The bce and status-line entries are from screen 3.9.13 (and require some
 # changes to .screenrc).
 screen-bce|VT 100/ANSI X3.64 virtual terminal with bce,
@@ -6552,7 +6673,8 @@ screen.xterm-xfree86|screen.xterm-new|screen customized for modern xterm,
        invis@, kIC@, kNXT@, kPRV@, meml@, memu@, rep@,
        sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|
            %t;7%;%?%p4%t;5%;%?%p5%t;2%;m,
-       E3@, use=screen+italics, use=screen+fkeys, use=xterm-new,
+       E3@, use=screen+italics, use=screen+fkeys,
+       use=xterm+x11mouse, use=xterm-new,
 #:screen.xterm|screen for modern xterm,
 #:     use=screen.xterm-new,
 # xterm-r6 does not really support khome/kend unless it is propped up by
@@ -6665,13 +6787,13 @@ screen3|older VT 100/ANSI X3.64 virtual terminal,
 # tmux is compatible with screen, but has support for italics, and some of the
 # xterm cursor bits.
 tmux|tmux terminal multiplexer,
-       rmso=\E[27m,
+       invis=\E[8m, rmso=\E[27m,
        sgr=\E[0%?%p6%t;1%;%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;
            \s\s\s\s\s\s\s\s\s\s\s\s5%;%?%p5%t;2%;m%?%p9%t\016%e
            \017%;,
-       smso=\E[7m, use=ecma+italics, use=ecma+strikeout,
-       use=xterm+edit, use=xterm+pcfkeys, use=xterm+sl,
-       use=xterm+tmux, use=screen,
+       smso=\E[7m, E3=\E[3J, use=ecma+italics,
+       use=ecma+strikeout, use=xterm+edit, use=xterm+pcfkeys,
+       use=xterm+sl, use=xterm+tmux, use=screen,
 
 tmux-256color|tmux with 256 colors,
        use=xterm+256setaf, use=tmux,
@@ -6738,7 +6860,7 @@ dvtm|dynamic virtual terminal manager,
        use=ecma+italics,
 
 dvtm-256color|dynamic virtual terminal manager with 256 colors,
-       colors#0x100, pairs#0x7fff,
+       colors#0x100, pairs#0x10000,
        setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;
              5;%p1%d%;m,
        setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5
@@ -25337,4 +25459,32 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 #        dm80, hpterm, emu-220, hp2, iTerm2.app, mterm-ansi, ncrvt100an,
 #        st-0.7, vi603, vwmterm -TD
 #
+# 2017-12-30
+#      + add xterm+noalt, xterm+titlestack, xterm+alt1049, xterm+alt+title
+#        blocks from xterm #331 -TD
+#      + add xterm+direct, xterm+indirect, xterm-direct entries from xterm
+#        #331 -TD
+#      + modify xterm+256color and xterm+256setaf to use correct number of
+#        color pairs, for ncurses 6.1 -TD
+#      + add rs1 capability to xterm-256color -TD
+#      + modify xterm-r5, xterm-r6 and xterm-xf86-v32 to use xterm+kbs to
+#        match xterm #272, reflecting packager's changes -TD
+#      + remove "boolean" Se, Ss from st-0.7 -TD
+#
+# 2017-01-04
+#      + add konsole-direct and st-direct -TD
+#      + remove unsupported "Tc" capability from st-0.7; use st-direct if
+#        direct-colors are wanted -TD
+#
+# 2017-01-17
+#      + add vte-direct -TD
+#      + add XT, hpa, indn, and vpa to screen, and invis, E3 to tmux (patch by
+#        Pierre Carru)
+#
+# 2017-01-21
+#      + use xterm+sm+1006 in xterm-new, vte-2014 -TD
+#      + use xterm+x11mouse in iterm, iterm2, mlterm3 because xterm's 1006
+#        mode does not work with those programs.  konsole is debatable -TD
+#      + add "termite" entry (report by Markus Pfeiffer) -TD
+#
 ######## SHANTIH!  SHANTIH!  SHANTIH!
index 01866cc5a8c3ef34f6ba5e25b58c54367c05a5f3..7dc49e03a7011cf0145839323830a78c40b749bd 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.585 2017/09/20 00:34:16 tom Exp $
+ * $Id: curses.priv.h,v 1.587 2018/01/21 02:13:41 tom Exp $
  *
  *     curses.priv.h
  *
@@ -396,13 +396,17 @@ typedef union {
 #if NCURSES_EXT_COLORS && HAVE_INIT_EXTENDED_COLOR
 #define NCURSES_EXT_NUMBERS  1
 #define NCURSES_INT2         int
+#define SIZEOF_INT2          4
 #define TerminalType(tp)     (tp)->type2
 #else
 #define NCURSES_EXT_NUMBERS  0
 #define NCURSES_INT2         short
+#define SIZEOF_INT2          2
 #define TerminalType(tp)     (tp)->type
 #endif
 
+#define SIZEOF_SHORT         2
+
 #ifdef CUR
 #undef CUR
 #define CUR TerminalType(cur_term).
@@ -1742,7 +1746,7 @@ typedef void VoidFunc(void);
 #define returnVoidPtr(code)    TRACE_RETURN1(code,void_ptr)
 #define returnWin(code)                TRACE_RETURN1(code,win)
 
-#define returnDB(code)         do { TR(TRACE_DATABASE,(T_RETURN("code %d"), (code))); return (code); } while (0)
+#define returnDB(rc)           do { TR(TRACE_DATABASE,(T_RETURN("code %d"), (rc))); return (rc); } while (0)
 
 extern NCURSES_EXPORT(NCURSES_BOOL)     _nc_retrace_bool (int);
 extern NCURSES_EXPORT(NCURSES_CONST void *) _nc_retrace_cvoid_ptr (NCURSES_CONST void *);
index bbbfcb270ac424e7f697a79d85c887ee9fc05ece..2b54f45d6d49911e5a03838057089c4c078dc689 100644 (file)
@@ -47,7 +47,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: parse_entry.c,v 1.91 2017/08/26 16:13:34 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.92 2017/08/26 19:49:50 tom Exp $")
 
 #ifdef LINT
 static short const parametrized[] =
@@ -217,7 +217,7 @@ valid_entryname(const char *name)
        { bad_tc_usage = TRUE; \
         _nc_warning("Legacy termcap allows only a trailing tc= clause"); }
 
-#define MAX_NUMBER 0x7fff      /* positive shorts only */
+#define MAX_NUMBER MAX_OF_TYPE(NCURSES_INT2)
 
 NCURSES_EXPORT(int)
 _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
@@ -493,7 +493,7 @@ _nc_parse_entry(ENTRY * entryp, int literal, bool silent)
                    entryp->tterm.Numbers[entry_ptr->nte_index] = MAX_NUMBER;
                } else {
                    entryp->tterm.Numbers[entry_ptr->nte_index] =
-                       (short) _nc_curr_token.tk_valnumber;
+                       (NCURSES_INT2) _nc_curr_token.tk_valnumber;
                }
                break;
 
index 3cb0241095dd622e117b6fd5ec6d9a7031fef4d2..92b532636b03fe0869b58451b0b31ca8f16f859d 100644 (file)
 
 #include <tic.h>
 
-MODULE_ID("$Id: read_entry.c,v 1.143 2017/04/06 22:19:06 tom Exp $")
+MODULE_ID("$Id: read_entry.c,v 1.144 2017/10/23 21:20:06 tom Exp $")
 
 #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts))
 
 #define MyNumber(n) (short) LOW_MSB(n)
 
+#define SIZEOF_32BITS 4
+
 #if NCURSES_USE_DATABASE
-static void
-convert_numbers(char *buf, NCURSES_INT2 *Numbers, int count)
+#if NCURSES_EXT_NUMBERS
+static size_t
+convert_16bits(char *buf, NCURSES_INT2 *Numbers, int count)
+{
+    int i;
+    size_t j;
+    size_t size = SIZEOF_SHORT;
+    unsigned char ch;
+    for (i = 0; i < count; i++) {
+       unsigned mask = 0xff;
+       Numbers[i] = 0;
+       for (j = 0; j < size; ++j) {
+           ch = UChar(*buf++);
+           Numbers[i] |= (ch << (8 * j));
+           mask <<= 8;
+       }
+       if (ch & 0x80) {
+           while (mask != 0) {
+               Numbers[i] |= (int) mask;
+               mask <<= 8;
+           }
+       }
+       TR(TRACE_DATABASE, ("get Numbers[%d]=%d", i, Numbers[i]));
+    }
+    return size;
+}
+
+static size_t
+convert_32bits(char *buf, NCURSES_INT2 *Numbers, int count)
+{
+    int i;
+    size_t j;
+    size_t size = SIZEOF_INT2;
+    unsigned char ch;
+
+    assert(sizeof(NCURSES_INT2) == size);
+    for (i = 0; i < count; i++) {
+       Numbers[i] = 0;
+       for (j = 0; j < size; ++j) {
+           ch = UChar(*buf++);
+           Numbers[i] |= (ch << (8 * j));
+       }
+       /* "unsigned" and NCURSES_INT2 are the same size - no sign-extension */
+       TR(TRACE_DATABASE, ("get Numbers[%d]=%d", i, Numbers[i]));
+    }
+    return size;
+}
+#else
+static size_t
+convert_32bits(char *buf, NCURSES_INT2 *Numbers, int count)
+{
+    int i, j;
+    unsigned char ch;
+    for (i = 0; i < count; i++) {
+       int value = 0;
+       for (j = 0; j < SIZEOF_32BITS; ++j) {
+           ch = UChar(*buf++);
+           value |= (ch << (8 * j));
+       }
+       if (value == -1)
+           Numbers[i] = ABSENT_NUMERIC;
+       else if (value == -2)
+           Numbers[i] = CANCELLED_NUMERIC;
+       else if (value > MAX_OF_TYPE(NCURSES_INT2))
+           Numbers[i] = MAX_OF_TYPE(NCURSES_INT2);
+       else
+           Numbers[i] = (short) value;
+       TR(TRACE_DATABASE, ("get Numbers[%d]=%d", i, Numbers[i]));
+    }
+    return SIZEOF_SHORT;
+}
+
+static size_t
+convert_16bits(char *buf, NCURSES_INT2 *Numbers, int count)
 {
     int i;
     for (i = 0; i < count; i++) {
@@ -61,7 +135,9 @@ convert_numbers(char *buf, NCURSES_INT2 *Numbers, int count)
            Numbers[i] = MyNumber(buf + 2 * i);
        TR(TRACE_DATABASE, ("get Numbers[%d]=%d", i, Numbers[i]));
     }
+    return SIZEOF_SHORT;
 }
+#endif
 
 static void
 convert_strings(char *buf, char **Strings, int count, int size, char *table)
@@ -112,7 +188,10 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want)
 #define Read(buf, count) fake_read(buffer, &offset, limit, (char *) buf, (unsigned) count)
 
 #define read_shorts(buf, count) \
-       (Read(buf, (count)*2) == (int) (count)*2)
+       (Read(buf, (count)*SIZEOF_SHORT) == (int) (count)*SIZEOF_SHORT)
+
+#define read_numbers(buf, count) \
+       (Read(buf, (count)*(unsigned)size_of_numbers) == (int) (count)*size_of_numbers)
 
 #define even_boundary(value) \
     if ((value) % 2 != 0) Read(buf, 1)
@@ -177,6 +256,10 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
     char buf[MAX_ENTRY_SIZE + 2];
     char *string_table;
     unsigned want, have;
+    bool need_ints;
+    size_t (*convert_numbers) (char *, NCURSES_INT2 *, int);
+    int size_of_numbers;
+    int max_entry_size = MAX_ENTRY_SIZE;
 
     TR(TRACE_DATABASE,
        (T_CALLED("_nc_read_termtype(ptr=%p, buffer=%p, limit=%d)"),
@@ -191,6 +274,24 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
        || !IS_TIC_MAGIC(buf)) {
        returnDB(TGETENT_NO);
     }
+#if NCURSES_EXT_NUMBERS
+    if ((need_ints = (LOW_MSB(buf) == MAGIC2))) {
+       convert_numbers = convert_32bits;
+       size_of_numbers = SIZEOF_INT2;
+    } else {
+       max_entry_size = MAX_ENTRY_SIZE1;
+       convert_numbers = convert_16bits;
+       size_of_numbers = SIZEOF_SHORT;
+    }
+#else
+    if ((need_ints = (LOW_MSB(buf) == MAGIC2))) {
+       convert_numbers = convert_32bits;
+       size_of_numbers = SIZEOF_32BITS;
+    } else {
+       convert_numbers = convert_16bits;
+       size_of_numbers = SIZEOF_INT2;
+    }
+#endif
 
     /* *INDENT-EQLS* */
     name_size  = MyNumber(buf + 2);
@@ -213,7 +314,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
 
     want = (unsigned) (str_size + name_size + 1);
     /* try to allocate space for the string table */
-    if (str_count * 2 >= MAX_ENTRY_SIZE
+    if (str_count * SIZEOF_SHORT >= max_entry_size
        || (string_table = typeMalloc(char, want)) == 0) {
        returnDB(TGETENT_NO);
     }
@@ -248,7 +349,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
 
     /* grab the numbers */
     if (!(ptr->Numbers = TYPE_CALLOC(NCURSES_INT2, max(NUMCOUNT, num_count)))
-       || !read_shorts(buf, num_count)) {
+       || !read_numbers(buf, num_count)) {
        returnDB(TGETENT_NO);
     }
     convert_numbers(buf, ptr->Numbers, num_count);
@@ -288,9 +389,9 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
        unsigned need = (unsigned) (ext_bool_count + ext_num_count + ext_str_count);
        int base = 0;
 
-       if (need >= (MAX_ENTRY_SIZE / 2)
-           || ext_str_size >= MAX_ENTRY_SIZE
-           || ext_str_limit >= MAX_ENTRY_SIZE
+       if ((int) need >= (max_entry_size / 2)
+           || ext_str_size >= max_entry_size
+           || ext_str_limit >= max_entry_size
            || ext_bool_count < 0
            || ext_num_count < 0
            || ext_str_count < 0
@@ -324,7 +425,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
        TR(TRACE_DATABASE, ("READ %d extended-numbers @%d",
                            ext_num_count, offset));
        if ((ptr->ext_Numbers = UShort(ext_num_count)) != 0) {
-           if (!read_shorts(buf, ext_num_count)) {
+           if (!read_numbers(buf, ext_num_count)) {
                returnDB(TGETENT_NO);
            }
            TR(TRACE_DATABASE, ("Before converting extended-numbers"));
@@ -332,7 +433,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
        }
 
        TR(TRACE_DATABASE, ("READ extended-offsets @%d", offset));
-       if ((unsigned) (ext_str_count + (int) need) >= (MAX_ENTRY_SIZE / 2)) {
+       if ((ext_str_count + (int) need) >= (max_entry_size / 2)) {
            returnDB(TGETENT_NO);
        }
        if ((ext_str_count || need)
@@ -374,7 +475,7 @@ _nc_read_termtype(TERMTYPE2 *ptr, char *buffer, int limit)
        }
 
        if (need) {
-           if (ext_str_count >= (MAX_ENTRY_SIZE / 2)) {
+           if (ext_str_count >= (max_entry_size / 2)) {
                returnDB(TGETENT_NO);
            }
            if ((ptr->ext_Names = TYPE_CALLOC(char *, need)) == 0) {
@@ -670,7 +771,7 @@ _nc_read_tic_entry(char *filename,
                    && IS_TIC_MAGIC(have)) {
                    code = _nc_read_termtype(tp, have, used);
                    if (code == TGETENT_NO) {
-                       _nc_free_termtype(tp);
+                       _nc_free_termtype2(tp);
                    }
                }
                break;
index f480e1996a79d07d5cac245c594ffbc4760d01db..cc3f83ac6a6cc57a0f584a5a41bfdfc573189f32 100644 (file)
 
 #if 1
 #define TRACE_OUT(p) DEBUG(2, p)
+#define TRACE_NUM(n) if (VALID_NUMERIC(Numbers[n])) { \
+       TRACE_OUT(("put Numbers[%u]=%d", (unsigned) (n), Numbers[n])); }
 #else
 #define TRACE_OUT(p)           /*nothing */
+#define TRACE_NUM(n)           /* nothing */
 #endif
 
-MODULE_ID("$Id: write_entry.c,v 1.100 2017/11/25 02:06:43 tom Exp $")
+MODULE_ID("$Id: write_entry.c,v 1.101 2017/11/25 19:56:06 tom Exp $")
 
 static int total_written;
 static int total_parts;
@@ -557,7 +560,7 @@ compute_offsets(char **Strings, size_t strmax, short *offsets)
     return nextfree;
 }
 
-static void
+static size_t
 convert_shorts(unsigned char *buf, short *Numbers, size_t count)
 {
     size_t i;
@@ -572,28 +575,41 @@ convert_shorts(unsigned char *buf, short *Numbers, size_t count)
            TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i]));
        }
     }
+    return SIZEOF_SHORT;
 }
 
 #if NCURSES_EXT_NUMBERS
-static void
-convert_numbers(unsigned char *buf, NCURSES_INT2 *Numbers, size_t count)
+static size_t
+convert_16bit(unsigned char *buf, NCURSES_INT2 *Numbers, size_t count)
 {
-    size_t i;
+    size_t i, j;
+    size_t size = SIZEOF_SHORT;
     for (i = 0; i < count; i++) {
-       if (Numbers[i] == ABSENT_NUMERIC) {     /* HI/LO won't work */
-           buf[2 * i] = buf[2 * i + 1] = 0377;
-       } else if (Numbers[i] == CANCELLED_NUMERIC) {   /* HI/LO won't work */
-           buf[2 * i] = 0376;
-           buf[2 * i + 1] = 0377;
-       } else {
-           LITTLE_ENDIAN(buf + 2 * i, Numbers[i]);
-           TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i]));
+       unsigned value = (unsigned) Numbers[i];
+       TRACE_NUM(i);
+       for (j = 0; j < size; ++j) {
+           *buf++ = value & 0xff;
+           value >>= 8;
        }
     }
+    return size;
 }
 
-#else
-#define convert_numbers(buf,vec,len) convert_shorts(buf,vec,len)
+static size_t
+convert_32bit(unsigned char *buf, NCURSES_INT2 *Numbers, size_t count)
+{
+    size_t i, j;
+    size_t size = SIZEOF_INT2;
+    for (i = 0; i < count; i++) {
+       unsigned value = (unsigned) Numbers[i];
+       TRACE_NUM(i);
+       for (j = 0; j < size; ++j) {
+           *buf++ = value & 0xff;
+           value >>= 8;
+       }
+    }
+    return size;
+}
 #endif
 
 #define even_boundary(value) \
@@ -661,7 +677,7 @@ NCURSES_EXPORT(int)
 _nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
 {
     char *namelist;
-    size_t namelen, boolmax, nummax, strmax;
+    size_t namelen, boolmax, nummax, strmax, numlen;
     char zero = '\0';
     size_t i;
     int nextfree;
@@ -670,6 +686,12 @@ _nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
     unsigned last_bool = BOOLWRITE;
     unsigned last_num = NUMWRITE;
     unsigned last_str = STRWRITE;
+#if NCURSES_EXT_NUMBERS
+    bool need_ints = FALSE;
+    size_t (*convert_numbers) (unsigned char *, NCURSES_INT2 *, size_t) = convert_32bit;
+#else
+#define convert_numbers convert_shorts
+#endif
 
 #if NCURSES_XNAMES
     /*
@@ -690,14 +712,21 @@ _nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
 
     boolmax = 0;
     for (i = 0; i < last_bool; i++) {
-       if (tp->Booleans[i] == TRUE)
+       if (tp->Booleans[i] == TRUE) {
            boolmax = i + 1;
+       }
     }
 
     nummax = 0;
     for (i = 0; i < last_num; i++) {
-       if (tp->Numbers[i] != ABSENT_NUMERIC)
+       if (tp->Numbers[i] != ABSENT_NUMERIC) {
            nummax = i + 1;
+#if NCURSES_EXT_NUMBERS
+           if (tp->Numbers[i] > MAX_OF_TYPE(NCURSES_COLOR_T)) {
+               need_ints = TRUE;
+           }
+#endif
+       }
     }
 
     strmax = 0;
@@ -709,7 +738,17 @@ _nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
     nextfree = compute_offsets(tp->Strings, strmax, offsets);
 
     /* fill in the header */
+#if NCURSES_EXT_NUMBERS
+    if (need_ints) {
+       convert_numbers = convert_32bit;
+       LITTLE_ENDIAN(buf, MAGIC2);
+    } else {
+       convert_numbers = convert_16bit;
+       LITTLE_ENDIAN(buf, MAGIC);
+    }
+#else
     LITTLE_ENDIAN(buf, MAGIC);
+#endif
     LITTLE_ENDIAN(buf + 2, min(namelen, MAX_NAME_SIZE + 1));
     LITTLE_ENDIAN(buf + 4, boolmax);
     LITTLE_ENDIAN(buf + 6, nummax);
@@ -736,15 +775,15 @@ _nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
     TRACE_OUT(("Numerics begin at %04x", *offset));
 
     /* the numerics */
-    convert_numbers(buf, tp->Numbers, nummax);
-    if (Write(buf, 2, nummax) != nummax)
+    numlen = convert_numbers(buf, tp->Numbers, nummax);
+    if (Write(buf, numlen, nummax) != nummax)
        return (ERR);
 
     TRACE_OUT(("String offsets begin at %04x", *offset));
 
     /* the string offsets */
     convert_shorts(buf, offsets, strmax);
-    if (Write(buf, 2, strmax) != strmax)
+    if (Write(buf, SIZEOF_SHORT, strmax) != strmax)
        return (ERR);
 
     TRACE_OUT(("String table begins at %04x", *offset));
@@ -799,8 +838,8 @@ _nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
 
        TRACE_OUT(("WRITE %d numbers @%d", tp->ext_Numbers, *offset));
        if (tp->ext_Numbers) {
-           convert_numbers(buf, tp->Numbers + NUMCOUNT, (size_t) tp->ext_Numbers);
-           if (Write(buf, 2, tp->ext_Numbers) != tp->ext_Numbers)
+           numlen = convert_numbers(buf, tp->Numbers + NUMCOUNT, (size_t) tp->ext_Numbers);
+           if (Write(buf, numlen, tp->ext_Numbers) != tp->ext_Numbers)
                return (ERR);
        }
 
@@ -810,7 +849,7 @@ _nc_write_object(TERMTYPE2 *tp, char *buffer, unsigned *offset, unsigned limit)
         */
        convert_shorts(buf, offsets, strmax);
        TRACE_OUT(("WRITE offsets @%d", *offset));
-       if (Write(buf, 2, strmax) != strmax)
+       if (Write(buf, SIZEOF_SHORT, strmax) != strmax)
            return (ERR);
 
        /*
index ca9504f2a9931ed6aedaa2799cb25c72218a6ca0..8b790c7a28ee7bdb5b9997174696f8e907ba1d9e 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20180120) unstable; urgency=low
+ncurses6 (6.0+20180121) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 15 Jan 2018 20:53:47 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 20 Jan 2018 19:48:08 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index ca9504f2a9931ed6aedaa2799cb25c72218a6ca0..8b790c7a28ee7bdb5b9997174696f8e907ba1d9e 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20180120) unstable; urgency=low
+ncurses6 (6.0+20180121) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 15 Jan 2018 20:53:47 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 20 Jan 2018 19:48:08 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index cf00122c8c7bb9488b0a521577e3850d70fe0f71..b623363e9fb1adeee56abdf2d4a0d2974ea08e58 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20180120) unstable; urgency=low
+ncurses6 (6.0+20180121) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 15 Jan 2018 20:53:47 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 20 Jan 2018 19:48:08 -0500
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 578ba184ec1619988f57b58cca7e7aa6b28c1786..c07042c6872418d6575bcf44db6881f874c9bae1 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.251 2018/01/16 01:53:47 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.252 2018/01/21 00:48:08 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "0"\r
 !define VERSION_YYYY  "2018"\r
-!define VERSION_MMDD  "0120"\r
+!define VERSION_MMDD  "0121"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index de020cfd9b896e60cac903266935ec2f9de768eb..58019b980ef94cfd0fe102f2a301d4ee3ead569c 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.0
-Release: 20180120
+Release: 20180121
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 5c9afbd589f9d73bf50b42dc462380faa56ffdcb..ce293127ecd7614af915e6df58de6a6e783824fe 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.0
-Release: 20180120
+Release: 20180121
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz