snapshot of project "ncurses", label v6_5_20250920

This commit is contained in:
Thomas E. Dickey 2025-09-20 21:00:34 +00:00
parent 04b97b07ab
commit 795dae23aa
No known key found for this signature in database
GPG Key ID: CC2AF4472167BE03
22 changed files with 1070 additions and 1229 deletions

7
NEWS
View File

@ -26,7 +26,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.4341 2025/09/13 22:52:16 tom Exp $
-- $Id: NEWS,v 1.4344 2025/09/20 09:52:39 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -46,6 +46,11 @@ 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.
20250920
+ add configure check for <sys/fsuid.h>, build-fix for flatpacks
(report by Stas Sergeev).
+ update config.guess, config.sub
20250913
+ update ncurses-howto.
+ modify MKfallback.sh to eliminate TERMINFO environment variable.

View File

@ -1 +1 @@
5:0:10 6.5 20250913
5:0:10 6.5 20250920

13
aclocal.m4 vendored
View File

@ -29,7 +29,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: aclocal.m4,v 1.1119 2025/09/13 15:44:25 tom Exp $
dnl $Id: aclocal.m4,v 1.1122 2025/09/20 17:27:52 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
@ -2724,7 +2724,7 @@ AC_CHECK_LIB(bsd, gettimeofday,
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_FUNC_GETTTYNAM version: 3 updated: 2024/12/14 16:09:34
dnl CF_FUNC_GETTTYNAM version: 4 updated: 2025/09/20 13:27:11
dnl -----------------
dnl Check if the 4.3BSD function getttyname exists, as well as if <ttyent.h>
dnl defines the _PATH_TTYS symbol. If the corresponding file exists, but the
@ -2756,7 +2756,6 @@ then
AC_CACHE_CHECK(if _PATH_TTYS file exists,cf_cv_have_PATH_TTYS,[
AC_TRY_RUN([
$ac_includes_default
#include <ttyent.h>
int main(void) {
@ -2777,7 +2776,7 @@ then
[struct ttyent *fp = getttynam("/dev/tty"); (void)fp],
[cf_cv_func_getttynam=yes],
[cf_cv_func_getttynam=no])])
test "$cf_cv_func_getttynam" = yes && AC_DEFINE(HAVE_GETTTYNAM)
test "$cf_cv_func_getttynam" = yes && AC_DEFINE(HAVE_GETTTYNAM,1,[define to 1 if the system has getttynam()])
fi
])dnl
dnl ---------------------------------------------------------------------------
@ -8911,7 +8910,7 @@ AC_DEFUN([CF_VERBOSE],
CF_MSG_LOG([$1])
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_VERSION_INFO version: 10 updated: 2025/01/10 19:55:54
dnl CF_VERSION_INFO version: 11 updated: 2025/09/20 13:27:11
dnl ---------------
dnl Define several useful symbols derived from the VERSION file. A separate
dnl file is preferred to embedding the version numbers in various scripts.
@ -8995,9 +8994,9 @@ ifelse($1,,,[
AC_SUBST(PROGRAM)
AC_SUBST(PACKAGE)
AH_TEMPLATE([AS_TR_CPP($1[_VERSION])],[version of package])
AC_DEFINE_UNQUOTED(AS_TR_CPP($1[_VERSION]),"${VERSION_MAJOR}.${VERSION_MINOR}")
AC_DEFINE_UNQUOTED(AS_TR_CPP($1[_VERSION]),"${VERSION_MAJOR}.${VERSION_MINOR}",[define to version of $1])
AH_TEMPLATE([AS_TR_CPP($1[_PATCHDATE])],[patchdate of package])
AC_DEFINE_UNQUOTED(AS_TR_CPP($1[_PATCHDATE]),${VERSION_PATCH})
AC_DEFINE_UNQUOTED(AS_TR_CPP($1[_PATCHDATE]),${VERSION_PATCH},[define to patchdate of $1])
])
])dnl
dnl ---------------------------------------------------------------------------

17
config.guess vendored
View File

@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2024 Free Software Foundation, Inc.
# Copyright 1992-2025 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2024-07-27'
timestamp='2025-07-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -60,7 +60,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2024 Free Software Foundation, Inc.
Copyright 1992-2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -1597,8 +1597,11 @@ EOF
*:Unleashed:*:*)
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
;;
*:Ironclad:*:*)
GUESS=$UNAME_MACHINE-unknown-ironclad
x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*)
GUESS=$UNAME_MACHINE-pc-ironclad-mlibc
;;
*:[Ii]ronclad:*:*)
GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc
;;
esac
@ -1808,8 +1811,8 @@ fi
exit 1
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-format: "%Y-%02m-%02d"
# time-stamp-end: "'"
# End:

28
config.sub vendored
View File

