]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.2 - patch 20200502
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 3 May 2020 02:00:56 +0000 (02:00 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 3 May 2020 02:00:56 +0000 (02:00 +0000)
+ add details on the change to Linux SGR 21 in 2018 -TD
+ add xterm-direct16 and xterm-direct256 -TD
+ modify lib_mouse.c to check for out-of-range button numbers, convert
  those to position reports.

13 files changed:
NEWS
VERSION
dist.mk
include/Caps-ncurses
misc/terminfo.src
ncurses/base/lib_mouse.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec

diff --git a/NEWS b/NEWS
index b5e9dfe8963bcd8dfa2f02713693f76787e96283..e14876890da2bcb8a31c2f404878594043db9fca 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3479 2020/04/26 00:40:38 tom Exp $
+-- $Id: NEWS,v 1.3482 2020/05/02 23:42:21 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,12 @@ 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.
 
+20200502
+       + add details on the change to Linux SGR 21 in 2018 -TD
+       + add xterm-direct16 and xterm-direct256 -TD
+       + modify lib_mouse.c to check for out-of-range button numbers, convert
+         those to position reports.
+
 20200425
        + use vt100+fnkeys in putty -TD
        + fix a typo in tput.1; "columns" should be "cols".
diff --git a/VERSION b/VERSION
index 9dabf2acf2e697a7800dbb138c04864abce1e7ec..45f3b190669bd97c4c59422de4d4ccc6d6ff331f 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.2     20200425
+5:0:10 6.2     20200502
diff --git a/dist.mk b/dist.mk
index 539b68ee5dfdabed4b5a1ba1798fa891b9b6ede2..6619b40c0175e2bdf4ed6c2345ae7a8a245a7805 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1347 2020/04/25 09:36:39 tom Exp $
+# $Id: dist.mk,v 1.1348 2020/05/02 09:32:34 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -38,7 +38,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 2
-NCURSES_PATCH = 20200425
+NCURSES_PATCH = 20200502
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index a1aef0d51e57550aca8a764bb66cca93aa200ee7..48956d0ed6db1fcb646fc472ee0228aa35a7404c 100644 (file)
@@ -28,7 +28,7 @@
 #
 # Author: Thomas E. Dickey
 #
-# $Id: Caps-ncurses,v 1.8 2020/02/02 23:34:34 tom Exp $
+# $Id: Caps-ncurses,v 1.9 2020/05/02 23:35:12 tom Exp $
 #
 #############################################################################
 #
@@ -342,6 +342,7 @@ infoalias   ksel    kslt    IBM     key_select
 # are not listed here.
 #
 used_by ncurses
+userdef        CO      num     n       number of indexed colors overlaying RGB space
 userdef        E3      str     -       clears the terminal's scrollback buffer.
 userdef        RGB     bool    -       use direct colors with 1/3 of color-pair bits per color.
 userdef        RGB     num     n       use direct colors with given number of bits per color.
index 48f4b23f5d7c4d92d370690640454005c597dc09..83b490af24fa23593b1cf31c3ee31141c9b6ce15 100644 (file)
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #      bug-ncurses@gnu.org
 #
-#      $Revision: 1.790 $
-#      $Date: 2020/04/26 00:38:36 $
+#      $Revision: 1.795 $
+#      $Date: 2020/05/02 23:39:49 $
 #
 # 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
@@ -1131,7 +1131,17 @@ fbterm|FbTerm for Linux with framebuffer,
 # (but nonstandard) SGR 21, which was supported in the Linux console since 1992
 # as an equivalent for SGR 22.  Long after (early 2018), someone modified the
 # console driver to make it ignore SGR 21 because the ECMA-48 standard
-# suggested a different use for that particular code.
+# suggested a different use for that particular code:
+#
+# https://github.com/torvalds/linux/commit/65d9982d7e523a1a8e7c9af012da0d166f72fc56#diff-7da3c215d12c9f6b88e1a37d38b116f0
+#
+# Two years later, someone (unfamiliar with ECMA-48 this time) documented it:
+#
+# https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/man4/console_codes.4?id=a133a6bc03d751a424fe0a4adea2198757599615
+#
+# For background, refer to the report on bug-ncurses:
+#
+# https://lists.gnu.org/archive/html/bug-ncurses/2019-10/msg00059.html
 linux-16color|linux console with 16 colors,
        colors#16, ncv#42, pairs#0x100,
        setab=\E[4%p1%{8}%m%d%?%p1%{7}%>%t;5%e;25%;m,
@@ -4873,7 +4883,7 @@ xterm-88color|xterm with 88 colors,
 # for numeric capabilities provided in ncurses 6.1:
 xterm+direct2|xterm with direct-color indexing,
        RGB,
-       colors#0x1000000, pairs#0x10000,
+       colors#0x1000000, pairs#0x10000, CO#8,
        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,
@@ -4888,7 +4898,7 @@ xterm-direct2|xterm with direct-color indexing (old),
 # identifier" parameter.  This version provides for that parameter:
 xterm+direct|xterm with direct-color indexing,
        RGB,
-       colors#0x1000000, pairs#0x10000,
+       colors#0x1000000, pairs#0x10000, CO#8,
        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,
@@ -4927,7 +4937,7 @@ vte-direct|vte with direct-color indexing,
 nsterm-direct|nsterm with direct-color indexing,
        use=xterm+indirect, use=nsterm,
 
-# As for others:
+# As for others (commenting at the time of release for ncurses 6.1):
 # + Apple's Terminal.app does not recognize either form of the direct-color
 #   sequences.
 # + Cygwin's mintty recognizes xterm's original implementation, does okay with
@@ -4939,6 +4949,36 @@ nsterm-direct|nsterm with direct-color indexing,
 # + terminology 0.91 recognizes xterm's original implementation, but does
 #   nothing useful with it.
 
+# Other variants are possible, e.g., by using more of xterm's indexed color
+# palette, though the intrusion of indexed colors on the direct-color space
+# would be more noticeable.
+
+xterm+direct16|xterm with direct-color indexing,
+       CO#16,
+       setab=\E[%?%p1%{8}%<%t4%p1%d%e%?%p1%{16}%<%t%p1%{92}%+%e48\:
+             2\:\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}
+             %&%d%;%;m,
+       setaf=\E[%?%p1%{8}%<%t3%p1%d%e%?%p1%{16}%<%t%p1%'R'%+%e38\:2
+             \:\:%p1%{65536}%/%d\:%p1%{256}%/%{255}%&%d\:%p1%{255}
+             %&%d%;%;m,
+       setb@, setf@, use=xterm+direct,
+
+xterm-direct16|xterm with direct-colors and 16 indexed colors,
+       use=xterm, use=xterm+direct16,
+
+xterm+direct256|xterm with direct-color indexing,
+       CO#0x100,
+       setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e%?
+             %p1%{256}%<%t48;5;%p1%d%e48\:2\:\:%p1%{65536}%/%d\:%p1
+             %{256}%/%{255}%&%d\:%p1%{255}%&%d%;%;m,
+       setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e%?
+             %p1%{256}%<%t38;5;%p1%d%e38\:2\:\:%p1%{65536}%/%d\:%p1
+             %{256}%/%{255}%&%d\:%p1%{255}%&%d%;%;m,
+       setb@, setf@, use=xterm+direct,
+
+xterm-direct256|xterm with direct-colors and 256 indexed colors,
+       use=xterm, use=xterm+direct256,
+
 #### XTERM Features
 
 # This chunk is based on suggestions by Ailin Nemui and Nicholas Marriott, who
@@ -24545,6 +24585,8 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 #    This was implemented for the Hurd.
 # rmxx/smxx describes the ECMA-48 strikeout/crossed-out attributes, as an
 #    experimental feature of tmux.
+# CO gives the number of indexed ("ANSI") colors which overlay an RGB color
+#    space.
 # E3 clears the terminal's scrollback buffer.  This was implemented in the
 #    Linux 3.0 kernel as a security feature.  It matches a feature which was
 #    added in xterm patch #107.
@@ -26488,4 +26530,8 @@ v3220|LANPAR Vision II model 3220/3221/3222,
 # 2020-04-25
 #      + use vt100+fnkeys in putty -TD
 #
+# 2020-05-02
+#      + add details on the change to Linux SGR 21 in 2018 -TD
+#      + add xterm-direct16 and xterm-direct256 -TD
+#
 ######## SHANTIH!  SHANTIH!  SHANTIH!
index 2530dec5a6e41f5725f931c610b2683bcdd3a7ca..8705a39ae153d9c9c41889b92a2978e88e0488e0 100644 (file)
@@ -85,7 +85,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.184 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.186 2020/05/02 21:13:04 tom Exp $")
 
 #include <tic.h>
 
@@ -142,19 +142,29 @@ make an error
 #define        MASK_RESERVED_EVENT(x)  (mmask_t) NCURSES_MOUSE_MASK(x, 040)
 
 #if NCURSES_MOUSE_VERSION == 1
+
 #define BUTTON_CLICKED        (BUTTON1_CLICKED        | BUTTON2_CLICKED        | BUTTON3_CLICKED        | BUTTON4_CLICKED)
 #define BUTTON_PRESSED        (BUTTON1_PRESSED        | BUTTON2_PRESSED        | BUTTON3_PRESSED        | BUTTON4_PRESSED)
 #define BUTTON_RELEASED       (BUTTON1_RELEASED       | BUTTON2_RELEASED       | BUTTON3_RELEASED       | BUTTON4_RELEASED)
 #define BUTTON_DOUBLE_CLICKED (BUTTON1_DOUBLE_CLICKED | BUTTON2_DOUBLE_CLICKED | BUTTON3_DOUBLE_CLICKED | BUTTON4_DOUBLE_CLICKED)
 #define BUTTON_TRIPLE_CLICKED (BUTTON1_TRIPLE_CLICKED | BUTTON2_TRIPLE_CLICKED | BUTTON3_TRIPLE_CLICKED | BUTTON4_TRIPLE_CLICKED)
+
 #define MAX_BUTTONS  4
+
 #else
+
 #define BUTTON_CLICKED        (BUTTON1_CLICKED        | BUTTON2_CLICKED        | BUTTON3_CLICKED        | BUTTON4_CLICKED        | BUTTON5_CLICKED)
 #define BUTTON_PRESSED        (BUTTON1_PRESSED        | BUTTON2_PRESSED        | BUTTON3_PRESSED        | BUTTON4_PRESSED        | BUTTON5_PRESSED)
 #define BUTTON_RELEASED       (BUTTON1_RELEASED       | BUTTON2_RELEASED       | BUTTON3_RELEASED       | BUTTON4_RELEASED       | BUTTON5_RELEASED)
 #define BUTTON_DOUBLE_CLICKED (BUTTON1_DOUBLE_CLICKED | BUTTON2_DOUBLE_CLICKED | BUTTON3_DOUBLE_CLICKED | BUTTON4_DOUBLE_CLICKED | BUTTON5_DOUBLE_CLICKED)
 #define BUTTON_TRIPLE_CLICKED (BUTTON1_TRIPLE_CLICKED | BUTTON2_TRIPLE_CLICKED | BUTTON3_TRIPLE_CLICKED | BUTTON4_TRIPLE_CLICKED | BUTTON5_TRIPLE_CLICKED)
+
+#if NCURSES_MOUSE_VERSION == 2
 #define MAX_BUTTONS  5
+#else
+#define MAX_BUTTONS  11
+#endif
+
 #endif
 
 #define INVALID_EVENT  -1
@@ -928,7 +938,7 @@ handle_wheel(SCREEN *sp, MEVENT * eventp, int button, int wheel)
        break;
     case 1:
        if (wheel) {
-#if NCURSES_MOUSE_VERSION == 2
+#if NCURSES_MOUSE_VERSION >= 2
            eventp->bstate = MASK_PRESS(5);
            /* See comment above for button 4 */
 #else
@@ -953,10 +963,24 @@ static bool
 decode_X10_bstate(SCREEN *sp, MEVENT * eventp, unsigned intro)
 {
     bool result;
+    int button;
+    int wheel = (intro & 96) == 96;
 
     eventp->bstate = 0;
 
-    if (!handle_wheel(sp, eventp, (int) intro, (intro & 96) == 96)) {
+    if (intro >= 96) {
+       if (intro >= 160) {
+           button = (intro - 152);     /* buttons 8-11 */
+       } else if (intro >= 96) {
+           button = (intro - 92);      /* buttons 4-7 */
+       }
+    } else {
+       button = (intro & 3);
+    }
+
+    if (button > MAX_BUTTONS) {
+       eventp->bstate = REPORT_MOUSE_POSITION;
+    } else if (!handle_wheel(sp, eventp, (int) intro, wheel)) {
 
        /*
         * Release events aren't reported for individual buttons, just for
@@ -1261,10 +1285,21 @@ decode_xterm_SGR1006(SCREEN *sp, MEVENT * eventp)
     if (read_SGR(sp, &data)) {
        int b = data.params[0];
        int b3 = 1 + (b & 3);
+       int wheel = ((b & 64) == 64);
+
+       if (b >= 132) {
+           b3 = MAX_BUTTONS + 1;
+       } else if (b >= 128) {
+           b3 = (b - 120);     /* buttons 8-11 */
+       } else if (b >= 64) {
+           b3 = (b - 60);      /* buttons 6-7 */
+       }
 
        eventp->id = NORMAL_EVENT;
        if (data.final == 'M') {
-           (void) handle_wheel(sp, eventp, b, (b & 64) == 64);
+           (void) handle_wheel(sp, eventp, b, wheel);
+       } else if (b3 > MAX_BUTTONS) {
+           eventp->bstate = REPORT_MOUSE_POSITION;
        } else {
            mmask_t pressed = (mmask_t) NCURSES_MOUSE_MASK(b3, NCURSES_BUTTON_PRESSED);
            mmask_t release = (mmask_t) NCURSES_MOUSE_MASK(b3, NCURSES_BUTTON_RELEASED);
index 9203623aa837ea5373724768da7a4e6ec06f8c5c..bdda0d6c0ff27dbc504eb27d365282b655701a35 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20200425) unstable; urgency=low
+ncurses6 (6.2+20200502) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 25 Apr 2020 05:36:39 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 02 May 2020 05:32:34 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 9203623aa837ea5373724768da7a4e6ec06f8c5c..bdda0d6c0ff27dbc504eb27d365282b655701a35 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20200425) unstable; urgency=low
+ncurses6 (6.2+20200502) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 25 Apr 2020 05:36:39 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 02 May 2020 05:32:34 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index a9bd71cec5a1398fece77f8b81f6cd8e2744bc02..d11aa131316039c452af2506f9fcd0185e7b5cde 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20200425) unstable; urgency=low
+ncurses6 (6.2+20200502) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 25 Apr 2020 05:36:39 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 02 May 2020 05:32:34 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 166a63dfb8d1df7026967dc77a75946420f97b6b..79c16b45c746117bc901ffac8ff536d5d342f2c8 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.391 2020/04/25 09:36:39 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.392 2020/05/02 09:32:34 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 "2"\r
 !define VERSION_YYYY  "2020"\r
-!define VERSION_MMDD  "0425"\r
+!define VERSION_MMDD  "0502"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 76409537047a9e9d5a94c077e548f5762cf67f71..776a3c33e903e509fc38b174f2b95b77adcf3618 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.2
-Release: 20200425
+Release: 20200502
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index fe5e58c4190634eb6edeb3cd79576dfc11042b9c..55e764ccf02ca719c92b337ba9fdeb2beb9395fe 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.2
-Release: 20200425
+Release: 20200502
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 6ca396124419ddf0147eb85137ae42b1febd9150..15788ba9deee85416677ce7300b8558bba7518a9 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.2
-Release: 20200425
+Release: 20200502
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz