Vendor import of less v692.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
------------
|
||||
|
||||
Less
|
||||
Copyright (C) 1984-2025 Mark Nudelman
|
||||
Copyright (C) 1984-2026 Mark Nudelman
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ unicode/EastAsianWidth.txt:
|
||||
distfiles: ${DISTFILES}
|
||||
|
||||
echo_distfiles:
|
||||
@echo $(subst .nro,.nro.VER,${DISTFILES})
|
||||
@echo $(subst .nro,.nro.VER,${DISTFILES}) | sed -e 's/[^ ]*\.lt / /g' -e 's/[^ ]*\.man / /g'
|
||||
|
||||
dist: ${DISTFILES}
|
||||
if [ ! -d ${srcdir}/release ]; then mkdir ${srcdir}/release; fi
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ dvi:
|
||||
installcheck:
|
||||
|
||||
check:
|
||||
if [ -x less$(EXEEXT) ] && ./less$(EXEEXT) -V | grep -q LESSTEST; then :; else ${MAKE} clean; ${MAKE} LESSTEST=1; fi
|
||||
if [ -x less$(EXEEXT) ] && ./less$(EXEEXT) -V | grep -q LESSTEST; then :; else ${MAKE} clean; fi; ${MAKE} LESSTEST=1
|
||||
objdir=$$(pwd); rflags=""; if [ -z "${VERBOSE}" ]; then rflags=-e; fi; cd $(srcdir)/lesstest && ${MAKE} && ./runtest $$rflags -l "$$objdir/less" lt
|
||||
|
||||
TAGS:
|
||||
|
||||
@@ -9,6 +9,27 @@
|
||||
Report bugs, suggestions or comments at
|
||||
https://github.com/gwsw/less/issues.
|
||||
|
||||
======================================================================
|
||||
|
||||
Major changes between "less" versions 691 and 692
|
||||
|
||||
* Revert HOME key to scroll to beginning of file and END key
|
||||
to scroll to end of file (github #658).
|
||||
|
||||
* Configure tty to leave CR and NL unmodified (github #703).
|
||||
|
||||
* Add commands to lesskey parser (forw-bell-hilite, goto-pos and osc8-jump).
|
||||
|
||||
* Add key sequences to lesskey parser (\kE, \kF, \kH, \kI, \kM, and \kS).
|
||||
|
||||
* Fix bug using negative value with -z option (github #709).
|
||||
|
||||
* Fix bug handling empty terminfo capabilties (github #710).
|
||||
|
||||
* Fix memory leak in setupterm (github #707).
|
||||
|
||||
* Make lesstest ignore system locale (nl_langinfo) (github #708).
|
||||
|
||||
======================================================================
|
||||
|
||||
Major changes between "less" versions 685 and 691
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -429,9 +429,18 @@ static void set_charset(void)
|
||||
/*
|
||||
* Try using the codeset name as the charset name.
|
||||
*/
|
||||
s = nl_langinfo(CODESET);
|
||||
if (icharset(s, 1))
|
||||
return;
|
||||
#if LESSTEST
|
||||
/*
|
||||
* Don't check nl_langinfo in lesstest mode; charset should come
|
||||
* only from environment variables, not from the system locale.
|
||||
*/
|
||||
if (0) /* {{ unfortunately it's too early to use is_lesstest }} */
|
||||
#endif
|
||||
{
|
||||
s = nl_langinfo(CODESET);
|
||||
if (icharset(s, 1))
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -176,5 +176,7 @@
|
||||
#define SK_SHIFT_END 35
|
||||
#define SK_CTL_HOME 36
|
||||
#define SK_CTL_END 37
|
||||
#define SK_SHIFT_LEFT_ARROW 38
|
||||
#define SK_SHIFT_RIGHT_ARROW 39
|
||||
|
||||
#define SK_CONTROL_K 40
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
# Copyright (C) 1984-2025 Mark Nudelman
|
||||
# Copyright (C) 1984-2026 Mark Nudelman
|
||||
#
|
||||
# You may distribute under the terms of either the GNU General Public
|
||||
# License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -102,10 +102,10 @@ static unsigned char cmdtable[] =
|
||||
ESC,'u',0, A_UNDO_SEARCH,
|
||||
ESC,'U',0, A_CLR_SEARCH,
|
||||
'g',0, A_GOLINE,
|
||||
SK(SK_HOME),0, A_LLSHIFT,
|
||||
SK(SK_HOME),0, A_GOLINE,
|
||||
SK(SK_SHIFT_HOME),0, A_GOLINE|A_EXTRA, ESC,'{',0,
|
||||
SK(SK_CTL_HOME),0, A_GOLINE|A_EXTRA, ESC,'{',0,
|
||||
SK(SK_END),0, A_RRSHIFT,
|
||||
SK(SK_END),0, A_GOEND,
|
||||
SK(SK_SHIFT_END),0, A_GOEND|A_EXTRA, ESC,'}',0,
|
||||
SK(SK_CTL_END),0, A_GOEND|A_EXTRA, ESC,'}',0,
|
||||
'<',0, A_GOLINE,
|
||||
@@ -120,6 +120,8 @@ static unsigned char cmdtable[] =
|
||||
SK(SK_LEFT_ARROW),0, A_LSHIFT,
|
||||
SK(SK_CTL_RIGHT_ARROW),0, A_RRSHIFT,
|
||||
SK(SK_CTL_LEFT_ARROW),0, A_LLSHIFT,
|
||||
SK(SK_SHIFT_RIGHT_ARROW),0, A_RRSHIFT,
|
||||
SK(SK_SHIFT_LEFT_ARROW),0, A_LLSHIFT,
|
||||
'{',0, A_F_BRACKET|A_EXTRA, '{','}',0,
|
||||
'}',0, A_B_BRACKET|A_EXTRA, '{','}',0,
|
||||
'(',0, A_F_BRACKET|A_EXTRA, '(',')',0,
|
||||
@@ -195,8 +197,8 @@ static unsigned char cmdtable[] =
|
||||
SK(SK_PAD_R),0, A_RSHIFT,
|
||||
SK(SK_PAD_L),0, A_LSHIFT,
|
||||
SK(SK_PAD_UR),0, A_B_SCREEN,
|
||||
SK(SK_PAD_UL),0, A_LLSHIFT,
|
||||
SK(SK_PAD_DR),0, A_RRSHIFT,
|
||||
SK(SK_PAD_UL),0, A_GOLINE,
|
||||
SK(SK_PAD_DR),0, A_F_SCREEN,
|
||||
SK(SK_PAD_DL),0, A_GOEND,
|
||||
SK(SK_PAD_STAR),0, A_NOACTION|A_EXTRA, '*',0,
|
||||
SK(SK_PAD_SLASH),0, A_NOACTION|A_EXTRA, '/',0,
|
||||
@@ -1176,6 +1178,10 @@ static int add_hometable(int (*call_lesskey)(constant char *, lbool), constant c
|
||||
constant char *efilename;
|
||||
int r;
|
||||
|
||||
#if LESSTEST
|
||||
if (is_lesstest()) /* Don't use lesskey files in lesstest */
|
||||
return -1;
|
||||
#endif
|
||||
if (envname != NULL && (efilename = lgetenv(envname)) != NULL)
|
||||
filename = save(efilename);
|
||||
else if (sysvar) /* def_filename is full path */
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -475,16 +475,17 @@ public lbool bin_file(int f, ssize_t *n)
|
||||
char data[256];
|
||||
constant char* p;
|
||||
constant char* edata;
|
||||
constant int umax = 4;
|
||||
|
||||
if (!seekable(f))
|
||||
return FALSE;
|
||||
if (less_lseek(f, (less_off_t)0, SEEK_SET) == BAD_LSEEK)
|
||||
return FALSE;
|
||||
*n = read(f, data, sizeof(data));
|
||||
if (*n <= 0)
|
||||
if (*n <= umax)
|
||||
return FALSE;
|
||||
edata = &data[*n];
|
||||
for (p = data; p < edata; )
|
||||
for (p = data; p+umax < edata; )
|
||||
{
|
||||
if (utf_mode && !is_utf8_well_formed(p, (int) ptr_diff(edata,p)))
|
||||
{
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* This file was generated by mkhelp.pl from less.hlp at 16:50 on 2026/1/10 */
|
||||
/* This file was generated by mkhelp.pl from less.hlp at 17:46 on 2026/1/29 */
|
||||
#include "less.h"
|
||||
constant char helpdata[] = {
|
||||
'\n',
|
||||
@@ -69,8 +69,8 @@ constant char helpdata[] = {
|
||||
'\n',
|
||||
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','J','\b','J','U','\b','U','M','\b','M','P','\b','P','I','\b','I','N','\b','N','G','\b','G','\n',
|
||||
'\n',
|
||||
' ',' ','g',' ',' ','<',' ',' ','E','S','C','-','<',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','f','i','r','s','t',' ','l','i','n','e',' ','i','n',' ','f','i','l','e',' ','(','o','r',' ','l','i','n','e',' ','_','\b','N',')','.','\n',
|
||||
' ',' ','G',' ',' ','>',' ',' ','E','S','C','-','>',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','l','a','s','t',' ','l','i','n','e',' ','i','n',' ','f','i','l','e',' ','(','o','r',' ','l','i','n','e',' ','_','\b','N',')','.','\n',
|
||||
' ',' ','g',' ',' ','<',' ',' ','E','S','C','-','<',' ',' ','H','O','M','E',' ','*',' ',' ','G','o',' ','t','o',' ','f','i','r','s','t',' ','l','i','n','e',' ','i','n',' ','f','i','l','e',' ','(','o','r',' ','l','i','n','e',' ','_','\b','N',')','.','\n',
|
||||
' ',' ','G',' ',' ','>',' ',' ','E','S','C','-','>',' ',' ','E','N','D',' ',' ','*',' ',' ','G','o',' ','t','o',' ','l','a','s','t',' ','l','i','n','e',' ','i','n',' ','f','i','l','e',' ','(','o','r',' ','l','i','n','e',' ','_','\b','N',')','.','\n',
|
||||
' ',' ','p',' ',' ','%',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','b','e','g','i','n','n','i','n','g',' ','o','f',' ','f','i','l','e',' ','(','o','r',' ','_','\b','N',' ','p','e','r','c','e','n','t',' ','i','n','t','o',' ','f','i','l','e',')','.','\n',
|
||||
' ',' ','t',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','n','e','x','t',' ','t','a','g','.','\n',
|
||||
' ',' ','T',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','G','o',' ','t','o',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','p','r','e','v','i','o','u','s',' ','t','a','g','.','\n',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -66,8 +66,8 @@
|
||||
|
||||
JJUUMMPPIINNGG
|
||||
|
||||
g < ESC-< * Go to first line in file (or line _N).
|
||||
G > ESC-> * Go to last line in file (or line _N).
|
||||
g < ESC-< HOME * Go to first line in file (or line _N).
|
||||
G > ESC-> END * Go to last line in file (or line _N).
|
||||
p % * Go to beginning of file (or _N percent into file).
|
||||
t * Go to the (_N-th) next tag.
|
||||
T * Go to the (_N-th) previous tag.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
'\" t
|
||||
.TH LESS 1 "10 Jan 2026" "less 691"
|
||||
.TH LESS 1 "29 Jan 2026" "less 692"
|
||||
.\" Define a string for the caret ("hat") as portably as possible.
|
||||
.ie \n(.g .ds ^ \(ha
|
||||
.el .ds ^ ^
|
||||
@@ -171,9 +171,9 @@ Scroll horizontally left N characters, default half the screen width
|
||||
option).
|
||||
If a number N is specified, it becomes the default for future RIGHTARROW
|
||||
and LEFTARROW commands.
|
||||
.IP "ESC-} or \*^RIGHTARROW or END"
|
||||
.IP "ESC-} or \*^RIGHTARROW or SHIFT-RIGHTARROW"
|
||||
Scroll horizontally right to show the end of the longest displayed line.
|
||||
.IP "ESC-{ or \*^LEFTARROW or HOME"
|
||||
.IP "ESC-{ or \*^LEFTARROW or SHIFT-LEFTARROW"
|
||||
Scroll horizontally left back to the first column.
|
||||
.IP "\*^END or SHIFT-END"
|
||||
Go to line N in the file, default the end of the file, and
|
||||
@@ -213,10 +213,10 @@ the last search pattern, the terminal bell is rung.
|
||||
Like F, but as soon as a line is found which matches
|
||||
the last search pattern, the terminal bell is rung
|
||||
and forward scrolling stops.
|
||||
.IP "g or < or ESC-<"
|
||||
.IP "g or < or ESC-< or HOME"
|
||||
Go to line N in the file, default 1 (beginning of file).
|
||||
(Warning: this may be slow if N is large.)
|
||||
.IP "G or > or ESC->"
|
||||
.IP "G or > or ESC-> or END"
|
||||
Go to line N in the file, default the end of the file.
|
||||
(Warning: this may be slow if N is large,
|
||||
or if N is not specified and
|
||||
@@ -1624,7 +1624,7 @@ lines less than the current screen size.
|
||||
For example, if the screen is 24 lines,
|
||||
.B "\-z\-4"
|
||||
sets the
|
||||
scrolling window to 20 lines. If the screen is resized to 40 lines,
|
||||
scrolling window to 20 lines. If the screen is later resized to 40 lines,
|
||||
the scrolling window automatically changes to 36 lines.
|
||||
.IP "\fB\-""\fP\fIcc\fP\ or\ \fB\-\-quotes=\fP\fIcc\fP"
|
||||
Changes the filename quoting character.
|
||||
@@ -3198,7 +3198,7 @@ Possible location of the history file; see the description of the LESSHISTFILE e
|
||||
.BR lessecho (1)
|
||||
.
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 1984-2025 Mark Nudelman
|
||||
Copyright (C) 1984-2026 Mark Nudelman
|
||||
.PP
|
||||
less is part of the GNU project and is free software.
|
||||
You can redistribute it and/or modify it
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
+1
-1
@@ -52,4 +52,4 @@
|
||||
|
||||
Report bugs at https://github.com/gwsw/less/issues.
|
||||
|
||||
less 691 10 Jan 2026 [4mLESSECHO[24m(1)
|
||||
less 692 29 Jan 2026 [4mLESSECHO[24m(1)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
.TH LESSECHO 1 "10 Jan 2026" "less 691"
|
||||
.TH LESSECHO 1 "29 Jan 2026" "less 692"
|
||||
.\" Define a string to interpolate the hyphenless break point escape
|
||||
.\" sequence (for URLs and similar) if the formatter claims groff
|
||||
.\" compatibility, else interpolate nothing.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
+48
-20
@@ -65,17 +65,23 @@
|
||||
|
||||
\k followed by one or two characters represents the char(s) produced
|
||||
when one of these keys is pressed:
|
||||
\kb BACKSPACE (the BACKSPACE key)
|
||||
\kb BACKSPACE (the BACKSPACE key; may be different than \b)
|
||||
\kB ctrl‐BACKSPACE
|
||||
\kd DOWN ARROW
|
||||
\kD PAGE DOWN
|
||||
\ke END
|
||||
\kE ctrl‐END
|
||||
\kF shift‐END
|
||||
\kh HOME
|
||||
\kH ctrl‐HOME
|
||||
\kI shift‐HOME
|
||||
\ki INSERT
|
||||
\kl LEFT ARROW
|
||||
\kL ctrl‐LEFT ARROW
|
||||
\kM shift‐LEFT ARROW
|
||||
\kr RIGHT ARROW
|
||||
\kR ctrl‐RIGHT ARROW
|
||||
\kS shift‐RIGHT ARROW
|
||||
\kt BACKTAB
|
||||
\ku UP ARROW
|
||||
\kU PAGE UP
|
||||
@@ -137,11 +143,10 @@
|
||||
^Y back-line
|
||||
^K back-line
|
||||
^P back-line
|
||||
\ku back-line
|
||||
J forw-line-force
|
||||
K back-line-force
|
||||
Y back-line-force
|
||||
\ej forw-newline
|
||||
\ek back-newline
|
||||
d forw-scroll
|
||||
^D forw-scroll
|
||||
u back-scroll
|
||||
@@ -159,8 +164,11 @@
|
||||
w back-window
|
||||
\e\40 forw-screen-force
|
||||
\eb back-screen-force
|
||||
\ej forw-newline
|
||||
\ek back-newline
|
||||
F forw-forever
|
||||
\eF forw-until-hilite
|
||||
\ef forw-bell-hilite
|
||||
R repaint-flush
|
||||
r repaint
|
||||
^R repaint
|
||||
@@ -169,16 +177,25 @@
|
||||
\eU clear-search
|
||||
g goto-line
|
||||
\kh goto-line
|
||||
\kH goto-line \e{
|
||||
\kI goto-line \e{
|
||||
\ke goto-end
|
||||
\kE goto-end \e}
|
||||
\kF goto-end \e}
|
||||
< goto-line
|
||||
\e< goto-line
|
||||
p percent
|
||||
% percent
|
||||
\e( left-scroll
|
||||
\e) right-scroll
|
||||
\kl left-scroll
|
||||
\kr right-scroll
|
||||
\e{ no-scroll
|
||||
\e} end-scroll
|
||||
\kl left-scroll
|
||||
\kr right-scroll
|
||||
\kL no-scroll
|
||||
\kM no-scroll
|
||||
\kR end-scroll
|
||||
\kS end-scroll
|
||||
{ forw-bracket {}
|
||||
} back-bracket {}
|
||||
( forw-bracket ()
|
||||
@@ -190,7 +207,7 @@
|
||||
G goto-end
|
||||
\e> goto-end
|
||||
> goto-end
|
||||
\ke goto-end
|
||||
P goto-pos
|
||||
\eG goto-end-buffered
|
||||
= status
|
||||
^G status
|
||||
@@ -203,11 +220,6 @@
|
||||
\en repeat-search-all
|
||||
N reverse-search
|
||||
\eN reverse-search-all
|
||||
^O^N osc8-forw-search
|
||||
^On osc8-forw-search
|
||||
^O^P osc8-back-search
|
||||
^Op osc8-back-search
|
||||
^O^O osc8-open
|
||||
& filter
|
||||
m set-mark
|
||||
M set-mark-bottom
|
||||
@@ -219,6 +231,14 @@
|
||||
^X^V examine
|
||||
:n next-file
|
||||
:p prev-file
|
||||
^O^N osc8-forw-search
|
||||
^On osc8-forw-search
|
||||
^O^P osc8-back-search
|
||||
^Op osc8-back-search
|
||||
^O^O osc8-open
|
||||
^Oo osc8-open
|
||||
^O^L osc8-jump
|
||||
^Ol osc8-jump
|
||||
t next-tag
|
||||
T prev-tag
|
||||
:x index-file
|
||||
@@ -230,6 +250,13 @@
|
||||
## extra string with ONE dash; eg:
|
||||
## s toggle-option -log-file\n
|
||||
_ display-option
|
||||
| pipe
|
||||
v visual
|
||||
! shell
|
||||
# pshell
|
||||
+ firstcmd
|
||||
\e[M mouse
|
||||
\e[< mouse6
|
||||
\kp1 goto-end
|
||||
\kp2 forw-line
|
||||
\kp3 forw-screen
|
||||
@@ -245,15 +272,9 @@
|
||||
\kp+ noaction +
|
||||
\kp. noaction .
|
||||
\kp, noaction ,
|
||||
| pipe
|
||||
v visual
|
||||
! shell
|
||||
# pshell
|
||||
+ firstcmd
|
||||
\e[M mouse
|
||||
\e[< mouse6
|
||||
H help
|
||||
h help
|
||||
\k1 help
|
||||
V version
|
||||
0 digit
|
||||
1 digit
|
||||
@@ -307,6 +328,7 @@
|
||||
#line-edit
|
||||
\t forw-complete
|
||||
\17 back-complete
|
||||
\ekt back-complete
|
||||
\e\t back-complete
|
||||
ˆL expand
|
||||
ˆV literal
|
||||
@@ -317,14 +339,19 @@
|
||||
\kl left
|
||||
\eb word-left
|
||||
\e\kl word-left
|
||||
\e\kL word-left
|
||||
\ew word-right
|
||||
\e\kr word-right
|
||||
\e\kR word-right
|
||||
\ei insert
|
||||
\ki insert
|
||||
\ex delete
|
||||
\kx delete
|
||||
\eX word-delete
|
||||
\ekx word-delete
|
||||
\kX word-delete
|
||||
\e\b word-backspace
|
||||
\kB word-backspace
|
||||
\e0 home
|
||||
\kh home
|
||||
\e$ end
|
||||
@@ -332,6 +359,7 @@
|
||||
\ek up
|
||||
\ku up
|
||||
\ej down
|
||||
\kd down
|
||||
ˆG abort
|
||||
\kp1 end
|
||||
\kp2 down
|
||||
@@ -431,7 +459,7 @@
|
||||
represented as \340 in a lesskey file.
|
||||
|
||||
[1mCOPYRIGHT[0m
|
||||
Copyright (C) 1984‐2025 Mark Nudelman
|
||||
Copyright (C) 1984‐2026 Mark Nudelman
|
||||
|
||||
less is part of the GNU project and is free software. You can redis‐
|
||||
tribute it and/or modify it under the terms of either (1) the GNU Gen‐
|
||||
@@ -452,4 +480,4 @@
|
||||
Mark Nudelman
|
||||
Report bugs at https://github.com/gwsw/less/issues.
|
||||
|
||||
less 691 10 Jan 2026 [4mLESSKEY[24m(1)
|
||||
less 692 29 Jan 2026 [4mLESSKEY[24m(1)
|
||||
|
||||
+48
-20
@@ -1,5 +1,5 @@
|
||||
'\" t
|
||||
.TH LESSKEY 1 "10 Jan 2026" "less 691"
|
||||
.TH LESSKEY 1 "29 Jan 2026" "less 692"
|
||||
.\" Define a string for the caret ("hat") as portably as possible.
|
||||
.ie \n(.g .ds ^ \(ha
|
||||
.el .ds ^ ^
|
||||
@@ -109,17 +109,23 @@ when one of these keys is pressed:
|
||||
.RS 5m
|
||||
.TS
|
||||
l l.
|
||||
\ekb BACKSPACE (the BACKSPACE key)
|
||||
\ekb BACKSPACE (the BACKSPACE key; may be different than \eb)
|
||||
\ekB ctrl-BACKSPACE
|
||||
\ekd DOWN ARROW
|
||||
\ekD PAGE DOWN
|
||||
\eke END
|
||||
\ekE ctrl-END
|
||||
\ekF shift-END
|
||||
\ekh HOME
|
||||
\ekH ctrl-HOME
|
||||
\ekI shift-HOME
|
||||
\eki INSERT
|
||||
\ekl LEFT ARROW
|
||||
\ekL ctrl-LEFT ARROW
|
||||
\ekM shift-LEFT ARROW
|
||||
\ekr RIGHT ARROW
|
||||
\ekR ctrl-RIGHT ARROW
|
||||
\ekS shift-RIGHT ARROW
|
||||
\ekt BACKTAB
|
||||
\eku UP ARROW
|
||||
\ekU PAGE UP
|
||||
@@ -199,11 +205,10 @@ y back\-line
|
||||
\*^Y back\-line
|
||||
\*^K back\-line
|
||||
\*^P back\-line
|
||||
\eku back\-line
|
||||
J forw\-line\-force
|
||||
K back\-line\-force
|
||||
Y back\-line\-force
|
||||
\eej forw\-newline
|
||||
\eek back\-newline
|
||||
d forw\-scroll
|
||||
\*^D forw\-scroll
|
||||
u back\-scroll
|
||||
@@ -221,8 +226,11 @@ z forw\-window
|
||||
w back\-window
|
||||
\ee\e40 forw\-screen\-force
|
||||
\eeb back\-screen\-force
|
||||
\eej forw\-newline
|
||||
\eek back\-newline
|
||||
F forw\-forever
|
||||
\eeF forw\-until\-hilite
|
||||
\eef forw\-bell\-hilite
|
||||
R repaint\-flush
|
||||
r repaint
|
||||
\*^R repaint
|
||||
@@ -231,16 +239,25 @@ r repaint
|
||||
\eeU clear\-search
|
||||
g goto\-line
|
||||
\ekh goto\-line
|
||||
\ekH goto\-line \ee{
|
||||
\ekI goto\-line \ee{
|
||||
\eke goto\-end
|
||||
\ekE goto\-end \ee}
|
||||
\ekF goto\-end \ee}
|
||||
< goto\-line
|
||||
\ee< goto\-line
|
||||
p percent
|
||||
% percent
|
||||
\ee( left\-scroll
|
||||
\ee) right\-scroll
|
||||
\ekl left\-scroll
|
||||
\ekr right\-scroll
|
||||
\ee{ no\-scroll
|
||||
\ee} end\-scroll
|
||||
\ekl left\-scroll
|
||||
\ekr right\-scroll
|
||||
\ekL no\-scroll
|
||||
\ekM no\-scroll
|
||||
\ekR end\-scroll
|
||||
\ekS end\-scroll
|
||||
{ forw\-bracket {}
|
||||
} back\-bracket {}
|
||||
( forw\-bracket ()
|
||||
@@ -252,7 +269,7 @@ p percent
|
||||
G goto\-end
|
||||
\ee> goto\-end
|
||||
> goto\-end
|
||||
\eke goto\-end
|
||||
P goto\-pos
|
||||
\eeG goto\-end\-buffered
|
||||
\&= status
|
||||
\*^G status
|
||||
@@ -265,11 +282,6 @@ n repeat\-search
|
||||
\een repeat\-search\-all
|
||||
N reverse\-search
|
||||
\eeN reverse\-search\-all
|
||||
\*^O\*^N osc8\-forw\-search
|
||||
\*^On osc8\-forw\-search
|
||||
\*^O\*^P osc8\-back\-search
|
||||
\*^Op osc8\-back\-search
|
||||
\*^O\*^O osc8\-open
|
||||
& filter
|
||||
m set\-mark
|
||||
M set\-mark\-bottom
|
||||
@@ -281,6 +293,14 @@ E examine
|
||||
\*^X\*^V examine
|
||||
:n next\-file
|
||||
:p prev\-file
|
||||
\*^O\*^N osc8\-forw\-search
|
||||
\*^On osc8\-forw\-search
|
||||
\*^O\*^P osc8\-back\-search
|
||||
\*^Op osc8\-back\-search
|
||||
\*^O\*^O osc8\-open
|
||||
\*^Oo osc8\-open
|
||||
\*^O\*^L osc8\-jump
|
||||
\*^Ol osc8\-jump
|
||||
t next\-tag
|
||||
T prev\-tag
|
||||
:x index\-file
|
||||
@@ -292,6 +312,13 @@ s toggle\-option o
|
||||
## extra string with ONE dash; eg:
|
||||
## s toggle\-option \-log\-file\en
|
||||
\&_ display\-option
|
||||
| pipe
|
||||
v visual
|
||||
! shell
|
||||
# pshell
|
||||
+ firstcmd
|
||||
\ee[M mouse
|
||||
\ee[< mouse6
|
||||
\ekp1 goto\-end
|
||||
\ekp2 forw\-line
|
||||
\ekp3 forw\-screen
|
||||
@@ -307,15 +334,9 @@ s toggle\-option o
|
||||
\ekp+ noaction +
|
||||
\ekp. noaction .
|
||||
\ekp, noaction ,
|
||||
| pipe
|
||||
v visual
|
||||
! shell
|
||||
# pshell
|
||||
+ firstcmd
|
||||
\ee[M mouse
|
||||
\ee[< mouse6
|
||||
H help
|
||||
h help
|
||||
\ek1 help
|
||||
V version
|
||||
0 digit
|
||||
1 digit
|
||||
@@ -384,6 +405,7 @@ l l.
|
||||
#line\-edit
|
||||
\et forw\-complete
|
||||
\e17 back\-complete
|
||||
\eekt back\-complete
|
||||
\ee\et back\-complete
|
||||
^L expand
|
||||
^V literal
|
||||
@@ -394,14 +416,19 @@ l l.
|
||||
\ekl left
|
||||
\eeb word\-left
|
||||
\ee\ekl word\-left
|
||||
\ee\ekL word\-left
|
||||
\eew word\-right
|
||||
\ee\ekr word\-right
|
||||
\ee\ekR word\-right
|
||||
\eei insert
|
||||
\eki insert
|
||||
\eex delete
|
||||
\ekx delete
|
||||
\eeX word\-delete
|
||||
\eekx word\-delete
|
||||
\ekX word\-delete
|
||||
\ee\eb word\-backspace
|
||||
\ekB word\-backspace
|
||||
\ee0 home
|
||||
\ekh home
|
||||
\ee$ end
|
||||
@@ -409,6 +436,7 @@ l l.
|
||||
\eek up
|
||||
\eku up
|
||||
\eej down
|
||||
\ekd down
|
||||
^G abort
|
||||
\ekp1 end
|
||||
\ekp2 down
|
||||
@@ -541,7 +569,7 @@ which start with a NUL character (0).
|
||||
This NUL character should be represented as \e340 in a lesskey file.
|
||||
.
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 1984-2025 Mark Nudelman
|
||||
Copyright (C) 1984-2026 Mark Nudelman
|
||||
.PP
|
||||
less is part of the GNU project and is free software.
|
||||
You can redistribute it and/or modify it
|
||||
|
||||
+10
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -53,6 +53,7 @@ static constant struct lesskey_cmdname cmdnames[] =
|
||||
{ "first-cmd", A_FIRSTCMD },
|
||||
{ "firstcmd", A_FIRSTCMD },
|
||||
{ "flush-repaint", A_FREPAINT },
|
||||
{ "forw-bell-hilite", A_F_FOREVER_BELL },
|
||||
{ "forw-bracket", A_F_BRACKET },
|
||||
{ "forw-forever", A_F_FOREVER },
|
||||
{ "forw-line", A_F_LINE },
|
||||
@@ -68,6 +69,7 @@ static constant struct lesskey_cmdname cmdnames[] =
|
||||
{ "goto-end-buffered", A_GOEND_BUF },
|
||||
{ "goto-line", A_GOLINE },
|
||||
{ "goto-mark", A_GOMARK },
|
||||
{ "goto-pos", A_GOPOS },
|
||||
{ "help", A_HELP },
|
||||
{ "index-file", A_INDEX_FILE },
|
||||
{ "invalid", A_UINVALID },
|
||||
@@ -80,6 +82,7 @@ static constant struct lesskey_cmdname cmdnames[] =
|
||||
{ "noaction", A_NOACTION },
|
||||
{ "osc8-forw-search", A_OSC8_F_SEARCH },
|
||||
{ "osc8-back-search", A_OSC8_B_SEARCH },
|
||||
{ "osc8-jump", A_OSC8_JUMP },
|
||||
{ "osc8-open", A_OSC8_OPEN },
|
||||
{ "percent", A_PERCENT },
|
||||
{ "pipe", A_PIPE },
|
||||
@@ -255,12 +258,18 @@ static constant char * tstr(char **pp, int xlate)
|
||||
case 'd': ch = SK_DOWN_ARROW; break;
|
||||
case 'D': ch = SK_PAGE_DOWN; break;
|
||||
case 'e': ch = SK_END; break;
|
||||
case 'E': ch = SK_CTL_END; break;
|
||||
case 'F': ch = SK_SHIFT_END; break;
|
||||
case 'h': ch = SK_HOME; break;
|
||||
case 'H': ch = SK_CTL_HOME; break;
|
||||
case 'I': ch = SK_SHIFT_HOME; break;
|
||||
case 'i': ch = SK_INSERT; break;
|
||||
case 'l': ch = SK_LEFT_ARROW; break;
|
||||
case 'L': ch = SK_CTL_LEFT_ARROW; break;
|
||||
case 'M': ch = SK_SHIFT_LEFT_ARROW; break;
|
||||
case 'r': ch = SK_RIGHT_ARROW; break;
|
||||
case 'R': ch = SK_CTL_RIGHT_ARROW; break;
|
||||
case 'S': ch = SK_SHIFT_RIGHT_ARROW; break;
|
||||
case 't': ch = SK_BACKTAB; break;
|
||||
case 'u': ch = SK_UP_ARROW; break;
|
||||
case 'U': ch = SK_PAGE_UP; break;
|
||||
|
||||
+9
-1
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include <termcap.h>
|
||||
#include "lesstest.h"
|
||||
|
||||
@@ -136,7 +145,6 @@ void display_screen_debug(const byte* img, int imglen, int screen_width, int scr
|
||||
|
||||
// Print a list of strings.
|
||||
void print_strings(const char* title, char* const* strings) {
|
||||
if (1) return; ///
|
||||
fprintf(stderr, "%s:\n", title);
|
||||
char* const* s;
|
||||
for (s = strings; *s != NULL; ++s) {
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include "lesstest.h"
|
||||
|
||||
extern TermInfo terminfo;
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include <setjmp.h>
|
||||
#include "lesstest.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "lesstest.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
@@ -144,7 +153,10 @@ LessPipeline* create_less_pipeline(char* const* argv, int argc, char* const* env
|
||||
if (verbose) fprintf(stderr, "screen out pipe %d,%d\n", pipeline->screen_out_pipe[RD], pipeline->screen_out_pipe[WR]);
|
||||
pipeline->screen_pid = fork();
|
||||
if (!pipeline->screen_pid) // child: lt_screen
|
||||
{
|
||||
if (verbose) sleep(1); // avoid interleaved startup output
|
||||
become_child_screen(lt_screen, pipeline->screen_width, pipeline->screen_height, pipeline->screen_in_pipe, pipeline->screen_out_pipe);
|
||||
}
|
||||
if (verbose) fprintf(stderr, "screen child %ld\n", (long) pipeline->screen_pid);
|
||||
close(pipeline->screen_out_pipe[WR]); pipeline->screen_out_pipe[WR] = -1;
|
||||
close(pipeline->screen_in_pipe[RD]); pipeline->screen_in_pipe[RD] = -1;
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include "lt_types.h"
|
||||
|
||||
typedef struct wchar_range { wchar first, last; } wchar_range;
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include "lt_types.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -7,7 +7,7 @@ use strict;
|
||||
# whose content is the input to this script.
|
||||
|
||||
{
|
||||
my ($sec,$min,$hour,$mday,$mon,$year) = gmtime($ENV{SOURCE_DATE_EPOCH} // time());
|
||||
my ($sec,$min,$hour,$mday,$mon,$year) = gmtime(defined $ENV{SOURCE_DATE_EPOCH} ? $ENV{SOURCE_DATE_EPOCH} : time());
|
||||
printf "/* This file was generated by mkhelp.pl from less.hlp at %d:%02d on %d/%d/%d */\n",
|
||||
$hour, $min, $year+1900, $mon+1, $mday;
|
||||
print "#include \"less.h\"\n";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -556,7 +556,7 @@ public void opt__V(int type, constant char *s)
|
||||
putstr(" regular expressions)\n");
|
||||
{
|
||||
char constant *copyright =
|
||||
"Copyright (C) 1984-2025 Mark Nudelman\n\n";
|
||||
"Copyright (C) 1984-2026 Mark Nudelman\n\n";
|
||||
putstr(copyright);
|
||||
}
|
||||
if (version[strlen(version)-1] == 'x')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -93,7 +93,7 @@ public void scan_option(constant char *s, lbool is_env)
|
||||
break;
|
||||
case O_NUMBER:
|
||||
printopt = opt_desc(pendopt);
|
||||
getnumc(&s, printopt, FALSE, pendopt->ovar);
|
||||
getnumc(&s, printopt, (pendopt->otype & O_NEGOK) != 0, pendopt->ovar);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -295,7 +295,7 @@ public void scan_option(constant char *s, lbool is_env)
|
||||
}
|
||||
if (o->otype & O_UNSUPPORTED)
|
||||
break;
|
||||
getnumc(&s, printopt, FALSE, o->ovar);
|
||||
getnumc(&s, printopt, (o->otype & O_NEGOK) != 0, o->ovar);
|
||||
break;
|
||||
}
|
||||
/*
|
||||
@@ -437,7 +437,7 @@ public lbool toggle_option(struct loption *o, lbool lower, constant char *s, int
|
||||
switch (how_toggle)
|
||||
{
|
||||
case OPT_TOGGLE:
|
||||
if (!getnumc(&s, opt_desc(o), FALSE, o->ovar))
|
||||
if (!getnumc(&s, opt_desc(o), (o->otype & O_NEGOK) != 0, o->ovar))
|
||||
return FALSE;
|
||||
break;
|
||||
case OPT_UNSET:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -24,6 +24,7 @@
|
||||
#define O_NO_QUERY 0400 /* Option cannot be queried with "_" cmd */
|
||||
#define O_INIT_HANDLER 01000 /* Call option handler function at startup */
|
||||
#define O_UNSUPPORTED 02000 /* Option is unsupported via LESS_UNSUPPORT */
|
||||
#define O_NEGOK 04000 /* O_NUMBER parameter may be negative */
|
||||
|
||||
#define OTYPE (O_BOOL|O_TRIPLE|O_NUMBER|O_STRING|O_NOVAR)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -472,7 +472,7 @@ static struct loption option[] =
|
||||
}
|
||||
},
|
||||
{ 'z', &z_optname,
|
||||
O_NUMBER, -1, &swindow, NULL,
|
||||
O_NUMBER|O_NEGOK, -1, &swindow, NULL,
|
||||
{
|
||||
"Scroll window size: ",
|
||||
"Scroll window size is %d lines",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -36,3 +36,5 @@
|
||||
#define PCK_CTL_HOME '\x7a'
|
||||
#define PCK_CTL_END '\x7c'
|
||||
#define PCK_SHIFT_HOME '\x7d'
|
||||
#define PCK_SHIFT_LEFT '\x73'
|
||||
#define PCK_SHIFT_RIGHT '\x7f'
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -367,6 +367,15 @@ static void set_termio_flags(
|
||||
#endif
|
||||
#ifdef ONLRET
|
||||
| ONLRET
|
||||
#endif
|
||||
);
|
||||
|
||||
s->c_iflag &= ~(0
|
||||
#ifdef ICRNL
|
||||
| ICRNL
|
||||
#endif
|
||||
#ifdef INLCR
|
||||
| INLCR
|
||||
#endif
|
||||
);
|
||||
}
|
||||
@@ -381,7 +390,7 @@ static void set_termio_flags(
|
||||
* 4. \t is NOT expanded into spaces.
|
||||
* 5. Signal-causing characters such as ctrl-C (interrupt),
|
||||
* etc. are NOT disabled.
|
||||
* It doesn't matter whether an input \n is mapped to \r, or vice versa.
|
||||
* 6. Input \r is not mapped to \n, nor vice versa.
|
||||
*/
|
||||
public void raw_mode(int on)
|
||||
{
|
||||
@@ -897,7 +906,7 @@ public void scrsize(void)
|
||||
#ifdef TIOCGWINSZ
|
||||
{
|
||||
struct winsize w;
|
||||
if (ioctl(2, TIOCGWINSZ, &w) == 0)
|
||||
if (ioctl(2, TIOCGWINSZ, &w) == 0 || ioctl(1, TIOCGWINSZ, &w) == 0)
|
||||
{
|
||||
if (w.ws_row > 0)
|
||||
sys_height = w.ws_row;
|
||||
@@ -909,7 +918,7 @@ public void scrsize(void)
|
||||
#ifdef WIOCGETD
|
||||
{
|
||||
struct uwdata w;
|
||||
if (ioctl(2, WIOCGETD, &w) == 0)
|
||||
if (ioctl(2, WIOCGETD, &w) == 0 || ioctl(1, WIOCGETD, &w) == 0)
|
||||
{
|
||||
if (w.uw_height > 0)
|
||||
sys_height = w.uw_height / w.uw_vs;
|
||||
@@ -1030,6 +1039,8 @@ public constant char * special_key_str(int key)
|
||||
static char k_left[] = { '\340', PCK_LEFT, 0 };
|
||||
static char k_ctl_right[] = { '\340', PCK_CTL_RIGHT, 0 };
|
||||
static char k_ctl_left[] = { '\340', PCK_CTL_LEFT, 0 };
|
||||
static char k_shift_right[] = { '\340', PCK_SHIFT_RIGHT, 0 };
|
||||
static char k_shift_left[] = { '\340', PCK_SHIFT_LEFT, 0 };
|
||||
static char k_insert[] = { '\340', PCK_INSERT, 0 };
|
||||
static char k_delete[] = { '\340', PCK_DELETE, 0 };
|
||||
static char k_ctl_delete[] = { '\340', PCK_CTL_DELETE, 0 };
|
||||
@@ -1135,6 +1146,12 @@ public constant char * special_key_str(int key)
|
||||
case SK_CTL_RIGHT_ARROW:
|
||||
s = k_ctl_right;
|
||||
break;
|
||||
case SK_SHIFT_LEFT_ARROW:
|
||||
s = k_shift_left;
|
||||
break;
|
||||
case SK_SHIFT_RIGHT_ARROW:
|
||||
s = k_shift_right;
|
||||
break;
|
||||
case SK_CTL_BACKSPACE:
|
||||
s = k_ctl_backspace;
|
||||
break;
|
||||
@@ -1205,6 +1222,12 @@ public constant char * special_key_str(int key)
|
||||
case SK_BACKTAB:
|
||||
s = ltgetstr("kcbt", "kB", &sp);
|
||||
break;
|
||||
case SK_SHIFT_RIGHT_ARROW:
|
||||
s = ltgetstr("kRIT", NULL, &sp);
|
||||
break;
|
||||
case SK_SHIFT_LEFT_ARROW:
|
||||
s = ltgetstr("kLFT", NULL, &sp);
|
||||
break;
|
||||
case SK_CTL_RIGHT_ARROW:
|
||||
s = ltgetstr("kRIT5", NULL, &sp);
|
||||
break;
|
||||
@@ -1289,6 +1312,8 @@ public constant char * special_key_str(int key)
|
||||
default:
|
||||
return (NULL);
|
||||
}
|
||||
if (s != NULL && *s == '\0')
|
||||
s = NULL;
|
||||
return (s);
|
||||
}
|
||||
|
||||
@@ -1418,6 +1443,8 @@ public void get_term()
|
||||
term = DEFAULT_TERM;
|
||||
hardcopy = 0;
|
||||
#if USE_TERMINFO
|
||||
if (cur_term != NULL)
|
||||
del_curterm(cur_term);
|
||||
if (setupterm(term, -1, NULL) != OK)
|
||||
hardcopy = 1;
|
||||
#else
|
||||
@@ -3300,6 +3327,12 @@ static lbool win32_scan_code(XINPUT_RECORD *xip)
|
||||
{
|
||||
switch (xip->ir.Event.KeyEvent.wVirtualScanCode)
|
||||
{
|
||||
case PCK_RIGHT:
|
||||
scan = PCK_SHIFT_RIGHT;
|
||||
break;
|
||||
case PCK_LEFT:
|
||||
scan = PCK_SHIFT_LEFT;
|
||||
break;
|
||||
case PCK_HOME:
|
||||
scan = PCK_SHIFT_HOME;
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <errno.h>
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2025 Mark Nudelman
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
@@ -1074,6 +1074,10 @@ v689 12/27/25 Add prompt seqs %C, %W, %Q, ?Q; don't allow any command to
|
||||
add --without-termlib.
|
||||
v690 12/31/25 Cleanup.
|
||||
v691 1/10/26 Fix mingw build.
|
||||
v692 1/29/26 Fix memory leak in setupterm; clear termio ICRNL|INLCR;
|
||||
fix bug with negative value in -z; fix bug with empty
|
||||
terminfo caps; make lesstest ignore nl_langinfo;
|
||||
revert HOME/END to g/G; add keys & cmds to lesskey parser.
|
||||
*/
|
||||
|
||||
char version[] = "691";
|
||||
char version[] = "692";
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 1984-2026 Mark Nudelman
|
||||
*
|
||||
* You may distribute under the terms of either the GNU General Public
|
||||
* License or the Less License, as specified in the README file.
|
||||
*
|
||||
* For more information, see the README file.
|
||||
*/
|
||||
|
||||
#include "less.h"
|
||||
#include "xbuf.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user