@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2024 Free Software Foundation, Inc.
# Copyright 1992-2025 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale
timestamp='2024-05-27'
timestamp='2025-07-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -76,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2024 Free Software Foundation, Inc.
Copyright 1992-2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -145,6 +145,7 @@ case $1 in
| kfreebsd*-gnu* \
| knetbsd*-gnu* \
| kopensolaris*-gnu* \
| ironclad-* \
| linux-* \
| managarm-* \
| netbsd*-eabi* \
@ -242,7 +243,6 @@ case $1 in
| rombug \
| semi \
| sequent* \
| siemens \
| sgi* \
| siemens \
| sim \
@ -261,7 +261,7 @@ case $1 in
basic_machine=$field1-$field2
basic_os=
;;
zephyr*)
tock* | zephyr*)
basic_machine=$field1-unknown
basic_os=$field2
;;
@ -1194,7 +1194,7 @@ case $cpu-$vendor in
xscale-* | xscalee[bl]-*)
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
arm64-* | aarch64le-*)
arm64-* | aarch64le-* | arm64_32-*)
cpu=aarch64
;;
@ -1321,6 +1321,7 @@ case $cpu-$vendor in
| i960 \
| ia16 \
| ia64 \
| intelgt \
| ip2k \
| iq2000 \
| javascript \
@ -1522,6 +1523,10 @@ EOF
kernel=nto
os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
;;
ironclad*)
kernel=ironclad
os=`echo "$basic_os" | sed -e 's|ironclad|mlibc|'`
;;
linux*)
kernel=linux
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
@ -1976,6 +1981,7 @@ case $os in
| atheos* \
| auroraux* \
| aux* \
| banan_os* \
| beos* \
| bitrig* \
| bme* \
@ -2022,7 +2028,6 @@ case $os in
| ios* \
| iris* \
| irix* \
| ironclad* \
| isc* \
| its* \
| l4re* \
@ -2118,6 +2123,7 @@ case $os in
| sysv* \
| tenex* \
| tirtos* \
| tock* \
| toppers* \
| tops10* \
| tops20* \
@ -2214,6 +2220,8 @@ case $kernel-$os-$obj in
;;
uclinux-uclibc*- | uclinux-gnu*- )
;;
ironclad-mlibc*-)
;;
managarm-mlibc*- | managarm-kernel*- )
;;
windows*-msvc*-)
@ -2249,6 +2257,8 @@ case $kernel-$os-$obj in
;;
*-eabi*- | *-gnueabi*-)
;;
ios*-simulator- | tvos*-simulator- | watchos*-simulator- )
;;
none--*)
# None (no kernel, i.e. freestanding / bare metal),
# can be paired with an machine code file format
@ -2347,8 +2357,8 @@ echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
exit
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp nil t)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-format: "%Y-%02m-%02d"
# time-stamp-end: "'"
# End:

