From 59a39f19a7f7feeff4af587a289a2ad7966947fe Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 2 Apr 2023 00:15:26 +0000 Subject: [PATCH] ncurses 6.4 - patch 20230401 + modify experimental Windows driver to work with xterm mouse protocol. + remove DECCOLM+DECSCLM from foot (patch by Daniel Ekloef). --- NEWS | 6 ++- VERSION | 2 +- dist.mk | 4 +- misc/terminfo.src | 31 +++++++++++----- ncurses/base/lib_mouse.c | 63 +++++++++++++++++++++++--------- ncurses/curses.priv.h | 4 +- ncurses/win32con/win32_driver.c | 10 +++-- package/debian-mingw/changelog | 4 +- package/debian-mingw64/changelog | 4 +- package/debian/changelog | 4 +- package/mingw-ncurses.nsi | 4 +- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- package/ncursest.spec | 2 +- 14 files changed, 95 insertions(+), 47 deletions(-) diff --git a/NEWS b/NEWS index bc5be49f..f3b7e0c2 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3919 2023/03/12 00:14:16 tom Exp $ +-- $Id: NEWS,v 1.3923 2023/04/01 23:29:48 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -46,6 +46,10 @@ 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. +20230401 + + modify experimental Windows driver to work with xterm mouse protocol. + + remove DECCOLM+DECSCLM from foot (patch by Daniel Ekloef). + 20230311 + improve manpage description for addch versus unctrl format used for non-printable characters. diff --git a/VERSION b/VERSION index 2565b033..34c01e4d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.4 20230311 +5:0:10 6.4 20230401 diff --git a/dist.mk b/dist.mk index e8161fec..d0c7cd8b 100644 --- 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.1530 2023/03/11 12:02:16 tom Exp $ +# $Id: dist.mk,v 1.1533 2023/04/01 11:05:21 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 = 4 -NCURSES_PATCH = 20230311 +NCURSES_PATCH = 20230401 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/misc/terminfo.src b/misc/terminfo.src index 55766215..61b24111 100644 --- a/misc/terminfo.src +++ b/misc/terminfo.src @@ -6,8 +6,8 @@ # Report bugs and new terminal descriptions to # bug-ncurses@gnu.org # -# $Revision: 1.1052 $ -# $Date: 2023/01/28 23:21:43 $ +# $Revision: 1.1056 $ +# $Date: 2023/04/01 23:24:35 $ # # 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 @@ -4622,6 +4622,16 @@ ms-vt-utf8|vt-utf8|UTF-8 flavor of VT100+, # Windows Terminal (Preview) # https://github.com/microsoft/terminal # +# Windows 10 22H2 (also Windows 11) +# Version 1.16.10261.0 +# +# - Windows Terminal #1553: "Feature Request: Mouse/Touch/Pointer Bindings +# (like middle-click paste, right-click context menu, etc.)", compare to +# https://learn.microsoft.com/en-us/windows/console/mouse-event-record-str +# This appears to be related to a problem with its implementation of the +# Console API; the mouse does not work in a "Command Window" (e.g., as used +# in the ncurses MinGW driver), although escape sequences work. +# # Windows 10 21H1 # Version 1.9.1942.0 # @@ -7985,10 +7995,10 @@ foot+base|foot base fragment, bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r, cub1=^H, cud1=\n, dim=\E[2m, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, flash=\E]555\E\\, ind=\n, invis=\E[8m, - is2=\E[!p\E[?3;4l\E[4l\E>, kbs=^?, kcbt=\E[Z, - oc=\E]104\E\\, op=\E[39;49m, rev=\E[7m, ri=\EM, rmacs=\E(B, - rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m, - rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>, + is2=\E[!p\E[4l\E>, kbs=^?, kcbt=\E[Z, oc=\E]104\E\\, + op=\E[39;49m, rev=\E[7m, ri=\EM, rmacs=\E(B, rmam=\E[?7l, + rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m, rs1=\Ec, + rs2=\E[!p\E[4l\E>, 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, smkx=\E[?1h\E=, @@ -27776,13 +27786,13 @@ v3220|LANPAR Vision II model 3220/3221/3222, # + correct PS vs PE names in bracketed+paste (report by Bram Moolenaar) # -TD # -# 2022-01-07 +# 2023-01-07 # + add comment to bracketed+paste explaining that vim patch 9.0.1117 is # needed for use with the updated xterm descriptions (suggested by Bram # Moolenaar). # + add RV report+version (suggested by Bram Moolenaar). # -# 2022-01-14 +# 2023-01-14 # + change RV to XR/xr, to avoid conflict with pre-existing usage in vim, # to use RV/rv to denote DA2 and its response (discussion with Bram # Moolenaar) -TD @@ -27790,8 +27800,11 @@ v3220|LANPAR Vision II model 3220/3221/3222, # of terminals which may support focus in/out -TD # + use xterm+focus in xterm-p370 and tmux -TD # -# 2022-01-28 +# 2023-01-28 # + document XF, kxIN and kxOUT -TD # + add note on sun/wscons/cmdtool/shelltool -TD # +# 2023-04-01 +# + remove DECCOLM+DECSCLM from foot (patch by Daniel Ekloef). +# ######## SHANTIH! SHANTIH! SHANTIH! diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index f4151b81..319a276a 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018-2021,2022 Thomas E. Dickey * + * Copyright 2018-2022,2023 Thomas E. Dickey * * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -85,7 +85,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mouse.c,v 1.197 2022/08/13 14:13:12 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.198 2023/03/25 23:27:28 tom Exp $") #include @@ -380,7 +380,7 @@ handle_sysmouse(int sig GCC_UNUSED) } #endif /* USE_SYSMOUSE */ -#ifndef USE_TERM_DRIVER +#if !defined(USE_TERM_DRIVER) || defined(EXP_WIN32_DRIVER) #define xterm_kmous "\033[M" static void @@ -442,6 +442,9 @@ init_xterm_mouse(SCREEN *sp) static void enable_xterm_mouse(SCREEN *sp, int enable) { + TPUTS_TRACE(enable + ? "xterm mouse initialization" + : "xterm mouse deinitialization"); #if USE_EMX_MOUSE sp->_emxmouse_activated = enable; #else @@ -450,6 +453,18 @@ enable_xterm_mouse(SCREEN *sp, int enable) sp->_mouse_active = enable; } +#if defined(USE_TERM_DRIVER) +static void +enable_win32_mouse(SCREEN *sp, int enable) +{ +#if defined(EXP_WIN32_DRIVER) + enable_xterm_mouse(sp, enable); +#else + sp->_mouse_active = enable; +#endif +} +#endif + #if USE_GPM_SUPPORT static bool allow_gpm_mouse(SCREEN *sp GCC_UNUSED) @@ -741,7 +756,8 @@ initialize_mousetype(SCREEN *sp) #ifdef USE_TERM_DRIVER CallDriver(sp, td_initmouse); -#else +#endif +#if !defined(USE_TERM_DRIVER) || defined(EXP_WIN32_DRIVER) /* we know how to recognize mouse events under "xterm" */ if (NonEmpty(key_mouse)) { init_xterm_mouse(sp); @@ -760,13 +776,15 @@ _nc_mouse_init(SCREEN *sp) { bool result = FALSE; + T((T_CALLED("_nc_mouse_init(%p)"), sp)); + if (sp != 0) { if (!sp->_mouse_initialized) { int i; sp->_mouse_initialized = TRUE; - TR(MY_TRACE, ("_nc_mouse_init() called")); + TR(MY_TRACE, ("set _mouse_initialized")); sp->_mouse_eventp = FirstEV(sp); for (i = 0; i < EV_MAX; i++) @@ -774,11 +792,11 @@ _nc_mouse_init(SCREEN *sp) initialize_mousetype(sp); - T(("_nc_mouse_init() set mousetype to %d", sp->_mouse_type)); + T(("set _mouse_type to %d", sp->_mouse_type)); } result = sp->_mouse_initialized; } - return result; + returnCode(result); } /* @@ -1388,11 +1406,14 @@ _nc_mouse_inline(SCREEN *sp) static void mouse_activate(SCREEN *sp, int on) { + T((T_CALLED("mouse_activate(%p,%s)"), + (void *) SP_PARM, on ? "on" : "off")); + if (!on && !sp->_mouse_initialized) - return; + returnVoid; if (!_nc_mouse_init(sp)) - return; + returnVoid; if (on) { sp->_mouse_bstate = 0; @@ -1401,7 +1422,6 @@ mouse_activate(SCREEN *sp, int on) #if NCURSES_EXT_FUNCS NCURSES_SP_NAME(keyok) (NCURSES_SP_ARGx KEY_MOUSE, on); #endif - TPUTS_TRACE("xterm mouse initialization"); enable_xterm_mouse(sp, 1); break; #if USE_GPM_SUPPORT @@ -1420,25 +1440,28 @@ mouse_activate(SCREEN *sp, int on) #endif #ifdef USE_TERM_DRIVER case M_TERM_DRIVER: - sp->_mouse_active = TRUE; + enable_win32_mouse(sp, TRUE); break; #endif case M_NONE: - return; + returnVoid; + default: + T(("unexpected mouse mode")); + break; } /* Make runtime binding to cut down on object size of applications that * do not use the mouse (e.g., 'clear'). */ - sp->_mouse_event = _nc_mouse_event; + /* *INDENT-EQLS* */ + sp->_mouse_event = _nc_mouse_event; sp->_mouse_inline = _nc_mouse_inline; - sp->_mouse_parse = _nc_mouse_parse; + sp->_mouse_parse = _nc_mouse_parse; sp->_mouse_resume = _nc_mouse_resume; - sp->_mouse_wrap = _nc_mouse_wrap; + sp->_mouse_wrap = _nc_mouse_wrap; } else { switch (sp->_mouse_type) { case M_XTERM: - TPUTS_TRACE("xterm mouse deinitialization"); enable_xterm_mouse(sp, 0); break; #if USE_GPM_SUPPORT @@ -1454,14 +1477,18 @@ mouse_activate(SCREEN *sp, int on) #endif #ifdef USE_TERM_DRIVER case M_TERM_DRIVER: - sp->_mouse_active = FALSE; + enable_win32_mouse(sp, FALSE); break; #endif case M_NONE: - return; + returnVoid; + default: + T(("unexpected mouse mode")); + break; } } NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); + returnVoid; } /************************************************************************** diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index b0ab21bf..3aa480d9 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -35,7 +35,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.660 2023/02/25 21:24:20 tom Exp $ + * $Id: curses.priv.h,v 1.661 2023/03/25 23:12:24 tom Exp $ * * curses.priv.h * @@ -1657,7 +1657,7 @@ typedef void VoidFunc(void); #define returnMMask(code) TRACE_RETURN_SP(code,mmask_t) #define returnPtr(code) TRACE_RETURN1(code,ptr) #define returnSP(code) TRACE_RETURN1(code,sp) -#define returnVoid T((T_RETURN(""))); return +#define returnVoid { T((T_RETURN(""))); return; } #define returnVoidPtr(code) TRACE_RETURN1(code,void_ptr) #define returnWin(code) TRACE_RETURN1(code,win) diff --git a/ncurses/win32con/win32_driver.c b/ncurses/win32con/win32_driver.c index 45aadf2f..67b81625 100644 --- a/ncurses/win32con/win32_driver.c +++ b/ncurses/win32con/win32_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2018,2020 Thomas E. Dickey * + * Copyright 2018-2020,2023 Thomas E. Dickey * * Copyright 2008-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -48,7 +48,7 @@ #define CUR TerminalType(my_term). -MODULE_ID("$Id: win32_driver.c,v 1.2 2020/11/21 23:35:56 tom Exp $") +MODULE_ID("$Id: win32_driver.c,v 1.3 2023/03/25 14:08:36 tom Exp $") #define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) #define EXP_OPTIMIZE 0 @@ -924,11 +924,14 @@ wcon_initmouse(TERMINAL_CONTROL_BLOCK * TCB) { SCREEN *sp; + T((T_CALLED("win32con::wcon_initmouse(%p)"), TCB)); + if (validateConsoleHandle()) { SetSP(); sp->_mouse_type = M_TERM_DRIVER; } + returnVoid; } static int @@ -939,6 +942,7 @@ wcon_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int rc = 0; SCREEN *sp; + T((T_CALLED("win32con::wcon_testmouse(%p)"), TCB)); if (validateConsoleHandle()) { SetSP(); @@ -953,7 +957,7 @@ wcon_testmouse(TERMINAL_CONTROL_BLOCK * TCB, } } - return rc; + returnCode(rc); } static int diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 858f4c86..dfdd0125 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.4+20230311) unstable; urgency=low +ncurses6 (6.4+20230401) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 05 Mar 2023 13:16:04 -0500 + -- Thomas E. Dickey Sat, 01 Apr 2023 07:05:21 -0400 ncurses6 (5.9+20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 858f4c86..dfdd0125 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.4+20230311) unstable; urgency=low +ncurses6 (6.4+20230401) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 05 Mar 2023 13:16:04 -0500 + -- Thomas E. Dickey Sat, 01 Apr 2023 07:05:21 -0400 ncurses6 (5.9+20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index a38471b0..b0b297cc 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.4+20230311) unstable; urgency=low +ncurses6 (6.4+20230401) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 05 Mar 2023 13:16:04 -0500 + -- Thomas E. Dickey Sat, 01 Apr 2023 07:05:21 -0400 ncurses6 (5.9+20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 6b00844d..917556e8 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.569 2023/03/05 18:16:04 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.572 2023/04/01 11:05:21 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "4" !define VERSION_YYYY "2023" -!define VERSION_MMDD "0311" +!define VERSION_MMDD "0401" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 0fdb0614..79349749 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.4 -Release: 20230311 +Release: 20230401 License: X11 Group: Development/Libraries URL: https://invisible-island.net/ncurses/ diff --git a/package/ncurses.spec b/package/ncurses.spec index aa4ca9dc..cbc0cb6b 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.4 -Release: 20230311 +Release: 20230401 License: X11 Group: Development/Libraries URL: https://invisible-island.net/ncurses/ diff --git a/package/ncursest.spec b/package/ncursest.spec index 56c5bf02..0403832b 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.4 -Release: 20230311 +Release: 20230401 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz -- 2.45.0