1697
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: configure.in,v 1.809 2025/09/13 15:40:47 tom Exp $
dnl $Id: configure.in,v 1.810 2025/09/15 07:45:00 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl For additional information, see
@ -38,7 +38,7 @@ dnl https://invisible-island.net/autoconf/my-autoconf.html
dnl
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.52.20210101)
AC_REVISION($Revision: 1.809 $)
AC_REVISION($Revision: 1.810 $)
AC_INIT(ncurses/base/lib_initscr.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
@ -1748,6 +1748,7 @@ malloc.h \
math.h \
poll.h \
sys/auxv.h \
sys/fsuid.h \
sys/ioctl.h \
sys/param.h \
sys/poll.h \

View File

@ -26,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.1687 2025/09/13 10:16:03 tom Exp $
# $Id: dist.mk,v 1.1688 2025/09/20 09:50:02 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 = 5
NCURSES_PATCH = 20250913
NCURSES_PATCH = 20250920
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -1,4 +1,4 @@
# $Id: ncurses_defs,v 1.118 2025/08/08 23:46:30 tom Exp $
# $Id: ncurses_defs,v 1.119 2025/09/15 07:45:00 tom Exp $
##############################################################################
# Copyright 2018-2024,2025 Thomas E. Dickey #
# Copyright 2000-2016,2017 Free Software Foundation, Inc. #
@ -177,6 +177,7 @@ HAVE_SYMLINK
HAVE_SYSCONF
HAVE_SYS_AUXV_H
HAVE_SYS_BSDTYPES_H
HAVE_SYS_FSUID_H
HAVE_SYS_IOCTL_H
HAVE_SYS_PARAM_H
HAVE_SYS_POLL_H

View File

@ -35,7 +35,7 @@
****************************************************************************/
/*
* $Id: curses.priv.h,v 1.718 2025/09/13 19:55:59 Robin.Haberkorn Exp $
* $Id: curses.priv.h,v 1.719 2025/09/20 20:30:37 tom Exp $
*
* curses.priv.h
*
@ -2552,6 +2552,7 @@ extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER;
#ifdef USE_TERM_DRIVER
#if defined(USE_WIN32CON_DRIVER)
extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER;
extern NCURSES_EXPORT(bool) _nc_mingw_init(void);
extern NCURSES_EXPORT(int) _nc_mingw_isatty(int fd);
extern NCURSES_EXPORT(int) _nc_mingw_tcflush(int fd, int queue);
extern NCURSES_EXPORT(int) _nc_mingw_tcgetattr(int fd, struct termios *arg);
@ -2566,6 +2567,7 @@ extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER;
extern NCURSES_EXPORT(WORD) _nc_console_MapColor(bool fore, int color);
extern NCURSES_EXPORT(bool) _nc_console_get_SBI(void);
extern NCURSES_EXPORT(int) _nc_console_read(SCREEN *sp, HANDLE fd, int *buf);
extern NCURSES_EXPORT(void) _nc_console_set_scrollback(bool normal, CONSOLE_SCREEN_BUFFER_INFO * info);
extern NCURSES_EXPORT(int) _nc_console_test(int fd);
extern NCURSES_EXPORT(void) _nc_console_size(int *Lines, int *Cols);
#endif

View File

@ -27,7 +27,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: MKfallback.sh,v 1.30 2025/09/13 19:12:54 tom Exp $
# $Id: MKfallback.sh,v 1.32 2025/09/20 18:24:34 tom Exp $
#
# MKfallback.sh -- create fallback table for entry reads
#
@ -63,10 +63,10 @@ if [ $# != 0 ]; then
tmp_info=`pwd`/tmp_info
echo creating temporary terminfo directory... >&2
TERMINFO_DIRS=$TERMINFO:$terminfo_dir
export TERMINFO_DIRS
rm -rf "$tmp_info"
mkdir -p "$tmp_info"
"$tic_path" -o "$tmp_info" -x "$terminfo_src" >&2
"$tic_path" -o $tmp_info -x "$terminfo_src" >&2
else
tmp_info=
fi
@ -85,7 +85,7 @@ EOF
if [ "$*" ]
then
opt_info=
[ -n "$tmp_info" ] && opt_info="A$tmp_info"
[ -n "$tmp_info" ] && opt_info="-A $tmp_info"
cat <<EOF
#include <tic.h>
@ -94,7 +94,7 @@ EOF
for x in "$@"
do
echo "/* $x */"
"$infocmp_path" -x"$opt_info" -E "$x" | sed -e 's/[ ]short[ ]/ NCURSES_INT2 /g'
"$infocmp_path" -x $opt_info -E "$x" | sed -e 's/[ ]short[ ]/ NCURSES_INT2 /g'
done
cat <<EOF
@ -105,7 +105,7 @@ EOF
for x in "$@"
do
echo "$comma /* $x */"
"$infocmp_path" -x"$opt_info" -e "$x"
"$infocmp_path" -x $opt_info -e "$x"
comma=","
done

View File

@ -36,10 +36,12 @@
#include <ctype.h>
#ifndef USE_ROOT_ACCESS
#if HAVE_SETFSUID
#if HAVE_SETFSUID && HAVE_SYS_FSUID_H
#include <sys/fsuid.h>
#else
#include <sys/stat.h>
#undef HAVE_SETFSUID
#define HAVE_SETFSUID 0 /* workaround for misconfigured system */
#endif
#endif
@ -52,7 +54,7 @@
#include <tic.h>
MODULE_ID("$Id: access.c,v 1.42 2025/02/20 01:02:09 tom Exp $")
MODULE_ID("$Id: access.c,v 1.43 2025/09/15 07:56:59 tom Exp $")
#define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c))

View File

@ -39,15 +39,13 @@
#define TTY int /* FIXME: TTY originalMode */
#include <curses.priv.h>
MODULE_ID("$Id: lib_win32con.c,v 1.30 2025/08/30 20:53:42 tom Exp $")
MODULE_ID("$Id: lib_win32con.c,v 1.31 2025/09/20 20:46:14 tom Exp $")
#if defined(_NC_WINDOWS)
#define CONTROL_PRESSED (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)
#if defined(EXP_WIN32_DRIVER)
static bool read_screen_data(void);
#endif
#define GenMap(vKey,key) MAKELONG(key, vKey)
/* *INDENT-OFF* */
@ -64,7 +62,6 @@ static const LONG keylist[] =
GenMap(VK_DELETE, KEY_DC),
GenMap(VK_INSERT, KEY_IC)
};
#if defined(EXP_WIN32_DRIVER)
static const LONG ansi_keys[] =
{
GenMap(VK_PRIOR, 'I'),
@ -78,20 +75,20 @@ static const LONG ansi_keys[] =
GenMap(VK_DELETE, 'S'),
GenMap(VK_INSERT, 'R')
};
#endif
/* *INDENT-ON* */
#define array_length(a) (sizeof(a)/sizeof(a[0]))
#define N_INI ((int)array_length(keylist))
#define FKEYS 24
#define MAPSIZE (FKEYS + N_INI)
static bool console_initialized = FALSE;
#if defined(EXP_WIN32_DRIVER)
/* A process can only have a single console, so it is safe
to maintain all the information about it in a single
static structure.
*/
NCURSES_EXPORT_VAR(ConsoleInfo) _nc_CONSOLE;
static bool console_initialized = FALSE;
#define EnsureInit() (void)(console_initialized ? TRUE : _nc_console_checkinit(TRUE, TRUE))
@ -350,7 +347,6 @@ _nc_console_MapColor(bool fore, int color)
return (WORD) a;
}
#if defined(EXP_WIN32_DRIVER)
/*
* Attempt to save the screen contents. PDCurses does this if
* PDC_RESTORE_SCREEN is set, giving the same visual appearance on
@ -388,6 +384,7 @@ save_original_screen(void)
return result;
}
#if defined(EXP_WIN32_DRIVER)
static bool
restore_original_screen(void)
{
@ -422,6 +419,7 @@ restore_original_screen(void)
}
return result;
}
#endif
static bool
read_screen_data(void)
@ -437,11 +435,13 @@ read_screen_data(void)
want = (size_t) (WINCONSOLE.save_size.X * WINCONSOLE.save_size.Y);
if ((WINCONSOLE.save_screen = malloc(want * sizeof(CHAR_INFO))) != 0) {
bufferCoord.X = (SHORT) (WINCONSOLE.window_only ?
WINCONSOLE.SBI.srWindow.Left : 0);
bufferCoord.Y = (SHORT) (WINCONSOLE.window_only ?
WINCONSOLE.SBI.srWindow.Top : 0);
if ((WINCONSOLE.save_screen = malloc(want * sizeof(CHAR_INFO))) != NULL) {
bufferCoord.X = (SHORT) (WINCONSOLE.window_only
? WINCONSOLE.SBI.srWindow.Left
: 0);
bufferCoord.Y = (SHORT) (WINCONSOLE.window_only
? WINCONSOLE.SBI.srWindow.Top
: 0);
T(("... reading console %s %dx%d into %d,%d - %d,%d at %d,%d",
WINCONSOLE.window_only ? "window" : "buffer",
@ -467,7 +467,6 @@ read_screen_data(void)
return result;
}
#endif
NCURSES_EXPORT(bool)
_nc_console_get_SBI(void)
@ -503,7 +502,6 @@ _nc_console_get_SBI(void)
return rc;
}
#if defined(EXP_WIN32_DRIVER)
#define MIN_WIDE 80
#define MIN_HIGH 24
@ -581,7 +579,6 @@ _nc_console_set_scrollback(bool normal, CONSOLE_SCREEN_BUFFER_INFO * info)
}
returnVoid;
}
#endif
#if defined(EXP_WIN32_DRIVER)
static ULONGLONG
@ -693,7 +690,6 @@ handle_mouse(SCREEN *sp, MOUSE_EVENT_RECORD mer)
return result;
}
#if defined(EXP_WIN32_DRIVER)
static int
rkeycompare(const void *el1, const void *el2)
{
@ -702,7 +698,6 @@ rkeycompare(const void *el1, const void *el2)
return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1));
}
#endif
static int
keycompare(const void *el1, const void *el2)
@ -1266,6 +1261,107 @@ _nc_console_restore(void)
returnBool(res);
}
#else // !defined(EXP_WIN32_DRIVER)
NCURSES_EXPORT(bool)
_nc_mingw_init(void)
{
{
/* initialize once, or not at all */
if (!console_initialized) {
int i;
DWORD num_buttons;
WORD a;
BOOL buffered = TRUE;
BOOL b;
START_TRACE();
WINCONSOLE.map = (LPDWORD) malloc(sizeof(DWORD) * MAPSIZE);
WINCONSOLE.rmap = (LPDWORD) malloc(sizeof(DWORD) * MAPSIZE);
WINCONSOLE.ansi_map = (LPDWORD) malloc(sizeof(DWORD) * MAPSIZE);
for (i = 0; i < (N_INI + FKEYS); i++) {
if (i < N_INI) {
WINCONSOLE.rmap[i] = WINCONSOLE.map[i] =
(DWORD) keylist[i];
WINCONSOLE.ansi_map[i] = (DWORD) ansi_keys[i];
} else {
WINCONSOLE.rmap[i] = WINCONSOLE.map[i] =
(DWORD) GenMap((VK_F1 + (i - N_INI)),
(KEY_F(1) + (i - N_INI)));
WINCONSOLE.ansi_map[i] =
(DWORD) GenMap((VK_F1 + (i - N_INI)),
(';' + (i - N_INI)));
}
}
qsort(WINCONSOLE.ansi_map,
(size_t) (MAPSIZE),
sizeof(keylist[0]),
keycompare);
qsort(WINCONSOLE.map,
(size_t) (MAPSIZE),
sizeof(keylist[0]),
keycompare);
qsort(WINCONSOLE.rmap,
(size_t) (MAPSIZE),
sizeof(keylist[0]),
rkeycompare);
if (GetNumberOfConsoleMouseButtons(&num_buttons)) {
WINCONSOLE.numButtons = (int) num_buttons;
} else {
WINCONSOLE.numButtons = 1;
}
a = _nc_console_MapColor(true, COLOR_WHITE) |
_nc_console_MapColor(false, COLOR_BLACK);
for (i = 0; i < CON_NUMPAIRS; i++)
WINCONSOLE.pairs[i] = a;
{
b = AllocConsole();
if (!b)
b = AttachConsole(ATTACH_PARENT_PROCESS);
WINCONSOLE.inp = GetDirectHandle("CONIN$", FILE_SHARE_READ);
WINCONSOLE.out = GetDirectHandle("CONOUT$", FILE_SHARE_WRITE);
if (getenv("NCGDB") || getenv("NCURSES_CONSOLE2")) {
T(("... will not buffer console"));
buffered = FALSE;
WINCONSOLE.hdl = WINCONSOLE.out;
} else {
T(("... creating console buffer"));
WINCONSOLE.hdl = CreateConsoleScreenBuffer(GENERIC_READ
| GENERIC_WRITE,
FILE_SHARE_READ
| FILE_SHARE_WRITE,
NULL,
CONSOLE_TEXTMODE_BUFFER,
NULL);
}
if (WINCONSOLE.hdl != INVALID_HANDLE_VALUE) {
WINCONSOLE.buffered = buffered;
_nc_console_get_SBI();
WINCONSOLE.save_SBI = WINCONSOLE.SBI;
if (!buffered) {
save_original_screen();
_nc_console_set_scrollback(FALSE, &WINCONSOLE.SBI);
}
GetConsoleCursorInfo(WINCONSOLE.hdl, &WINCONSOLE.save_CI);
T(("... initial cursor is %svisible, %d%%",
(WINCONSOLE.save_CI.bVisible ? "" : "not-"),
(int) WINCONSOLE.save_CI.dwSize));
}
}
console_initialized = TRUE;
}
}
return (WINCONSOLE.hdl != INVALID_HANDLE_VALUE);
}
#endif // EXP_WIN32_DRIVER
#endif // _NC_WINDOWS

View File

@ -43,7 +43,7 @@
#define CUR TerminalType(my_term).
MODULE_ID("$Id: win32_driver.c,v 1.11 2025/08/23 20:29:13 tom Exp $")
MODULE_ID("$Id: win32_driver.c,v 1.12 2025/09/20 21:00:34 tom Exp $")
#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE)
#define EXP_OPTIMIZE 0
@ -747,9 +747,6 @@ wcon_sgmode(TERMINAL_CONTROL_BLOCK * TCB, int setFlag, TTY * buf)
returnCode(result);
}
#define MIN_WIDE 80
#define MIN_HIGH 24
static int
wcon_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag)
{

View File

@ -44,20 +44,19 @@
#define CUR TerminalType(my_term).
MODULE_ID("$Id: win_driver.c,v 1.94 2025/08/30 20:50:55 tom Exp $")
MODULE_ID("$Id: win_driver.c,v 1.97 2025/09/20 20:58:36 tom Exp $")
#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE)
#define EXP_OPTIMIZE 0
extern NCURSES_EXPORT(WORD) _nc_console_MapColor(bool fore, int color);
extern
NCURSES_EXPORT(WORD) _nc_console_MapColor(bool fore, int color);
#define array_length(a) (sizeof(a)/sizeof(a[0]))
static bool InitConsole(void);
#define AssertTCB() assert(TCB != NULL && (TCB->magic == WINMAGIC))
#define validateConsoleHandle() (AssertTCB(), console_initialized || \
InitConsole())
_nc_mingw_init())
#define SetSP() assert(TCB->csp != NULL); sp = TCB->csp; (void) sp
#define GenMap(vKey,key) MAKELONG(key, vKey)
@ -78,20 +77,6 @@ static const LONG keylist[] =
GenMap(VK_INSERT, KEY_IC),
GenMap(VK_TAB, KEY_BTAB)
};
static const LONG ansi_keys[] =
{
GenMap(VK_PRIOR, 'I'),
GenMap(VK_NEXT, 'Q'),
GenMap(VK_END, 'O'),
GenMap(VK_HOME, 'H'),
GenMap(VK_LEFT, 'K'),
GenMap(VK_UP, 'H'),
GenMap(VK_RIGHT, 'M'),
GenMap(VK_DOWN, 'P'),
GenMap(VK_DELETE, 'S'),
GenMap(VK_INSERT, 'R'),
GenMap(VK_TAB, 'Z')
};
/* *INDENT-ON* */
#define N_INI ((int)array_length(keylist))
#define FKEYS 24
@ -584,9 +569,9 @@ wcon_CanHandle(TERMINAL_CONTROL_BLOCK * TCB,
TCB->magic = WINMAGIC;
if (tname == NULL || *tname == 0)
if (tname == NULL || *tname == 0) {
code = TRUE;
else if (tname != NULL && *tname == '#') {
} else if (tname != NULL && *tname == '#') {
/*
* Use "#" (a character which cannot begin a terminal's name) to
* select specific driver from the table.
@ -851,84 +836,6 @@ wcon_sgmode(TERMINAL_CONTROL_BLOCK * TCB, int setFlag, TTY * buf)
returnCode(result);
}
#define MIN_WIDE 80
#define MIN_HIGH 24
/*
* In "normal" mode, reset the buffer- and window-sizes back to their original values.
*/
static void
_nc_console_set_scrollback(bool normal, CONSOLE_SCREEN_BUFFER_INFO * info)
{
SMALL_RECT rect;
COORD coord;
bool changed = FALSE;
T((T_CALLED("win32con::_nc_console_set_scrollback(%s)"),
(normal
? "normal"
: "application")));
T(("... SBI.srWindow %d,%d .. %d,%d",
info->srWindow.Top,
info->srWindow.Left,
info->srWindow.Bottom,
info->srWindow.Right));
T(("... SBI.dwSize %dx%d",
info->dwSize.Y,
info->dwSize.X));
if (normal) {
rect = info->srWindow;
coord = info->dwSize;
if (memcmp(info, &WINCONSOLE.SBI, sizeof(*info)) != 0) {
changed = TRUE;
WINCONSOLE.SBI = *info;
}
} else {
int high = info->srWindow.Bottom - info->srWindow.Top + 1;
int wide = info->srWindow.Right - info->srWindow.Left + 1;
if (high < MIN_HIGH) {
T(("... height %d < %d", high, MIN_HIGH));
high = MIN_HIGH;
changed = TRUE;
}
if (wide < MIN_WIDE) {
T(("... width %d < %d", wide, MIN_WIDE));
wide = MIN_WIDE;
changed = TRUE;
}
rect.Left =
rect.Top = 0;
rect.Right = (SHORT) (wide - 1);
rect.Bottom = (SHORT) (high - 1);
coord.X = (SHORT) wide;
coord.Y = (SHORT) high;
if (info->dwSize.Y != high ||
info->dwSize.X != wide ||
info->srWindow.Top != 0 ||
info->srWindow.Left != 0) {
changed = TRUE;
}
}
if (changed) {
T(("... coord %d,%d", coord.Y, coord.X));
T(("... rect %d,%d - %d,%d",
rect.Top, rect.Left,
rect.Bottom, rect.Right));
SetConsoleScreenBufferSize(WINCONSOLE.hdl, coord); /* dwSize */
SetConsoleWindowInfo(WINCONSOLE.hdl, TRUE, &rect); /* srWindow */
_nc_console_get_SBI();
}
returnVoid;
}
static int
wcon_mode(TERMINAL_CONTROL_BLOCK * TCB, int progFlag, int defFlag)
{
@ -1056,90 +963,6 @@ wcon_release(TERMINAL_CONTROL_BLOCK * TCB)
returnVoid;
}
static bool
read_screen_data(void)
{
bool result = FALSE;
COORD bufferCoord;
size_t want;
WINCONSOLE.save_size.X = (SHORT) (WINCONSOLE.save_region.Right
- WINCONSOLE.save_region.Left + 1);
WINCONSOLE.save_size.Y = (SHORT) (WINCONSOLE.save_region.Bottom
- WINCONSOLE.save_region.Top + 1);
want = (size_t) (WINCONSOLE.save_size.X * WINCONSOLE.save_size.Y);
if ((WINCONSOLE.save_screen = malloc(want * sizeof(CHAR_INFO))) != NULL) {
bufferCoord.X = (SHORT) (WINCONSOLE.window_only
? WINCONSOLE.SBI.srWindow.Left
: 0);
bufferCoord.Y = (SHORT) (WINCONSOLE.window_only
? WINCONSOLE.SBI.srWindow.Top
: 0);
T(("... reading console %s %dx%d into %d,%d - %d,%d at %d,%d",
WINCONSOLE.window_only ? "window" : "buffer",
WINCONSOLE.save_size.Y, WINCONSOLE.save_size.X,
WINCONSOLE.save_region.Top,
WINCONSOLE.save_region.Left,
WINCONSOLE.save_region.Bottom,
WINCONSOLE.save_region.Right,
bufferCoord.Y,
bufferCoord.X));
if (read_screen(WINCONSOLE.hdl,
WINCONSOLE.save_screen,
WINCONSOLE.save_size,
bufferCoord,
&WINCONSOLE.save_region)) {
result = TRUE;
} else {
T((" error %#lx", (unsigned long) GetLastError()));
FreeAndNull(WINCONSOLE.save_screen);
}
}
return result;
}
/*
* Attempt to save the screen contents. PDCurses does this if
* PDC_RESTORE_SCREEN is set, giving the same visual appearance on
* restoration as if the library had allocated a console buffer. MSDN
* says that the data which can be read is limited to 64Kb (and may be
* less).
*/
static bool
save_original_screen(void)
{
bool result = FALSE;
WINCONSOLE.save_region.Top = 0;
WINCONSOLE.save_region.Left = 0;
WINCONSOLE.save_region.Bottom = (SHORT) (WINCONSOLE.SBI.dwSize.Y - 1);
WINCONSOLE.save_region.Right = (SHORT) (WINCONSOLE.SBI.dwSize.X - 1);
if (read_screen_data()) {
result = TRUE;
} else {
WINCONSOLE.save_region.Top = WINCONSOLE.SBI.srWindow.Top;
WINCONSOLE.save_region.Left = WINCONSOLE.SBI.srWindow.Left;
WINCONSOLE.save_region.Bottom = WINCONSOLE.SBI.srWindow.Bottom;
WINCONSOLE.save_region.Right = WINCONSOLE.SBI.srWindow.Right;
WINCONSOLE.window_only = TRUE;
if (read_screen_data()) {
result = TRUE;
}
}
T(("... save original screen contents %s", result ? "ok" : "err"));
return result;
}
static void
wcon_init(TERMINAL_CONTROL_BLOCK * TCB)
{
@ -1147,11 +970,11 @@ wcon_init(TERMINAL_CONTROL_BLOCK * TCB)
AssertTCB();
if (TCB) {
if (!InitConsole()) {
if (!(console_initialized = _nc_mingw_init())) {
returnVoid;
}
if (TCB) {
TCB->info.initcolor = TRUE;
TCB->info.canchange = FALSE;
TCB->info.hascolor = TRUE;
@ -1399,7 +1222,7 @@ Adjust(int milliseconds, int diff)
RIGHTMOST_BUTTON_PRESSED)
static mmask_t
decode_mouse(SCREEN *sp, int mask)
decode_mouse(const SCREEN *sp, int mask)
{
mmask_t result = 0;
@ -1437,8 +1260,8 @@ decode_mouse(SCREEN *sp, int mask)
static int
_nc_console_twait(
SCREEN *sp,
HANDLE fd,
const SCREEN *sp,
HANDLE hdl,
int mode,
int milliseconds,
int *timeleft
@ -1451,13 +1274,13 @@ _nc_console_twait(
FILETIME fstart;
FILETIME fend;
int diff;
bool isImmed = (milliseconds == 0);
bool isNoDelay = (milliseconds == 0);
#ifdef NCURSES_WGETCH_EVENTS
(void) evl; /* TODO: implement wgetch-events */
#endif
#define CONSUME() read_keycode(fd,&inp_rec,1,&nRead)
#define CONSUME() read_keycode(hdl,&inp_rec,1,&nRead)
assert(sp);
@ -1471,19 +1294,19 @@ _nc_console_twait(
while (true) {
GetSystemTimeAsFileTime(&fstart);
rc = WaitForSingleObject(fd, (DWORD) milliseconds);
rc = WaitForSingleObject(hdl, (DWORD) milliseconds);
GetSystemTimeAsFileTime(&fend);
diff = (int) tdiff(fstart, fend);
milliseconds = Adjust(milliseconds, diff);
if (!isImmed && milliseconds <= 0)
if (!isNoDelay && milliseconds <= 0)
break;
if (rc == WAIT_OBJECT_0) {
if (mode) {
b = GetNumberOfConsoleInputEvents(fd, &nRead);
b = GetNumberOfConsoleInputEvents(hdl, &nRead);
if (b && nRead > 0) {
b = PeekConsoleInput(fd, &inp_rec, 1, &nRead);
b = PeekConsoleInput(hdl, &inp_rec, 1, &nRead);
if (b && nRead > 0) {
switch (inp_rec.EventType) {
case KEY_EVENT:
@ -1902,102 +1725,3 @@ _nc_mingw_testmouse(
}
return rc;
}
static bool
InitConsole(void)
{
{
/* initialize once, or not at all */
if (!console_initialized) {
int i;
DWORD num_buttons;
WORD a;
BOOL buffered = TRUE;
BOOL b;
START_TRACE();
WINCONSOLE.map = (LPDWORD) malloc(sizeof(DWORD) * MAPSIZE);
WINCONSOLE.rmap = (LPDWORD) malloc(sizeof(DWORD) * MAPSIZE);
WINCONSOLE.ansi_map = (LPDWORD) malloc(sizeof(DWORD) * MAPSIZE);
for (i = 0; i < (N_INI + FKEYS); i++) {
if (i < N_INI) {
WINCONSOLE.rmap[i] = WINCONSOLE.map[i] =
(DWORD) keylist[i];
WINCONSOLE.ansi_map[i] = (DWORD) ansi_keys[i];
} else {
WINCONSOLE.rmap[i] = WINCONSOLE.map[i] =
(DWORD) GenMap((VK_F1 + (i - N_INI)),
(KEY_F(1) + (i - N_INI)));
WINCONSOLE.ansi_map[i] =
(DWORD) GenMap((VK_F1 + (i - N_INI)),
(';' + (i - N_INI)));
}
}
qsort(WINCONSOLE.ansi_map,
(size_t) (MAPSIZE),
sizeof(keylist[0]),
keycompare);
qsort(WINCONSOLE.map,
(size_t) (MAPSIZE),
sizeof(keylist[0]),
keycompare);
qsort(WINCONSOLE.rmap,
(size_t) (MAPSIZE),
sizeof(keylist[0]),
rkeycompare);
if (GetNumberOfConsoleMouseButtons(&num_buttons)) {
WINCONSOLE.numButtons = (int) num_buttons;
} else {
WINCONSOLE.numButtons = 1;
}
a = _nc_console_MapColor(true, COLOR_WHITE) |
_nc_console_MapColor(false, COLOR_BLACK);
for (i = 0; i < CON_NUMPAIRS; i++)
WINCONSOLE.pairs[i] = a;
{
b = AllocConsole();
if (!b)
b = AttachConsole(ATTACH_PARENT_PROCESS);
WINCONSOLE.inp = GetDirectHandle("CONIN$", FILE_SHARE_READ);
WINCONSOLE.out = GetDirectHandle("CONOUT$", FILE_SHARE_WRITE);
if (getenv("NCGDB") || getenv("NCURSES_CONSOLE2")) {
T(("... will not buffer console"));
buffered = FALSE;
WINCONSOLE.hdl = WINCONSOLE.out;
} else {
T(("... creating console buffer"));
WINCONSOLE.hdl = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
CONSOLE_TEXTMODE_BUFFER,
NULL);
}
if (WINCONSOLE.hdl != INVALID_HANDLE_VALUE) {
WINCONSOLE.buffered = buffered;
_nc_console_get_SBI();
WINCONSOLE.save_SBI = WINCONSOLE.SBI;
if (!buffered) {
save_original_screen();
_nc_console_set_scrollback(FALSE, &WINCONSOLE.SBI);
}
GetConsoleCursorInfo(WINCONSOLE.hdl, &WINCONSOLE.save_CI);
T(("... initial cursor is %svisible, %d%%",
(WINCONSOLE.save_CI.bVisible ? "" : "not-"),
(int) WINCONSOLE.save_CI.dwSize));
}
}
console_initialized = TRUE;
}
}
return (WINCONSOLE.hdl != INVALID_HANDLE_VALUE);
}

View File

@ -1,8 +1,8 @@
ncurses6td (6.5+20250913) unstable; urgency=low
ncurses6td (6.5+20250920) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 07 Sep 2025 05:51:53 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 15 Sep 2025 03:44:26 -0400
ncurses6 (5.9+20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6td (6.5+20250913) unstable; urgency=low
ncurses6td (6.5+20250920) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 07 Sep 2025 05:51:53 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 15 Sep 2025 03:44:26 -0400
ncurses6 (5.9+20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6td (6.5+20250913) unstable; urgency=low
ncurses6td (6.5+20250920) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 07 Sep 2025 05:51:53 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 15 Sep 2025 03:44:26 -0400
ncurses6 (5.9+20120608) unstable; urgency=low

View File

@ -1,4 +1,4 @@
; $Id: mingw-ncurses.nsi,v 1.721 2025/09/07 09:51:53 tom Exp $
; $Id: mingw-ncurses.nsi,v 1.722 2025/09/15 07:44:26 tom Exp $
; TODO add examples
; TODO bump ABI to 6
@ -10,7 +10,7 @@
!define VERSION_MAJOR "6"
!define VERSION_MINOR "5"
!define VERSION_YYYY "2025"
!define VERSION_MMDD "0913"
!define VERSION_MMDD "0920"
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
!define MY_ABI "5"

View File

@ -3,7 +3,7 @@
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.5
Release: 20250913
Release: 20250920
License: X11 License Distribution Modification Variant
Group: Development/Libraries
URL: https://invisible-island.net/ncurses/
@ -144,8 +144,8 @@ popd
%changelog
* Sat Sep 13 2025 Thomas E. Dickey
- testing ncurses 6.5-20250913
* Mon Sep 15 2025 Thomas E. Dickey
- testing ncurses 6.5-20250920
* Sat Feb 25 2023 Thomas Dickey
- amend URLs per rpmlint

View File

@ -1,7 +1,7 @@
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.5
Release: 20250913
Release: 20250920
License: X11 License Distribution Modification Variant
Group: Development/Libraries
URL: https://invisible-island.net/ncurses/
@ -134,8 +134,8 @@ rm -f test/ncurses
%changelog
* Sat Sep 13 2025 Thomas E. Dickey
- testing ncurses 6.5-20250913
* Mon Sep 15 2025 Thomas E. Dickey
- testing ncurses 6.5-20250920
* Sat Feb 25 2023 Thomas Dickey
- amend URLs per rpmlint

View File

@ -1,7 +1,7 @@
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.5
Release: 20250913
Release: 20250920
License: X11 License Distribution Modification Variant
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
@ -142,8 +142,8 @@ exit 0
%changelog
* Sat Sep 13 2025 Thomas E. Dickey
- testing ncurses 6.5-20250913
* Mon Sep 15 2025 Thomas E. Dickey
- testing ncurses 6.5-20250920
* Tue Dec 24 2019 Thomas Dickey
- drop custom CC_NORMAL warning flags because setting CFLAGS interferes with