diff options
| author | Xin LI <delphij@FreeBSD.org> | 2026-02-21 05:19:41 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2026-02-21 05:19:41 +0000 |
| commit | 4be8b0bdecb3af7c801de33f29a6821980840811 (patch) | |
| tree | ae589f1de6dfde020205bbbca700fc99d5cb3614 | |
| parent | c408e7413bcfb3bc52ed8b36e87e5be847dcb950 (diff) | |
| -rw-r--r-- | LICENSE | 2 | ||||
| -rw-r--r-- | Makefile.aut | 2 | ||||
| -rw-r--r-- | Makefile.in | 2 | ||||
| -rw-r--r-- | NEWS | 21 | ||||
| -rw-r--r-- | brac.c | 2 | ||||
| -rw-r--r-- | ch.c | 2 | ||||
| -rw-r--r-- | charset.c | 17 | ||||
| -rw-r--r-- | charset.h | 2 | ||||
| -rw-r--r-- | cmd.h | 4 | ||||
| -rw-r--r-- | cmdbuf.c | 2 | ||||
| -rw-r--r-- | command.c | 2 | ||||
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | cvt.c | 2 | ||||
| -rw-r--r-- | decode.c | 16 | ||||
| -rw-r--r-- | defines.ds | 2 | ||||
| -rw-r--r-- | defines.o2 | 2 | ||||
| -rw-r--r-- | defines.o9 | 2 | ||||
| -rw-r--r-- | defines.wn | 2 | ||||
| -rw-r--r-- | edit.c | 2 | ||||
| -rw-r--r-- | evar.c | 2 | ||||
| -rw-r--r-- | filename.c | 7 | ||||
| -rw-r--r-- | forwback.c | 2 | ||||
| -rw-r--r-- | help.c | 6 | ||||
| -rw-r--r-- | ifile.c | 2 | ||||
| -rw-r--r-- | input.c | 2 | ||||
| -rw-r--r-- | jump.c | 2 | ||||
| -rw-r--r-- | lang.h | 2 | ||||
| -rw-r--r-- | less.h | 2 | ||||
| -rw-r--r-- | less.hlp | 4 | ||||
| -rw-r--r-- | less.man | 940 | ||||
| -rw-r--r-- | less.nro | 14 | ||||
| -rw-r--r-- | lessecho.c | 2 | ||||
| -rw-r--r-- | lessecho.man | 2 | ||||
| -rw-r--r-- | lessecho.nro | 2 | ||||
| -rw-r--r-- | lesskey.c | 2 | ||||
| -rw-r--r-- | lesskey.h | 2 | ||||
| -rw-r--r-- | lesskey.man | 68 | ||||
| -rw-r--r-- | lesskey.nro | 68 | ||||
| -rw-r--r-- | lesskey_parse.c | 11 | ||||
| -rw-r--r-- | lesstest/display.c | 10 | ||||
| -rw-r--r-- | lesstest/env.c | 9 | ||||
| -rw-r--r-- | lesstest/lesstest.c | 9 | ||||
| -rw-r--r-- | lesstest/log.c | 9 | ||||
| -rw-r--r-- | lesstest/lt_screen.c | 9 | ||||
| -rw-r--r-- | lesstest/parse.c | 9 | ||||
| -rw-r--r-- | lesstest/pipeline.c | 12 | ||||
| -rw-r--r-- | lesstest/run.c | 9 | ||||
| -rw-r--r-- | lesstest/term.c | 9 | ||||
| -rw-r--r-- | lesstest/unicode.c | 9 | ||||
| -rw-r--r-- | lesstest/wchar.c | 9 | ||||
| -rw-r--r-- | lglob.h | 2 | ||||
| -rw-r--r-- | line.c | 2 | ||||
| -rw-r--r-- | linenum.c | 2 | ||||
| -rw-r--r-- | lsystem.c | 2 | ||||
| -rw-r--r-- | main.c | 2 | ||||
| -rw-r--r-- | mark.c | 2 | ||||
| -rwxr-xr-x | mkhelp.pl | 2 | ||||
| -rw-r--r-- | optfunc.c | 4 | ||||
| -rw-r--r-- | option.c | 8 | ||||
| -rw-r--r-- | option.h | 3 | ||||
| -rw-r--r-- | opttbl.c | 4 | ||||
| -rw-r--r-- | os.c | 2 | ||||
| -rw-r--r-- | output.c | 2 | ||||
| -rw-r--r-- | pattern.c | 2 | ||||
| -rw-r--r-- | pattern.h | 2 | ||||
| -rw-r--r-- | pckeys.h | 4 | ||||
| -rw-r--r-- | position.c | 2 | ||||
| -rw-r--r-- | position.h | 2 | ||||
| -rw-r--r-- | prompt.c | 2 | ||||
| -rw-r--r-- | screen.c | 41 | ||||
| -rw-r--r-- | scrsize.c | 2 | ||||
| -rw-r--r-- | search.c | 2 | ||||
| -rw-r--r-- | signal.c | 2 | ||||
| -rw-r--r-- | tags.c | 2 | ||||
| -rw-r--r-- | ttyin.c | 2 | ||||
| -rw-r--r-- | version.c | 8 | ||||
| -rw-r--r-- | xbuf.c | 9 | ||||
| -rw-r--r-- | xbuf.h | 9 |
78 files changed, 862 insertions, 599 deletions
@@ -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 diff --git a/Makefile.aut b/Makefile.aut index 9bd416b47338..863a18903d7e 100644 --- a/Makefile.aut +++ b/Makefile.aut @@ -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 diff --git a/Makefile.in b/Makefile.in index a9b416c5fd35..b2b843ef4b19 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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: @@ -11,6 +11,27 @@ ====================================================================== + 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 * Add --autosave option (github #678). @@ -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. diff --git a/charset.c b/charset.c index de1c27bdc61e..74159404148b 100644 --- a/charset.c +++ b/charset.c @@ -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 diff --git a/charset.h b/charset.h index 4acf494b4ed5..cf2e02547cb5 100644 --- a/charset.h +++ b/charset.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. @@ -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. diff --git a/command.c b/command.c index c19b97671c40..fcb6ec13569b 100644 --- a/command.c +++ b/command.c @@ -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. diff --git a/configure.ac b/configure.ac index c6dab7691595..e56c10a35d9e 100644 --- a/configure.ac +++ b/configure.ac @@ -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 */ diff --git a/defines.ds b/defines.ds index 2bd81e798007..753bf36e67f4 100644 --- a/defines.ds +++ b/defines.ds @@ -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. diff --git a/defines.o2 b/defines.o2 index 6b8cc520b51a..074e874a7d93 100644 --- a/defines.o2 +++ b/defines.o2 @@ -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. diff --git a/defines.o9 b/defines.o9 index ec257a0d8196..cb63b2f613d3 100644 --- a/defines.o9 +++ b/defines.o9 @@ -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. diff --git a/defines.wn b/defines.wn index e2bf72e1e53c..3d219ea0111c 100644 --- a/defines.wn +++ b/defines.wn @@ -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. diff --git a/filename.c b/filename.c index d9d824be6f50..ad1b4b3cf4a9 100644 --- a/filename.c +++ b/filename.c @@ -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))) { diff --git a/forwback.c b/forwback.c index 970353158a70..eef1d5de3847 100644 --- a/forwback.c +++ b/forwback.c @@ -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. @@ -107,11 +107,11 @@ width (see the [1m-# [22moption). If a number N is specified, it be‐ comes the default for future RIGHTARROW and LEFTARROW commands. - ESC‐} or ^RIGHTARROW or END + ESC‐} or ^RIGHTARROW or SHIFT‐RIGHTARROW Scroll horizontally right to show the end of the longest dis‐ played line. - ESC‐{ or ^LEFTARROW or HOME + ESC‐{ or ^LEFTARROW or SHIFT‐LEFTARROW Scroll horizontally left back to the first column. ^END or SHIFT‐END @@ -149,11 +149,11 @@ search pattern, the terminal bell is rung and forward scrolling stops. - g or < or ESC‐< + g or < or ESC‐< or HOME Go to line N in the file, default 1 (beginning of file). (Warn‐ ing: this may be slow if N is large.) - G or > or ESC‐> + G or > or ESC‐> or END Go to line N in the file, default the end of the file. (Warn‐ ing: this may be slow if N is large, or if N is not specified and standard input, rather than a file, is being read.) @@ -1228,21 +1228,21 @@ bility with some versions of [1mmore[22m(1). If the number [4mn[24m is nega‐ tive, it indicates [4mn[24m lines less than the current screen size. For example, if the screen is 24 lines, [1m-z-4 [22msets the scrolling - window to 20 lines. If the screen is resized to 40 lines, the - scrolling window automatically changes to 36 lines. + window to 20 lines. If the screen is later resized to 40 lines, + the scrolling window automatically changes to 36 lines. [1m-"[4m[22mcc[24m or [1m--quotes=[4m[22mcc[0m - Changes the filename quoting character. This may be necessary - if you are trying to name a file which contains both spaces and - quote characters. Followed by a single character, this changes - the quote character to that character. Filenames containing a + Changes the filename quoting character. This may be necessary + if you are trying to name a file which contains both spaces and + quote characters. Followed by a single character, this changes + the quote character to that character. Filenames containing a space should then be surrounded by that character rather than by - double quotes. Followed by two characters, changes the open - quote to the first character, and the close quote to the second + double quotes. Followed by two characters, changes the open + quote to the first character, and the close quote to the second character. Filenames containing a space should then be preceded - by the open quote character and followed by the close quote - character. Note that even after the quote characters are - changed, this option remains -" (a dash followed by a double + by the open quote character and followed by the close quote + character. Note that even after the quote characters are + changed, this option remains -" (a dash followed by a double quote). [1m-~ [22mor [1m--tilde[0m @@ -1252,22 +1252,22 @@ [1m-# [22mor [1m--shift[0m Specifies the default number of positions to scroll horizontally - in the RIGHTARROW and LEFTARROW commands. If the number speci‐ - fied is zero, it sets the default number of positions to one + in the RIGHTARROW and LEFTARROW commands. If the number speci‐ + fied is zero, it sets the default number of positions to one half of the screen width. Alternately, the number may be speci‐ - fied as a fraction of the width of the screen, starting with a - decimal point: .5 is half of the screen width, .3 is three - tenths of the screen width, and so on. If the number is speci‐ + fied as a fraction of the width of the screen, starting with a + decimal point: .5 is half of the screen width, .3 is three + tenths of the screen width, and so on. If the number is speci‐ fied as a fraction, the actual number of scroll positions is re‐ calculated if the terminal window is resized. [1m--autosave=[4m[22mactions[0m - Normally the history file is saved only when [1mless [22mexits. This + Normally the history file is saved only when [1mless [22mexits. This option specifies other actions which will cause the history file - to be saved. Each action is defined by a single character in + to be saved. Each action is defined by a single character in the [4mactions[24m string: - m Setting or clearing a mark while [1m--save‐marks [22mis in ef‐ + m Setting or clearing a mark while [1m--save‐marks [22mis in ef‐ fect. / Searching. @@ -1277,134 +1277,134 @@ * Any action; same as "m/!". Can be set to "‐" to specify the default, that only exiting [1mless[0m - will cause the history file to be saved. Note that, depending - on your shell, if you specify this option on the command line, + will cause the history file to be saved. Note that, depending + on your shell, if you specify this option on the command line, the "!" and "*" characters may need to be escaped or quoted. [1m--cmd=[4m[22mcommands[0m - The specified string is taken to be an initial command to [1mless[22m. - This is similar to specifying "+[4mcommands[24m", except that commands - specified by [1m--cmd [22mare not executed if [1mless [22mexits immediately - due to the use of the [1m-E [22mor [1m-F [22moption, while commands specified + The specified string is taken to be an initial command to [1mless[22m. + This is similar to specifying "+[4mcommands[24m", except that commands + specified by [1m--cmd [22mare not executed if [1mless [22mexits immediately + due to the use of the [1m-E [22mor [1m-F [22moption, while commands specified by the [1m+ [22moption are executed even if [1mless [22mexits immediately. [1m--exit-follow-on-close[0m - When using the "F" command on a pipe, [1mless [22mwill automatically - stop waiting for more data when the input side of the pipe is + When using the "F" command on a pipe, [1mless [22mwill automatically + stop waiting for more data when the input side of the pipe is closed. [1m--file-size[0m If [1m--file-size [22mis specified, [1mless [22mwill determine the size of the - file immediately after opening the file. Then the "=" command - will display the number of lines in the file. Normally this is - not done, because it can be slow if the input file is non‐seek‐ + file immediately after opening the file. Then the "=" command + will display the number of lines in the file. Normally this is + not done, because it can be slow if the input file is non‐seek‐ able (such as a pipe) and is large. [1m--follow-name[0m Normally, if the input file is renamed while an F command is ex‐ ecuting, [1mless [22mwill continue to display the contents of the orig‐ - inal file despite its name change. If [1m--follow-name [22mis speci‐ - fied, during an F command [1mless [22mwill periodically attempt to re‐ + inal file despite its name change. If [1m--follow-name [22mis speci‐ + fied, during an F command [1mless [22mwill periodically attempt to re‐ open the file by name. If the reopen succeeds and the file is a - different file from the original (which means that a new file - has been created with the same name as the original (now re‐ + different file from the original (which means that a new file + has been created with the same name as the original (now re‐ named) file), [1mless [22mwill display the contents of that new file. [1m--form-feed[0m - When scrolling forward or backward in the file, stop if a line - beginning with a form feed character (^L) is reached. This can - be useful when viewing a file which uses form feeds between + When scrolling forward or backward in the file, stop if a line + beginning with a form feed character (^L) is reached. This can + be useful when viewing a file which uses form feeds between pages. [1m--header=[4m[22mL[24m,[4mC[24m,[4mN[0m - Sets the number of header lines and columns displayed on the - screen. The number of header lines is set to [4mL[24m. If [4mL[24m is 0, + Sets the number of header lines and columns displayed on the + screen. The number of header lines is set to [4mL[24m. If [4mL[24m is 0, header lines are disabled. If [4mL[24m is empty or missing, the number - of header lines is unchanged. The number of header columns is + of header lines is unchanged. The number of header columns is set to [4mC[24m. If [4mC[24m is 0, header columns are disabled. If [4mC[24m is emp‐ - ty or missing, the number of header columns is unchanged. The - first header line is set to line number [4mN[24m in the file. If [4mN[24m is - empty or missing, it is taken to be the number of the line cur‐ + ty or missing, the number of header columns is unchanged. The + first header line is set to line number [4mN[24m in the file. If [4mN[24m is + empty or missing, it is taken to be the number of the line cur‐ rently displayed in the first line of the screen (if the [1m--head‐[0m - [1mer [22mcommand has been issued from within [1mless[22m), or 1 (if the - [1m--header [22moption has been given on the command line). The spe‐ + [1mer [22mcommand has been issued from within [1mless[22m), or 1 (if the + [1m--header [22moption has been given on the command line). The spe‐ cial form "[1m--header=-[22m" disables header lines and header columns, and is equivalent to "[1m--header=0,0[22m". - When [4mL[24m is nonzero, the first [4mL[24m lines at the top of the screen - are replaced with the [4mL[24m lines of the file beginning at line [4mN[24m, + When [4mL[24m is nonzero, the first [4mL[24m lines at the top of the screen + are replaced with the [4mL[24m lines of the file beginning at line [4mN[24m, regardless of what part of the file is being viewed. When head‐ er lines are displayed, any file contents before the header line - cannot be viewed. When [4mC[24m is nonzero, the first [4mC[24m characters - displayed at the beginning of each line are replaced with the - first [4mC[24m characters of the line, even if the rest of the line is + cannot be viewed. When [4mC[24m is nonzero, the first [4mC[24m characters + displayed at the beginning of each line are replaced with the + first [4mC[24m characters of the line, even if the rest of the line is scrolled horizontally. - While the [1m--header [22moption is active, lines longer than the + While the [1m--header [22moption is active, lines longer than the screen width are truncated, and the [1m-S [22moption is ignored. [1m--incsearch[0m - Subsequent search commands will be "incremental"; that is, [1mless[0m - will advance to the next line containing the search pattern as + Subsequent search commands will be "incremental"; that is, [1mless[0m + will advance to the next line containing the search pattern as each character of the pattern is typed in. [1m--intr=[4m[22mc[0m - Use the character [4mc[24m instead of ^X to interrupt a read when the - "Waiting for data" message is displayed. [4mc[24m must be an ASCII - character; that is, one with a value between 1 and 127 inclu‐ - sive. A caret followed by a single character can be used to + Use the character [4mc[24m instead of ^X to interrupt a read when the + "Waiting for data" message is displayed. [4mc[24m must be an ASCII + character; that is, one with a value between 1 and 127 inclu‐ + sive. A caret followed by a single character can be used to specify a control character. [1m--line-num-width=[4m[22mn[0m - Sets the minimum width of the line number field when the -N op‐ + Sets the minimum width of the line number field when the -N op‐ tion is in effect to [4mn[24m characters. The default is 7. [1m--match-shift=[4m[22mn[0m - When [1m-S [22mis in effect, if a search match is not visible because - it is shifted to the left or right of the currently visible - screen, the text will horizontally shift to ensure that the - search match is visible. This option selects the column in + When [1m-S [22mis in effect, if a search match is not visible because + it is shifted to the left or right of the currently visible + screen, the text will horizontally shift to ensure that the + search match is visible. This option selects the column in which the first character of the search match will be placed af‐ ter the shift. In other words, there will be [4mn[24m characters visi‐ ble to the left of the search match. - Alternately, the number may be specified as a fraction of the - width of the screen, starting with a decimal point: .5 is half + Alternately, the number may be specified as a fraction of the + width of the screen, starting with a decimal point: .5 is half of the screen width, .3 is three tenths of the screen width, and - so on. If the number is specified as a fraction, the actual - number of scroll positions is recalculated if the terminal win‐ + so on. If the number is specified as a fraction, the actual + number of scroll positions is recalculated if the terminal win‐ dow is resized. [1m--modelines=[4m[22mn[0m - Before displaying a file, [1mless [22mwill read the first [4mn[24m lines to - try to find a vim‐compatible [4mmodeline[24m. If [4mn[24m is zero, [1mless [22mdoes + Before displaying a file, [1mless [22mwill read the first [4mn[24m lines to + try to find a vim‐compatible [4mmodeline[24m. If [4mn[24m is zero, [1mless [22mdoes not try to find modelines. By using a modeline, the file itself can specify the tab stops that should be used when viewing it. A modeline contains, anywhere in the line, a program name ("vi", - "vim", "ex", or "less"), followed by a colon, possibly followed - by the word "set", and finally followed by zero or more option - settings. If the word "set" is used, option settings are sepa‐ - rated by spaces, and end at the first colon. If the word "set" - is not used, option settings may be separated by either spaces - or colons. The word "set" is required if the program name is - "less" but optional if any of the other three names are used. + "vim", "ex", or "less"), followed by a colon, possibly followed + by the word "set", and finally followed by zero or more option + settings. If the word "set" is used, option settings are sepa‐ + rated by spaces, and end at the first colon. If the word "set" + is not used, option settings may be separated by either spaces + or colons. The word "set" is required if the program name is + "less" but optional if any of the other three names are used. If any option setting is of the form "tabstop=[4mn[24m" or "ts=[4mn[24m", then - tab stops are automatically set as if [1m--tabs=[4m[22mn[24m had been given. + tab stops are automatically set as if [1m--tabs=[4m[22mn[24m had been given. See the [1m--tabs [22mdescription for acceptable values of [4mn[24m. [1m--mouse[0m - Enables mouse input: scrolling the mouse wheel down moves for‐ - ward in the file, scrolling the mouse wheel up moves backwards - in the file, left‐click sets the "#" mark to the line where the - mouse is clicked, and right‐click (or any other) returns to the - "#" mark position. Holding down the left button and dragging - also moves in the file. If a left‐click is performed with the + Enables mouse input: scrolling the mouse wheel down moves for‐ + ward in the file, scrolling the mouse wheel up moves backwards + in the file, left‐click sets the "#" mark to the line where the + mouse is clicked, and right‐click (or any other) returns to the + "#" mark position. Holding down the left button and dragging + also moves in the file. If a left‐click is performed with the mouse cursor on an OSC 8 hyperlink, the hyperlink is selected as - if by the ^O^N command. If a left‐click is performed with the - mouse cursor on an OSC 8 hyperlink which is already selected, - the hyperlink is opened as if by the ^O^O command. The number - of lines to scroll when the wheel is moved can be set by the + if by the ^O^N command. If a left‐click is performed with the + mouse cursor on an OSC 8 hyperlink which is already selected, + the hyperlink is opened as if by the ^O^O command. The number + of lines to scroll when the wheel is moved can be set by the [1m--wheel-lines [22moption. Mouse input works only on terminals which support X11 mouse reporting, and on Windows. @@ -1414,37 +1414,37 @@ [1m--no-edit-warn[0m Don’t print a warning message when using the v command on a file - which was opened using a LESSOPEN preprocessor (see the INPUT + which was opened using a LESSOPEN preprocessor (see the INPUT PREPROCESSOR section below). [1m--no-keypad[0m - Disables sending the keypad initialization and deinitialization + Disables sending the keypad initialization and deinitialization strings to the terminal. This is sometimes useful if the keypad strings make the numeric keypad behave in an undesirable manner. [1m--no-histdups[0m - This option changes the behavior so that if a search string or - file name is typed in, and the same string is already in the + This option changes the behavior so that if a search string or + file name is typed in, and the same string is already in the history list, the existing copy is removed from the history list - before the new one is added. Thus, a given string will appear - only once in the history list. Normally, a string may appear + before the new one is added. Thus, a given string will appear + only once in the history list. Normally, a string may appear multiple times. [1m--no-number-headers[0m - Header lines (defined via the [1m--header [22moption) are not assigned + Header lines (defined via the [1m--header [22moption) are not assigned line numbers. Line number 1 is assigned to the first line after any header lines. [1m--no-paste[0m If the terminal supports [1mxterm[22m‐compatible "bracketed paste", any - text pasted into [1mless [22mis ignored, except that one line of text - may be pasted into the command line at the bottom of the screen - (search strings, file names, etc). That is, the first newline - of text pasted into the command line and any text that follows + text pasted into [1mless [22mis ignored, except that one line of text + may be pasted into the command line at the bottom of the screen + (search strings, file names, etc). That is, the first newline + of text pasted into the command line and any text that follows it is ignored. [1m--no-search-header-lines[0m - Searches do not include header lines, but still include header + Searches do not include header lines, but still include header columns. [1m--no-search-header-columns[0m @@ -1458,68 +1458,68 @@ Disables the terminal’s visual bell. [1m--proc-backspace[0m - If set, backspaces are handled as if neither the [1m-u [22moption nor + If set, backspaces are handled as if neither the [1m-u [22moption nor the [1m-U [22moption were set. That is, a backspace adjacent to an un‐ - derscore causes text to be displayed in underline mode, and a - backspace between identical characters cause text to be dis‐ - played in boldface mode. This option overrides the [1m-u [22mand [1m-U[0m - options, so that display of backspaces can be controlled sepa‐ + derscore causes text to be displayed in underline mode, and a + backspace between identical characters cause text to be dis‐ + played in boldface mode. This option overrides the [1m-u [22mand [1m-U[0m + options, so that display of backspaces can be controlled sepa‐ rate from tabs and carriage returns. If not set, backspace dis‐ play is controlled by the [1m-u [22mand [1m-U [22moptions. [1m--PROC-BACKSPACE[0m - If set, backspaces are handled as if the [1m-U [22moption were set; + If set, backspaces are handled as if the [1m-U [22moption were set; that is backspaces are treated as control characters. [1m--proc-return[0m If set, carriage returns are handled as if neither the [1m-u [22moption - nor the [1m-U [22moption were set. That is, a carriage return immedi‐ + nor the [1m-U [22moption were set. That is, a carriage return immedi‐ ately before a newline is deleted. This option overrides the [1m-u[0m - and [1m-U [22moptions, so that display of carriage returns can be con‐ - trolled separate from that of backspaces and tabs. If not set, + and [1m-U [22moptions, so that display of carriage returns can be con‐ + trolled separate from that of backspaces and tabs. If not set, carriage return display is controlled by the [1m-u [22mand [1m-U [22moptions. [1m--PROC-RETURN[0m - If set, carriage returns are handled as if the [1m-U [22moption were + If set, carriage returns are handled as if the [1m-U [22moption were set; that is carriage returns are treated as control characters. [1m--proc-tab[0m If set, tabs are handled as if the [1m-U [22moption were not set. That - is, tabs are expanded to spaces. This option overrides the [1m-U[0m - option, so that display of tabs can be controlled separate from - that of backspaces and carriage returns. If not set, tab dis‐ + is, tabs are expanded to spaces. This option overrides the [1m-U[0m + option, so that display of tabs can be controlled separate from + that of backspaces and carriage returns. If not set, tab dis‐ play is controlled by the [1m-U [22moption. [1m--PROC-TAB[0m - If set, tabs are handled as if the [1m-U [22moption were set; that is + If set, tabs are handled as if the [1m-U [22moption were set; that is tabs are treated as control characters. [1m--redraw-on-quit[0m When quitting, after sending the terminal deinitialization string, redraws the entire last screen. On terminals whose ter‐ minal deinitialization string causes the terminal to switch from - an alternate screen, this makes the last screenful of the cur‐ + an alternate screen, this makes the last screenful of the cur‐ rent file remain visible after [1mless [22mhas quit. [1m--rscroll=[4m[22mc[0m - This option changes the character used to mark truncated lines. + This option changes the character used to mark truncated lines. It may begin with a two‐character attribute indicator like LESS‐ - BINFMT does. If there is no attribute indicator, standout is + BINFMT does. If there is no attribute indicator, standout is used. If set to "-", truncated lines are not marked. [1m--save-marks[0m - Save marks in the history file, so marks are retained across + Save marks in the history file, so marks are retained across different invocations of [1mless[22m. [1m--search-options=[4m[22m...[0m - Sets default search modifiers. The value is a string of one or + Sets default search modifiers. The value is a string of one or more of the characters E, F, K, N, R or W. Setting any of these - has the same effect as typing that control character at the be‐ - ginning of every search pattern. For example, setting - [1m--search-options=[4m[22mW[24m is the same as typing ^W at the beginning of + has the same effect as typing that control character at the be‐ + ginning of every search pattern. For example, setting + [1m--search-options=[4m[22mW[24m is the same as typing ^W at the beginning of every pattern. The value may also contain a digit between 1 and 5, which has the same effect as typing ^S followed by that digit - at the beginning of every search pattern. The value "-" dis‐ + at the beginning of every search pattern. The value "-" dis‐ ables all default search modifiers. [1m--show-preproc-errors[0m @@ -1531,65 +1531,65 @@ fect. The default is 2 characters. [1m--status-line[0m - If a line is marked, the entire line (rather than just the sta‐ - tus column) is highlighted. Also lines highlighted due to the + If a line is marked, the entire line (rather than just the sta‐ + tus column) is highlighted. Also lines highlighted due to the [1m-w [22moption will have the entire line highlighted. If [1m--use-color[0m is set, the line is colored rather than highlighted. [1m--use-backslash[0m - This option changes the interpretations of options which follow + This option changes the interpretations of options which follow this one. After the [1m--use-backslash [22moption, any backslash in an - option string is removed and the following character is taken - literally. This allows a dollar sign to be included in option + option string is removed and the following character is taken + literally. This allows a dollar sign to be included in option strings. [1m--use-color[0m - Enables colored text in various places. The [1m-D [22moption can be - used to change the colors. Colored text works only if the ter‐ - minal supports ANSI color escape sequences (as defined in + Enables colored text in various places. The [1m-D [22moption can be + used to change the colors. Colored text works only if the ter‐ + minal supports ANSI color escape sequences (as defined in https://www.ecma-international.org/publications-and-standards/ standards/ecma-48). [1m--wheel-lines=[4m[22mn[0m - Set the number of lines to scroll when the mouse wheel is - scrolled and the [1m--mouse [22mor [1m--MOUSE [22moption is in effect. The + Set the number of lines to scroll when the mouse wheel is + scrolled and the [1m--mouse [22mor [1m--MOUSE [22moption is in effect. The default is 1 line. [1m--wordwrap[0m - When the [1m-S [22moption is not in use, wrap each line at a space or - tab if possible, so that a word is not split between two lines. + When the [1m-S [22moption is not in use, wrap each line at a space or + tab if possible, so that a word is not split between two lines. The default is to wrap at any character. - [1m-- [22mA command line argument of "[1m--[22m" marks the end of option argu‐ - ments. Any arguments following this are interpreted as file‐ + [1m-- [22mA command line argument of "[1m--[22m" marks the end of option argu‐ + ments. Any arguments following this are interpreted as file‐ names. This can be useful when viewing a file whose name begins with a "-" or "+". Otherwise, option arguments and filename ar‐ guments can be intermixed; that is, option arguments do not need - to appear before filename arguments, unless the environment + to appear before filename arguments, unless the environment variable POSIXLY_CORRECT is set. - + If a command line option begins with [1m+[22m, the remainder of that - option is taken to be an initial command to [1mless[22m. For example, - +G tells [1mless [22mto start at the end of the file rather than the - beginning, and +/xyz tells it to start at the first occurrence - of "xyz" in the file. As a special case, +<number> acts like + + If a command line option begins with [1m+[22m, the remainder of that + option is taken to be an initial command to [1mless[22m. For example, + +G tells [1mless [22mto start at the end of the file rather than the + beginning, and +/xyz tells it to start at the first occurrence + of "xyz" in the file. As a special case, +<number> acts like +<number>g; that is, it starts the display at the specified line - number (however, see the caveat under the "g" command above). - If the option starts with ++, the initial command applies to - every file being viewed, not just the first one. The + command + number (however, see the caveat under the "g" command above). + If the option starts with ++, the initial command applies to + every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an ini‐ tial command for every file. Also see the [1m--cmd [22moption. [1mLINE EDITING[0m - When entering a command line at the bottom of the screen (for example, - a filename for the :e command, or the pattern for a search command), + When entering a command line at the bottom of the screen (for example, + a filename for the :e command, or the pattern for a search command), certain keys can be used to manipulate the command line. Most commands - have an alternate form in [ brackets ] which can be used if a key does - not exist on a particular keyboard. (Note that the forms beginning - with ESC do not work on some MS‐DOS and Windows systems because ESC is - the line erase character.) Any of these special keys may be entered - literally by preceding it with the "literal" character, either ^V or - ^A. A backslash itself may also be entered literally by entering two + have an alternate form in [ brackets ] which can be used if a key does + not exist on a particular keyboard. (Note that the forms beginning + with ESC do not work on some MS‐DOS and Windows systems because ESC is + the line erase character.) Any of these special keys may be entered + literally by preceding it with the "literal" character, either ^V or + ^A. A backslash itself may also be entered literally by entering two backslashes. LEFTARROW [ ESC‐h ] @@ -1599,7 +1599,7 @@ Move the cursor one space to the right. ^LEFTARROW [ ESC‐b or ESC‐LEFTARROW ] - (That is, CONTROL and LEFTARROW simultaneously.) Move the cur‐ + (That is, CONTROL and LEFTARROW simultaneously.) Move the cur‐ sor one word to the left. ^RIGHTARROW [ ESC‐w or ESC‐RIGHTARROW ] @@ -1613,127 +1613,127 @@ Move the cursor to the end of the line. BACKSPACE - Delete the character to the left of the cursor, or cancel the + Delete the character to the left of the cursor, or cancel the command if the command line is empty. DELETE or [ ESC‐x ] Delete the character under the cursor. ^BACKSPACE [ ESC‐BACKSPACE ] - (That is, CONTROL and BACKSPACE simultaneously.) Delete the + (That is, CONTROL and BACKSPACE simultaneously.) Delete the word to the left of the cursor. ^DELETE [ ESC‐X or ESC‐DELETE ] - (That is, CONTROL and DELETE simultaneously.) Delete the word + (That is, CONTROL and DELETE simultaneously.) Delete the word under the cursor. UPARROW [ ESC‐k ] - Retrieve the previous command line. If you first enter some - text and then press UPARROW, it will retrieve the previous com‐ + Retrieve the previous command line. If you first enter some + text and then press UPARROW, it will retrieve the previous com‐ mand which begins with that text. DOWNARROW [ ESC‐j ] - Retrieve the next command line. If you first enter some text - and then press DOWNARROW, it will retrieve the next command + Retrieve the next command line. If you first enter some text + and then press DOWNARROW, it will retrieve the next command which begins with that text. - TAB Complete the partial filename to the left of the cursor. If it - matches more than one filename, the first match is entered into - the command line. Repeated TABs will cycle thru the other + TAB Complete the partial filename to the left of the cursor. If it + matches more than one filename, the first match is entered into + the command line. Repeated TABs will cycle thru the other matching filenames. If the completed filename is a directory, a - "/" is appended to the filename. (On MS‐DOS and Windows sys‐ - tems, a "\" is appended.) The environment variable LESSSEPARA‐ - TOR can be used to specify a different character to append to a + "/" is appended to the filename. (On MS‐DOS and Windows sys‐ + tems, a "\" is appended.) The environment variable LESSSEPARA‐ + TOR can be used to specify a different character to append to a directory name. BACKTAB (SHIFT‐TAB) [ ESC‐TAB ] - Like TAB, but cycles in the reverse direction thru the matching + Like TAB, but cycles in the reverse direction thru the matching filenames. - ^L Complete the partial filename to the left of the cursor. If it + ^L Complete the partial filename to the left of the cursor. If it matches more than one filename, all matches are entered into the command line (if they fit). ^U (Unix and OS/2) or ESC (MS‐DOS and Windows) - Delete the entire command line, or cancel the command if the - cursor is at the beginning of the command line. If you have + Delete the entire command line, or cancel the command if the + cursor is at the beginning of the command line. If you have changed your line‐kill character in Unix to something other than ^U, that character is used instead of ^U. ^G Delete the entire command line and return to the main prompt. [1mKEY BINDINGS[0m - You may define your own [1mless [22mcommands by creating a lesskey source - file. This file specifies a set of command keys and an action associ‐ - ated with each key. You may also change the line‐editing keys (see - LINE EDITING), and set environment variables used by [1mless[22m. See the + You may define your own [1mless [22mcommands by creating a lesskey source + file. This file specifies a set of command keys and an action associ‐ + ated with each key. You may also change the line‐editing keys (see + LINE EDITING), and set environment variables used by [1mless[22m. See the [1mlesskey[22m(1) manual page for details about the file format. - If the environment variable LESSKEYIN is set, [1mless [22muses that as the - name of the lesskey source file. Otherwise, [1mless [22mlooks in a standard - place for the lesskey source file: On Unix systems, [1mless [22mlooks for a - lesskey file called "$XDG_CONFIG_HOME/lesskey" or "$HOME/.con‐ - fig/lesskey" or "$HOME/.lesskey". On MS‐DOS and Windows systems, [1mless[0m - looks for a lesskey file called "$HOME/_lesskey", and if it is not + If the environment variable LESSKEYIN is set, [1mless [22muses that as the + name of the lesskey source file. Otherwise, [1mless [22mlooks in a standard + place for the lesskey source file: On Unix systems, [1mless [22mlooks for a + lesskey file called "$XDG_CONFIG_HOME/lesskey" or "$HOME/.con‐ + fig/lesskey" or "$HOME/.lesskey". On MS‐DOS and Windows systems, [1mless[0m + looks for a lesskey file called "$HOME/_lesskey", and if it is not found there, then looks for a lesskey file called "_lesskey" in any di‐ - rectory specified in the PATH environment variable. On OS/2 systems, - [1mless [22mlooks for a lesskey file called "$HOME/lesskey.ini", and if it is - not found, then looks for a lesskey file called "lesskey.ini" in any - directory specified in the INIT environment variable, and if it not - found there, then looks for a lesskey file called "lesskey.ini" in any + rectory specified in the PATH environment variable. On OS/2 systems, + [1mless [22mlooks for a lesskey file called "$HOME/lesskey.ini", and if it is + not found, then looks for a lesskey file called "lesskey.ini" in any + directory specified in the INIT environment variable, and if it not + found there, then looks for a lesskey file called "lesskey.ini" in any directory specified in the PATH environment variable. - A system‐wide lesskey source file may also be set up to provide key - bindings. If a key is defined in both a local lesskey file and in the - system‐wide file, key bindings in the local file take precedence over - those in the system‐wide file. If the environment variable - LESSKEYIN_SYSTEM is set, [1mless [22muses that as the name of the system‐wide - lesskey file. Otherwise, [1mless [22mlooks in a standard place for the sys‐ + A system‐wide lesskey source file may also be set up to provide key + bindings. If a key is defined in both a local lesskey file and in the + system‐wide file, key bindings in the local file take precedence over + those in the system‐wide file. If the environment variable + LESSKEYIN_SYSTEM is set, [1mless [22muses that as the name of the system‐wide + lesskey file. Otherwise, [1mless [22mlooks in a standard place for the sys‐ tem‐wide lesskey file: On Unix systems, the system‐wide lesskey file is - /usr/local/etc/syslesskey. (However, if [1mless [22mwas built with a differ‐ - ent sysconf directory than /usr/local/etc, that directory is where the + /usr/local/etc/syslesskey. (However, if [1mless [22mwas built with a differ‐ + ent sysconf directory than /usr/local/etc, that directory is where the sysless file is found.) On MS‐DOS and Windows systems, the system‐wide - lesskey file is c:\_syslesskey. On OS/2 systems, the system‐wide + lesskey file is c:\_syslesskey. On OS/2 systems, the system‐wide lesskey file is c:\syslesskey.ini. - Older versions of [1mless [22m(before v582) used lesskey files with a binary - format, produced by the [1mlesskey [22mprogram. It is no longer necessary to + Older versions of [1mless [22m(before v582) used lesskey files with a binary + format, produced by the [1mlesskey [22mprogram. It is no longer necessary to use the [1mlesskey [22mprogram. [1mINPUT PREPROCESSOR[0m - You may define an "input preprocessor" for [1mless[22m. Before [1mless [22mopens a - file, it first gives the input preprocessor a chance to modify the way - the contents of the file are displayed. An input preprocessor is sim‐ - ply an executable program (or shell script), which writes the contents + You may define an "input preprocessor" for [1mless[22m. Before [1mless [22mopens a + file, it first gives the input preprocessor a chance to modify the way + the contents of the file are displayed. An input preprocessor is sim‐ + ply an executable program (or shell script), which writes the contents of the file to a different file, called the replacement file. The con‐ - tents of the replacement file are then displayed in place of the con‐ - tents of the original file. However, it will appear to the user as if - the original file is opened; that is, [1mless [22mwill display the original + tents of the replacement file are then displayed in place of the con‐ + tents of the original file. However, it will appear to the user as if + the original file is opened; that is, [1mless [22mwill display the original filename as the name of the current file. - An input preprocessor receives one command line argument, the original - filename, as entered by the user. It should create the replacement - file, and when finished, print the name of the replacement file to its - standard output. If the input preprocessor does not output a replace‐ - ment filename, [1mless [22muses the original file, as normal. The input pre‐ - processor is not called when viewing standard input. To set up an in‐ - put preprocessor, set the LESSOPEN environment variable to a command - line which will invoke your input preprocessor. This command line - should include one occurrence of the string "%s", which will be re‐ + An input preprocessor receives one command line argument, the original + filename, as entered by the user. It should create the replacement + file, and when finished, print the name of the replacement file to its + standard output. If the input preprocessor does not output a replace‐ + ment filename, [1mless [22muses the original file, as normal. The input pre‐ + processor is not called when viewing standard input. To set up an in‐ + put preprocessor, set the LESSOPEN environment variable to a command + line which will invoke your input preprocessor. This command line + should include one occurrence of the string "%s", which will be re‐ placed by the filename when the input preprocessor command is invoked. When [1mless [22mcloses a file opened in such a way, it will call another pro‐ - gram, called the input postprocessor, which may perform any desired - clean‐up action (such as deleting the replacement file created by + gram, called the input postprocessor, which may perform any desired + clean‐up action (such as deleting the replacement file created by LESSOPEN). This program receives two command line arguments, the orig‐ - inal filename as entered by the user, and the name of the replacement - file. To set up an input postprocessor, set the LESSCLOSE environment - variable to a command line which will invoke your input postprocessor. - It may include two occurrences of the string "%s"; the first is re‐ - placed with the original name of the file and the second with the name + inal filename as entered by the user, and the name of the replacement + file. To set up an input postprocessor, set the LESSCLOSE environment + variable to a command line which will invoke your input postprocessor. + It may include two occurrences of the string "%s"; the first is re‐ + placed with the original name of the file and the second with the name of the replacement file, which was output by LESSOPEN. - For example, on many Unix systems, these two scripts will allow you to + For example, on many Unix systems, these two scripts will allow you to keep files in compressed format, but still let [1mless [22mview them directly: lessopen.sh: @@ -1753,27 +1753,27 @@ #! /bin/sh rm $2 - To use these scripts, put them both where they can be executed and set + To use these scripts, put them both where they can be executed and set LESSOPEN="lessopen.sh %s", and LESSCLOSE="lessclose.sh %s %s". More - complex LESSOPEN and LESSCLOSE scripts may be written to accept other + complex LESSOPEN and LESSCLOSE scripts may be written to accept other types of compressed files, and so on. - It is also possible to set up an input preprocessor to pipe the file - data directly to [1mless[22m, rather than putting the data into a replacement + It is also possible to set up an input preprocessor to pipe the file + data directly to [1mless[22m, rather than putting the data into a replacement file. This avoids the need to decompress the entire file before start‐ ing to view it. An input preprocessor that works this way is called an - input pipe. An input pipe, instead of writing the name of a replace‐ + input pipe. An input pipe, instead of writing the name of a replace‐ ment file on its standard output, writes the entire contents of the re‐ - placement file on its standard output. If the input pipe does not - write any characters on its standard output, then there is no replace‐ - ment file and [1mless [22muses the original file, as normal. To use an input - pipe, make the first character in the LESSOPEN environment variable a - vertical bar (|) to signify that the input preprocessor is an input - pipe. As with non‐pipe input preprocessors, the command string must - contain one occurrence of %s, which is replaced with the filename of + placement file on its standard output. If the input pipe does not + write any characters on its standard output, then there is no replace‐ + ment file and [1mless [22muses the original file, as normal. To use an input + pipe, make the first character in the LESSOPEN environment variable a + vertical bar (|) to signify that the input preprocessor is an input + pipe. As with non‐pipe input preprocessors, the command string must + contain one occurrence of %s, which is replaced with the filename of the input file. - For example, on many Unix systems, this script will work like the pre‐ + For example, on many Unix systems, this script will work like the pre‐ vious example scripts: lesspipe.sh: @@ -1790,29 +1790,29 @@ LESSOPEN="|lesspipe.sh %s". Note that a preprocessor cannot output an empty file, since that is in‐ - terpreted as meaning there is no replacement, and the original file is - used. To avoid this, if LESSOPEN starts with two vertical bars, the - exit status of the script determines the behavior when the output is - empty. If the output is empty and the exit status is zero, the empty - output is considered to be replacement text. If the output is empty + terpreted as meaning there is no replacement, and the original file is + used. To avoid this, if LESSOPEN starts with two vertical bars, the + exit status of the script determines the behavior when the output is + empty. If the output is empty and the exit status is zero, the empty + output is considered to be replacement text. If the output is empty and the exit status is nonzero, the original file is used. For compat‐ - ibility with previous versions of [1mless[22m, if LESSOPEN starts with only + ibility with previous versions of [1mless[22m, if LESSOPEN starts with only one vertical bar, the exit status of the preprocessor is ignored. - When an input pipe is used, a LESSCLOSE postprocessor can be used, but + When an input pipe is used, a LESSCLOSE postprocessor can be used, but it is usually not necessary since there is no replacement file to clean - up. In this case, the replacement file name passed to the LESSCLOSE + up. In this case, the replacement file name passed to the LESSCLOSE postprocessor is "-". - For compatibility with previous versions of [1mless[22m, the input preproces‐ + For compatibility with previous versions of [1mless[22m, the input preproces‐ sor or pipe is not used if [1mless [22mis viewing standard input. However, if - the first character of LESSOPEN is a dash (-), the input preprocessor - is used on standard input as well as other files. In this case, the - dash is not considered to be part of the preprocessor command. If + the first character of LESSOPEN is a dash (-), the input preprocessor + is used on standard input as well as other files. In this case, the + dash is not considered to be part of the preprocessor command. If standard input is being viewed, the input preprocessor is passed a file - name consisting of a single dash. Similarly, if the first two charac‐ - ters of LESSOPEN are vertical bar and dash (|-) or two vertical bars - and a dash (||-), the input pipe is used on standard input as well as + name consisting of a single dash. Similarly, if the first two charac‐ + ters of LESSOPEN are vertical bar and dash (|-) or two vertical bars + and a dash (||-), the input pipe is used on standard input as well as other files. Again, in this case the dash is not considered to be part of the input pipe command. @@ -1823,11 +1823,11 @@ can be displayed directly to the screen. control characters - should not be displayed directly, but are expected to be found + should not be displayed directly, but are expected to be found in ordinary text files (such as backspace and tab). binary characters - should not be displayed directly and are not expected to be + should not be displayed directly and are not expected to be found in text files. composing characters @@ -1838,17 +1838,17 @@ are simply deleted from the input and not displayed. (Only when LESSCHARSET is "utf8".) - A "character set" is a description of which of these categories each + A "character set" is a description of which of these categories each character belongs to. The LESSCHARSET environment variable may be used to select a character set. Possible values for LESSCHARSET are: - ascii BS, TAB, NL, CR, and formfeed are control characters, all chars - with values between 32 and 126 are normal, and all others are + ascii BS, TAB, NL, CR, and formfeed are control characters, all chars + with values between 32 and 126 are normal, and all others are binary. iso8859 - Selects an ISO 8859 character set. This is the same as ASCII, - except characters between 160 and 255 are treated as normal + Selects an ISO 8859 character set. This is the same as ASCII, + except characters between 160 and 255 are treated as normal characters. latin1 Same as iso8859. @@ -1860,8 +1860,8 @@ ebcdic Selects an EBCDIC character set. IBM-1047 - Selects an EBCDIC character set used by OS/390 Unix Services. - This is the EBCDIC analogue of latin1. You get similar results + Selects an EBCDIC character set used by OS/390 Unix Services. + This is the EBCDIC analogue of latin1. You get similar results by setting either LESSCHARSET=IBM-1047 or LC_CTYPE=en_US in your environment. @@ -1869,29 +1869,29 @@ next Selects a character set appropriate for NeXT computers. - utf-8 Selects the UTF‐8 encoding of the ISO 10646 character set. - UTF‐8 is special in that it supports multi‐byte characters in + utf-8 Selects the UTF‐8 encoding of the ISO 10646 character set. + UTF‐8 is special in that it supports multi‐byte characters in the input file. It is the only character set that supports mul‐ ti‐byte characters. windows - Selects a character set appropriate for Microsoft Windows (cp + Selects a character set appropriate for Microsoft Windows (cp 1252). - In rare cases, it may be desired to tailor [1mless [22mto use a character set - other than the ones definable by LESSCHARSET. In this case, the envi‐ + In rare cases, it may be desired to tailor [1mless [22mto use a character set + other than the ones definable by LESSCHARSET. In this case, the envi‐ ronment variable LESSCHARDEF can be used to define a character set. It should be set to a string where each character in the string represents - one character in the character set. The character "." is used for a - normal character, "c" for control, and "b" for binary. A decimal num‐ - ber may be used for repetition. For example, "bccc4b." would mean - character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are bina‐ + one character in the character set. The character "." is used for a + normal character, "c" for control, and "b" for binary. A decimal num‐ + ber may be used for repetition. For example, "bccc4b." would mean + character 0 is binary, 1, 2 and 3 are control, 4, 5, 6 and 7 are bina‐ ry, and 8 is normal. All characters after the last are taken to be the - same as the last, so characters 9 through 255 would be normal. (This - is an example, and does not necessarily represent any real character + same as the last, so characters 9 through 255 would be normal. (This + is an example, and does not necessarily represent any real character set.) - This table shows the value of LESSCHARDEF which is equivalent to each + This table shows the value of LESSCHARDEF which is equivalent to each of the possible values for LESSCHARSET: ascii 8bcccbcc18b95.b dos 8bcccbcc12bc5b95.b. @@ -1904,57 +1904,57 @@ latin1 8bcccbcc18b95.33b. next 8bcccbcc18b95.bb125.bb - If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings - "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_CTYPE or + If neither LESSCHARSET nor LESSCHARDEF is set, but any of the strings + "UTF-8", "UTF8", "utf-8" or "utf8" is found in the LC_ALL, LC_CTYPE or LANG environment variables, then the default character set is utf-8. - If that string is not found, but your system supports the [1msetlocale[22m(3) - interface, [1mless [22mwill use setlocale to determine the character set. - setlocale is controlled by setting the LANG or LC_CTYPE environment + If that string is not found, but your system supports the [1msetlocale[22m(3) + interface, [1mless [22mwill use setlocale to determine the character set. + setlocale is controlled by setting the LANG or LC_CTYPE environment variables. - Finally, if the [1msetlocale [22minterface is also not available, the default + Finally, if the [1msetlocale [22minterface is also not available, the default character set is utf-8. - Control and binary characters are displayed in standout (reverse + Control and binary characters are displayed in standout (reverse video). Each such character is displayed in caret notation if possible - (e.g. ^A for control‐A). Caret notation is used only if inverting the + (e.g. ^A for control‐A). Caret notation is used only if inverting the 0100 bit results in a normal printable character. Otherwise, the char‐ - acter is displayed as a hex number in angle brackets. This format can - be changed by setting the LESSBINFMT environment variable. LESSBINFMT + acter is displayed as a hex number in angle brackets. This format can + be changed by setting the LESSBINFMT environment variable. LESSBINFMT may begin with a "*" and one character to select the display attribute: - "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout, - and "*n" is normal. If LESSBINFMT does not begin with a "*", normal - attribute is assumed. The remainder of LESSBINFMT is a string which - may include one printf‐style escape sequence (a % followed by x, X, o, - d, etc.). For example, if LESSBINFMT is "*u[%x]", binary characters - are displayed in underlined hexadecimal surrounded by brackets. The - default if no LESSBINFMT is specified is "*s<%02X>". Warning: the re‐ - sult of expanding the character via LESSBINFMT must be less than 31 + "*k" is blinking, "*d" is bold, "*u" is underlined, "*s" is standout, + and "*n" is normal. If LESSBINFMT does not begin with a "*", normal + attribute is assumed. The remainder of LESSBINFMT is a string which + may include one printf‐style escape sequence (a % followed by x, X, o, + d, etc.). For example, if LESSBINFMT is "*u[%x]", binary characters + are displayed in underlined hexadecimal surrounded by brackets. The + default if no LESSBINFMT is specified is "*s<%02X>". Warning: the re‐ + sult of expanding the character via LESSBINFMT must be less than 31 characters. When the character set is utf-8, the LESSUTFBINFMT environment variable acts similarly to LESSBINFMT but it applies to Unicode code points that - were successfully decoded but are unsuitable for display (e.g., unas‐ - signed code points). Its default value is "<U+%04lX>". Note that - LESSUTFBINFMT and LESSBINFMT share their display attribute setting - ("*x") so specifying one will affect both; LESSUTFBINFMT is read after - LESSBINFMT so its setting, if any, will have priority. Problematic - octets in a UTF‐8 file (octets of a truncated sequence, octets of a - complete but non‐shortest form sequence, invalid octets, and stray - trailing octets) are displayed individually using LESSBINFMT so as to + were successfully decoded but are unsuitable for display (e.g., unas‐ + signed code points). Its default value is "<U+%04lX>". Note that + LESSUTFBINFMT and LESSBINFMT share their display attribute setting + ("*x") so specifying one will affect both; LESSUTFBINFMT is read after + LESSBINFMT so its setting, if any, will have priority. Problematic + octets in a UTF‐8 file (octets of a truncated sequence, octets of a + complete but non‐shortest form sequence, invalid octets, and stray + trailing octets) are displayed individually using LESSBINFMT so as to facilitate diagnostic of how the UTF‐8 file is ill‐formed. - When the character set is utf-8, in rare cases it may be desirable to + When the character set is utf-8, in rare cases it may be desirable to override the Unicode definition of the type of certain characters. For example, characters in a Private Use Area are normally treated as bina‐ - ry characters, but if you are using a custom font with printable char‐ - acters in that range, it may be desirable to tell [1mless [22mto treat such + ry characters, but if you are using a custom font with printable char‐ + acters in that range, it may be desirable to tell [1mless [22mto treat such characters as printable. This can be done by setting the LESSUTFCHARD‐ EF environment variable to a comma‐separated list of [4mcharacter[24m [4mtype[24m de‐ finitions. Each character type definition consists of either one hexa‐ decimal codepoint or a pair of codepoints separated by a dash, followed - by a colon and a type character. Each hexadecimal codepoint may op‐ + by a colon and a type character. Each hexadecimal codepoint may op‐ tionally be preceded by a "U" or "U+". If a pair of codepoints is giv‐ en, the type is set for all characters inclusively between the two val‐ ues. If there are multiple comma‐separated codepoint values, they must @@ -1968,7 +1968,7 @@ c A composing (zero width) character. - d A deleted character (deleted from the input and not dis‐ + d A deleted character (deleted from the input and not dis‐ played). For example, setting LESSUTFCHARDEF to @@ -1977,102 +1977,102 @@ would make all Private Use Area characters be treated as printable. - By default, emoji modifiers, components and variation selectors are - deleted because many terminals do not display them correctly. If you - use a terminal which does display some or all of them correctly, you - can cause them to be displayed by setting LESSUTFCHARDEF to treat them - as composing characters. For example, this sets them all to composing + By default, emoji modifiers, components and variation selectors are + deleted because many terminals do not display them correctly. If you + use a terminal which does display some or all of them correctly, you + can cause them to be displayed by setting LESSUTFCHARDEF to treat them + as composing characters. For example, this sets them all to composing characters: FE00-FE0F:c,1F3FB-1F3FF:c,1F9B0-1F9B3:c,E0100-E01EF:c [1mPROMPTS[0m - The [1m-P [22moption allows you to tailor the prompt to your preference. The - string given to the [1m-P [22moption replaces the specified prompt string. + The [1m-P [22moption allows you to tailor the prompt to your preference. The + string given to the [1m-P [22moption replaces the specified prompt string. Certain characters in the string are interpreted specially. The prompt - mechanism is rather complicated to provide flexibility, but the ordi‐ - nary user need not understand the details of constructing personalized + mechanism is rather complicated to provide flexibility, but the ordi‐ + nary user need not understand the details of constructing personalized prompt strings. - A percent sign followed by a single character is expanded according to - what the following character is. (References to the input file size + A percent sign followed by a single character is expanded according to + what the following character is. (References to the input file size below refer to the preprocessed size, if an input preprocessor is being used.) - %b[4mX[24m Replaced by the byte offset into the current input file. The b + %b[4mX[24m Replaced by the byte offset into the current input file. The b is followed by a single character (shown as [4mX[24m above) which spec‐ - ifies the line whose byte offset is to be used. If the charac‐ - ter is a "t", the byte offset of the top line in the display is + ifies the line whose byte offset is to be used. If the charac‐ + ter is a "t", the byte offset of the top line in the display is used, an "m" means use the middle line, a "b" means use the bot‐ - tom line, a "B" means use the line just after the bottom line, - and a "j" means use the "target" line, as specified by the [1m-j[0m + tom line, a "B" means use the line just after the bottom line, + and a "j" means use the "target" line, as specified by the [1m-j[0m option. %B Replaced by the size of the current input file. - %c Replaced by the column number of the text which appears in the + %c Replaced by the column number of the text which appears in the first column of the screen. - %C Replaced by the column number of the text which appears (or + %C Replaced by the column number of the text which appears (or would appear) in the last column of the screen. - %d[4mX[24m Replaced by the page number of a line in the input file. The + %d[4mX[24m Replaced by the page number of a line in the input file. The line to be used is determined by the [4mX[24m, as with the %b option. - %D Replaced by the number of pages in the input file, or equiva‐ + %D Replaced by the number of pages in the input file, or equiva‐ lently, the page number of the last line in the input file. - %E Replaced by the name of the editor (from the VISUAL environment - variable, or the EDITOR environment variable if VISUAL is not + %E Replaced by the name of the editor (from the VISUAL environment + variable, or the EDITOR environment variable if VISUAL is not defined). See the discussion of the LESSEDIT feature below. %f Replaced by the name of the current input file. - %F Replaced by the last component of the name of the current input + %F Replaced by the last component of the name of the current input file. - %g Replaced by the shell‐escaped name of the current input file. - This is useful when the expanded string will be used in a shell + %g Replaced by the shell‐escaped name of the current input file. + This is useful when the expanded string will be used in a shell command, such as in LESSEDIT. - %i Replaced by the index of the current file in the list of input + %i Replaced by the index of the current file in the list of input files. - %l[4mX[24m Replaced by the line number of a line in the input file. The + %l[4mX[24m Replaced by the line number of a line in the input file. The line to be used is determined by the [4mX[24m, as with the %b option. %L Replaced by the line number of the last line in the input file. %m Replaced by the total number of input files. - %o Replaced by the URI of the currently selected OSC 8 hyperlink, + %o Replaced by the URI of the currently selected OSC 8 hyperlink, or a question mark if no hyperlink is selected. This is used by OSC 8 handlers as explained in the ^O^O command description. - %p[4mX[24m Replaced by the percent into the current input file, based on - byte offsets. The line used is determined by the [4mX[24m as with the + %p[4mX[24m Replaced by the percent into the current input file, based on + byte offsets. The line used is determined by the [4mX[24m as with the %b option. - %P[4mX[24m Replaced by the percent into the current input file, based on - line numbers. The line used is determined by the [4mX[24m as with the + %P[4mX[24m Replaced by the percent into the current input file, based on + line numbers. The line used is determined by the [4mX[24m as with the %b option. - %Q Replaced by the percent of the last column of text displayed on - the screen compared to the length of the longest line currently + %Q Replaced by the percent of the last column of text displayed on + the screen compared to the length of the longest line currently displayed (that is, %C divided by %W). Note that using this se‐ quence can make displaying the prompt be slower than usual. %s Same as %B. - %t Causes any trailing spaces to be removed. Usually used at the + %t Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear anywhere. - %T Normally expands to the word "file". However if viewing files - via a tags list using the [1m-t [22moption, it expands to the word + %T Normally expands to the word "file". However if viewing files + via a tags list using the [1m-t [22moption, it expands to the word "tag". %W Replaced by the width of the longest line currently displayed on - the screen. Note that using this sequence can make displaying + the screen. Note that using this sequence can make displaying the prompt be slower than usual. %x Replaced by the name of the next input file in the list. @@ -2080,15 +2080,15 @@ If any item is unknown (for example, the file size if input is a pipe), a question mark is printed instead. - The format of the prompt string can be changed depending on certain - conditions. A question mark followed by a single character acts like - an "IF": depending on the following character, a condition is evaluat‐ - ed. If the condition is true, any characters following the question - mark and condition character, up to a period, are included in the - prompt. If the condition is false, such characters are not included. - A colon appearing between the question mark and the period can be used + The format of the prompt string can be changed depending on certain + conditions. A question mark followed by a single character acts like + an "IF": depending on the following character, a condition is evaluat‐ + ed. If the condition is true, any characters following the question + mark and condition character, up to a period, are included in the + prompt. If the condition is false, such characters are not included. + A colon appearing between the question mark and the period can be used to establish an "ELSE": any characters between the colon and the period - are included in the string if and only if the IF condition is false. + are included in the string if and only if the IF condition is false. Condition characters (which follow a question mark) may be: ?a True if any characters have been included in the prompt so far. @@ -2103,7 +2103,7 @@ ?e True if at end‐of‐file. - ?f True if there is an input filename (that is, if input is not a + ?f True if there is an input filename (that is, if input is not a pipe). ?l[4mX[24m True if the line number of the specified line is known. @@ -2114,46 +2114,46 @@ ?n True if this is the first prompt in a new input file. - ?p[4mX[24m True if the percent into the current input file, based on byte + ?p[4mX[24m True if the percent into the current input file, based on byte offsets, of the specified line is known. - ?P[4mX[24m True if the percent into the current input file, based on line + ?P[4mX[24m True if the percent into the current input file, based on line numbers, of the specified line is known. - ?Q True if %Q is less than 100. Note that using this sequence can + ?Q True if %Q is less than 100. Note that using this sequence can make displaying the prompt be slower than usual. ?s Same as "?B". - ?x True if there is a next input file (that is, if the current in‐ + ?x True if there is a next input file (that is, if the current in‐ put file is not the last one). Any characters other than the special ones (question mark, colon, peri‐ - od, percent, and backslash) become literally part of the prompt. Any - of the special characters may be included in the prompt literally by + od, percent, and backslash) become literally part of the prompt. Any + of the special characters may be included in the prompt literally by preceding it with a backslash. Some examples: ?f%f:Standard input. - This prompt prints the filename, if known; otherwise the string "Stan‐ + This prompt prints the filename, if known; otherwise the string "Stan‐ dard input". ?f%f .?ltLine %lt:?pt%pt\%:?btByte %bt:-... - This prompt would print the filename, if known. The filename is fol‐ - lowed by the line number, if known, otherwise the percent if known, + This prompt would print the filename, if known. The filename is fol‐ + lowed by the line number, if known, otherwise the percent if known, otherwise the byte offset if known. Otherwise, a dash is printed. No‐ - tice how each question mark has a matching period, and how the % after + tice how each question mark has a matching period, and how the % after the %pt is included literally by escaping it with a backslash. ?n?f%f .?m(%T %i of %m) ..?e(END) ?x- Next\: %x..%t - This prints the filename if this is the first prompt in a file, fol‐ - lowed by the "file N of N" message if there is more than one input - file. Then, if we are at end‐of‐file, the string "(END)" is printed - followed by the name of the next file, if there is one. Finally, any + This prints the filename if this is the first prompt in a file, fol‐ + lowed by the "file N of N" message if there is more than one input + file. Then, if we are at end‐of‐file, the string "(END)" is printed + followed by the name of the next file, if there is one. Finally, any trailing spaces are truncated. This is the default prompt. For refer‐ ence, here are the defaults for the other two prompts [1m-m [22mand [1m-M [22mrespec‐ tively). Each is broken into two lines here for readability only. @@ -2169,22 +2169,22 @@ ?f%f .?m(%T %i of %m) .?ltlines %lt-%lb?L/%L. . byte %bB?s/%s. ?e(END) :?pB%pB\%..?c (column %c).%t - The prompt expansion features are also used for another purpose: if an - environment variable LESSEDIT is defined, it is used as the command to - be executed when the v command is invoked. The LESSEDIT string is ex‐ - panded in the same way as the prompt strings. The default value for + The prompt expansion features are also used for another purpose: if an + environment variable LESSEDIT is defined, it is used as the command to + be executed when the v command is invoked. The LESSEDIT string is ex‐ + panded in the same way as the prompt strings. The default value for LESSEDIT is: %E ?lm+%lm. %g Note that this expands to the editor name, followed by a + and the line - number, followed by the shell‐escaped file name. If your editor does - not accept the "+linenumber" syntax, or has other differences in invo‐ - cation syntax, the LESSEDIT variable can be changed to modify this de‐ + number, followed by the shell‐escaped file name. If your editor does + not accept the "+linenumber" syntax, or has other differences in invo‐ + cation syntax, the LESSEDIT variable can be changed to modify this de‐ fault. [1mSECURITY[0m - When the environment variable LESSSECURE is set to 1, [1mless [22mruns in a + When the environment variable LESSSECURE is set to 1, [1mless [22mruns in a "secure" mode. In this mode, these features are disabled: edit the edit command (v) @@ -2212,66 +2212,66 @@ tags use of tags files ([1m-t[22m) - The LESSSECURE_ALLOW environment variable can be set to a comma‐sepa‐ - rated list of names of features which are selectively enabled when + The LESSSECURE_ALLOW environment variable can be set to a comma‐sepa‐ + rated list of names of features which are selectively enabled when LESSSECURE is set. Each feature name is the first word in each line in - the above list. A feature name may be abbreviated as long as the ab‐ - breviation is unambiguous. For example, if LESSSECURE=1 and + the above list. A feature name may be abbreviated as long as the ab‐ + breviation is unambiguous. For example, if LESSSECURE=1 and LESSSECURE_ALLOW=hist,edit were set, all of the above features would be disabled except for history files and the edit command. - Less can also be compiled to be permanently in "secure" mode. In that + Less can also be compiled to be permanently in "secure" mode. In that case, the LESSSECURE and LESSSECURE_ALLOW variables are ignored. [1mCOMPATIBILITY WITH MORE[0m If the environment variable LESS_IS_MORE is set to 1, or if the program - is invoked via a file link named "more" and the environment variable + is invoked via a file link named "more" and the environment variable LESS_IS_MORE is not set to 0, [1mless [22mbehaves (mostly) in conformance with - the POSIX [1mmore[22m(1) command specification. In this mode, [1mless [22mbehaves + the POSIX [1mmore[22m(1) command specification. In this mode, [1mless [22mbehaves differently in these ways: The [1m-e [22moption works differently. If the [1m-e [22moption is not set, [1mless [22mbe‐ - haves as if the [1m-e [22moption were set. If the [1m-e [22moption is set, [1mless [22mbe‐ + haves as if the [1m-e [22moption were set. If the [1m-e [22moption is set, [1mless [22mbe‐ haves as if the [1m-E [22moption were set. - The [1m-m [22moption works differently. If the [1m-m [22moption is not set, the - medium prompt is used, and it is prefixed with the string "--More--". + The [1m-m [22moption works differently. If the [1m-m [22moption is not set, the + medium prompt is used, and it is prefixed with the string "--More--". If the [1m-m [22moption is set, the short prompt is used. - The [1m-n [22moption acts like the [1m-z [22moption. The normal behavior of the [1m-n[0m + The [1m-n [22moption acts like the [1m-z [22moption. The normal behavior of the [1m-n[0m option is unavailable in this mode. - The parameter to the [1m-p [22moption is taken to be a [1mless [22mcommand rather + The parameter to the [1m-p [22moption is taken to be a [1mless [22mcommand rather than a search pattern. - The LESS environment variable is ignored, and the MORE environment + The LESS environment variable is ignored, and the MORE environment variable is used in its place. [1mENVIRONMENT VARIABLES[0m Environment variables may be specified either in the system environment - as usual, or in a [1mlesskey[22m(1) file. If environment variables are de‐ + as usual, or in a [1mlesskey[22m(1) file. If environment variables are de‐ fined in more than one place, variables defined in a local lesskey file take precedence over variables defined in the system environment, which take precedence over variables defined in the system‐wide lesskey file. COLUMNS Sets the number of columns on the screen. Takes precedence over - the number of columns specified by the TERM variable. (But if + the number of columns specified by the TERM variable. (But if you have a windowing system which supports TIOCGWINSZ or - WIOCGETD, the window system’s idea of the screen size takes + WIOCGETD, the window system’s idea of the screen size takes precedence over the LINES and COLUMNS environment variables.) EDITOR The name of the editor (used for the v command). - HOME Name of the user’s home directory (used to find a lesskey file + HOME Name of the user’s home directory (used to find a lesskey file on Unix and OS/2 systems). HOMEDRIVE, HOMEPATH - Concatenation of the HOMEDRIVE and HOMEPATH environment vari‐ + Concatenation of the HOMEDRIVE and HOMEPATH environment vari‐ ables is the name of the user’s home directory if the HOME vari‐ able is not set (only in the Windows version). - INIT Name of the user’s init directory (used to find a lesskey file + INIT Name of the user’s init directory (used to find a lesskey file on OS/2 systems). LANG Language for determining the character set. @@ -2282,27 +2282,27 @@ LESS Options which are passed to [1mless [22mautomatically. LESSANSIENDCHARS - Characters which may end an ANSI color escape sequence (default + Characters which may end an ANSI color escape sequence (default "m"). LESSANSIMIDCHARS - Characters which may appear between the ESC character and the - end character in an ANSI color escape sequence (default + Characters which may appear between the ESC character and the + end character in an ANSI color escape sequence (default "0123456789:;[?!"'#%()*+ "). LESSANSIOSCALLOW A comma‐separated list of OSC types which are output directly to - the terminal when [1m-R [22mis in effect (default "8"; that is, only + the terminal when [1m-R [22mis in effect (default "8"; that is, only OSC 8 sequences are output directly). LESSANSIOSCCHARS - Characters which may follow an ESC character to mark the start - of an "OS Command" sequence. All characters that follow this - character up to a String Terminator (ESC‐backslash or BEL) are - considered to be part of the OSC sequence (default "]"). If a - character in LESSANSIOSCCHARS is followed by an asterisk, se‐ - quences that begin with that character in the file contents are - passed through to the terminal; otherwise only sequences that + Characters which may follow an ESC character to mark the start + of an "OS Command" sequence. All characters that follow this + character up to a String Terminator (ESC‐backslash or BEL) are + considered to be part of the OSC sequence (default "]"). If a + character in LESSANSIOSCCHARS is followed by an asterisk, se‐ + quences that begin with that character in the file contents are + passed through to the terminal; otherwise only sequences that appear in a prompt string are passed through. LESSBINFMT @@ -2319,21 +2319,21 @@ LESSECHO Name of the lessecho program (default "lessecho"). The lessecho - program is needed to expand metacharacters, such as * and ?, in + program is needed to expand metacharacters, such as * and ?, in filenames on Unix systems. LESSEDIT - Editor prototype string (used for the v command). See discus‐ + Editor prototype string (used for the v command). See discus‐ sion under PROMPTS. LESSGLOBALTAGS - Name of the command used by the [1m-t [22moption to find global tags. - Normally should be set to "global" if your system has the [1mglob‐[0m + Name of the command used by the [1m-t [22moption to find global tags. + Normally should be set to "global" if your system has the [1mglob‐[0m [1mal[22m(1) command. If not set, global tags are not used. LESSHISTFILE - Name of the history file used to remember search commands and - shell commands between invocations of [1mless[22m. If set to "-" or + Name of the history file used to remember search commands and + shell commands between invocations of [1mless[22m. If set to "-" or "/dev/null", a history file is not used. The default depends on the operating system, but is usually: @@ -2354,34 +2354,34 @@ Name of the default [4mlesskey[24m [4msource[24m file. LESSKEY - Name of the default [4mlesskey[24m [4mbinary[24m file. (Not used if + Name of the default [4mlesskey[24m [4mbinary[24m file. (Not used if "$LESSKEYIN" exists.) LESSKEY_CONTENT - The value is parsed as if it were the parameter of a + The value is parsed as if it were the parameter of a [1m--lesskey-content [22moption. LESSKEYIN_SYSTEM Name of the default system‐wide [4mlesskey[24m [4msource[24m file. LESSKEY_SYSTEM - Name of the default system‐wide [4mlesskey[24m [4mbinary[24m file. (Not used + Name of the default system‐wide [4mlesskey[24m [4mbinary[24m file. (Not used if "$LESSKEYIN_SYSTEM" exists.) LESSMETACHARS - List of characters which are considered "metacharacters" by the + List of characters which are considered "metacharacters" by the shell. LESSMETAESCAPE - Prefix which less will add before each metacharacter in a com‐ + Prefix which less will add before each metacharacter in a com‐ mand sent to the shell (default "\"). LESSNOCONFIG If set to "-", all environment variables except TERM are ignored - (treated as if they were not set). If set to a comma‐separated - list of environment variable names, all environment variables - except TERM and those in the list are ignored. In either case - (if set to any non‐empty value), all [1mlesskey [22mfiles are also ig‐ + (treated as if they were not set). If set to a comma‐separated + list of environment variable names, all environment variables + except TERM and those in the list are ignored. In either case + (if set to any non‐empty value), all [1mlesskey [22mfiles are also ig‐ nored. LESSOPEN @@ -2391,7 +2391,7 @@ Runs less in "secure" mode. See discussion under SECURITY. LESSSECURE_ALLOW - Enables individual features which are normally disabled by + Enables individual features which are normally disabled by LESSSECURE. See discussion under SECURITY. LESSSEPARATOR @@ -2406,30 +2406,30 @@ LESS_COLUMNS Sets the number of columns on the screen. Unlike COLUMNS, takes - precedence over the system’s idea of the screen size, so it can - be used to make [1mless [22muse less than the full screen width. If - set to a negative number, sets the number of columns used to + precedence over the system’s idea of the screen size, so it can + be used to make [1mless [22muse less than the full screen width. If + set to a negative number, sets the number of columns used to this much less than the actual screen width. LESS_LINES - Sets the number of lines on the screen. Unlike LINES, takes - precedence over the system’s idea of the screen size, so it can - be used to make [1mless [22muse less than the full screen height. If - set to a negative number, sets the number of lines used to this - much less than the actual screen height. When set, [1mless [22mre‐ + Sets the number of lines on the screen. Unlike LINES, takes + precedence over the system’s idea of the screen size, so it can + be used to make [1mless [22muse less than the full screen height. If + set to a negative number, sets the number of lines used to this + much less than the actual screen height. When set, [1mless [22mre‐ paints the entire screen on every movement command, so scrolling may be slower. LESS_DATA_DELAY - Duration (in milliseconds) after starting to read data from the - input, after which the "Waiting for data" message will be dis‐ + Duration (in milliseconds) after starting to read data from the + input, after which the "Waiting for data" message will be dis‐ played. The default is 4000 (4 seconds). LESS_IS_MORE Emulate the [1mmore[22m(1) command. LESS_OSC8_xxx - Where "xxx" is a URI scheme such as "http" or "file", sets an + Where "xxx" is a URI scheme such as "http" or "file", sets an OSC 8 handler for opening OSC 8 links containing a URI with that scheme. @@ -2438,13 +2438,13 @@ no specific LESS_OSC8_xxx handler set for the "xxx" scheme. LESS_SHELL_LINES - When the [1m-F [22moption is set, [1mless [22mexits automatically if the num‐ - ber of screen lines used to display the file is less than or - equal to the screen height minus the value of the - LESS_SHELL_LINES variable. Thus, if you use a shell prompt - which occupies more than one screen line, this variable can be - set to the number of lines used by your prompt, to ensure that - the entire file can be seen when [1m-F [22mis used. If not set, + When the [1m-F [22moption is set, [1mless [22mexits automatically if the num‐ + ber of screen lines used to display the file is less than or + equal to the screen height minus the value of the + LESS_SHELL_LINES variable. Thus, if you use a shell prompt + which occupies more than one screen line, this variable can be + set to the number of lines used by your prompt, to ensure that + the entire file can be seen when [1m-F [22mis used. If not set, LESS_SHELL_LINES is assumed to be 1. LESS_SIGUSR1 @@ -2452,20 +2452,20 @@ commands will be executed when [1mless [22mreceives a SIGUSR1 signal. LESS_TERMCAP_xx - Where "xx" is any two characters, overrides the definition of - the termcap "xx" capability for the terminal. No escape se‐ + Where "xx" is any two characters, overrides the definition of + the termcap "xx" capability for the terminal. No escape se‐ quences in the string are processed, so any nonprintable charac‐ ters such as ESC must be in the string literally. LESS_TERMINFO_xxxx - Where "xxxx" is any string of characters, overrides the defini‐ - tion of the terminfo "xxxx" capability for the terminal. You + Where "xxxx" is any string of characters, overrides the defini‐ + tion of the terminfo "xxxx" capability for the terminal. You can use either LESS_TERMCAP_xx or LESS_TERMINFO_xxxx to override - a terminal capability, regardless of whether [1mless [22mis built with + a terminal capability, regardless of whether [1mless [22mis built with the [1mtermcap [22mor the [1mterminfo [22mlibrary. LESS_TERMCAP_BRACKETED_PASTE_START - Overrides the standard ANSI escape sequence to enable bracketed + Overrides the standard ANSI escape sequence to enable bracketed paste. This is used when the [1m--no-paste [22moption is in effect. LESS_TERMCAP_BRACKETED_PASTE_END @@ -2473,7 +2473,7 @@ paste. LESS_TERMCAP_MOUSE_START - Overrides the standard ANSI escape sequence to enable mouse re‐ + Overrides the standard ANSI escape sequence to enable mouse re‐ porting. This is used when the [1m--mouse [22moption is in effect. LESS_TERMCAP_MOUSE_END @@ -2481,42 +2481,42 @@ porting. LESS_TERMCAP_SUSPEND - Defines an escape sequence to temporarily suspend screen up‐ + Defines an escape sequence to temporarily suspend screen up‐ dates. This is sent to the terminal before clearing the screen. - This can be used to avoid screen tearing when the screen is re‐ + This can be used to avoid screen tearing when the screen is re‐ drawn on certain terminals. LESS_TERMCAP_RESUME - Defines an escape sequence to resume screen updates. This is + Defines an escape sequence to resume screen updates. This is sent to the terminal after displaying the prompt. LESS_UNSUPPORT - A space‐separated list of command line options. These options - will be ignored (with no error message) if they appear on the + A space‐separated list of command line options. These options + will be ignored (with no error message) if they appear on the command line or in the LESS environment variable. Options list‐ - ed in LESS_UNSUPPORT can still be changed by the - and -- com‐ - mands. Each option in LESS_UNSUPPORT is a dash followed by a + ed in LESS_UNSUPPORT can still be changed by the - and -- com‐ + mands. Each option in LESS_UNSUPPORT is a dash followed by a single character option letter, or two dashes followed by a long option name. - LINES Sets the number of lines on the screen. Takes precedence over + LINES Sets the number of lines on the screen. Takes precedence over the number of lines specified by the TERM variable. (But if you - have a windowing system which supports TIOCGWINSZ or WIOCGETD, - the window system’s idea of the screen size takes precedence + have a windowing system which supports TIOCGWINSZ or WIOCGETD, + the window system’s idea of the screen size takes precedence over the LINES and COLUMNS environment variables.) - MORE Options which are passed to [1mless [22mautomatically when running in + MORE Options which are passed to [1mless [22mautomatically when running in [1mmore[22m‐compatible mode. - PATH User’s search path (used to find a lesskey file on MS‐DOS, Win‐ + PATH User’s search path (used to find a lesskey file on MS‐DOS, Win‐ dows, and OS/2 systems). POSIXLY_CORRECT - If set to any value, all option arguments on the command line + If set to any value, all option arguments on the command line are expected to appear before any filename arguments. This must be set as an actual environment variable, not in a [1mlesskey [22mfile. - SHELL The shell used to execute the ! command, as well as to expand + SHELL The shell used to execute the ! command, as well as to expand filenames. TERM The type of terminal on which [1mless [22mis being run. @@ -2528,32 +2528,32 @@ tion. XDG_DATA_HOME - Possible location of the history file; see the description of + Possible location of the history file; see the description of the LESSHISTFILE environment variable. XDG_STATE_HOME - Possible location of the history file; see the description of + Possible location of the history file; see the description of the LESSHISTFILE environment variable. [1mSEE ALSO[0m [1mlesskey[22m(1), [1mlessecho[22m(1) [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‐ - eral Public License as published by the Free Software Foundation; or + 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‐ + eral Public License as published by the Free Software Foundation; or (2) the Less License. See the file README in the less distribution for more details regarding redistribution. You should have received a copy - of the GNU General Public License along with the source for less; see - the file COPYING. If not, write to the Free Software Foundation, 59 - Temple Place, Suite 330, Boston, MA 02111‐1307, USA. You should also + of the GNU General Public License along with the source for less; see + the file COPYING. If not, write to the Free Software Foundation, 59 + Temple Place, Suite 330, Boston, MA 02111‐1307, USA. You should also have received a copy of the Less License; see the file LICENSE. less is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT‐ - NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT‐ + NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. [1mAUTHOR[0m @@ -2562,4 +2562,4 @@ For more information, see the less homepage at https://greenwoodsoftware.com/less. -less 691 10 Jan 2026 [4mLESS[24m(1) +less 692 29 Jan 2026 [4mLESS[24m(1) @@ -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 diff --git a/lessecho.c b/lessecho.c index 2c5a686ed424..3f7c137acf36 100644 --- a/lessecho.c +++ b/lessecho.c @@ -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. diff --git a/lessecho.man b/lessecho.man index 866b5c0fc2e2..5d6bfcb1b323 100644 --- a/lessecho.man +++ b/lessecho.man @@ -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) diff --git a/lessecho.nro b/lessecho.nro index 3013644b6a56..c860dd847405 100644 --- a/lessecho.nro +++ b/lessecho.nro @@ -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. diff --git a/lesskey.c b/lesskey.c index 5930056c0dfc..a80870738cc2 100644 --- a/lesskey.c +++ b/lesskey.c @@ -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. diff --git a/lesskey.h b/lesskey.h index 4d9d1bf280b7..1cf5b6014a6d 100644 --- a/lesskey.h +++ b/lesskey.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. diff --git a/lesskey.man b/lesskey.man index 0971033b8f52..409bda26b3b6 100644 --- a/lesskey.man +++ b/lesskey.man @@ -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) diff --git a/lesskey.nro b/lesskey.nro index b397a6724e59..11f5a306aea8 100644 --- a/lesskey.nro +++ b/lesskey.nro @@ -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 diff --git a/lesskey_parse.c b/lesskey_parse.c index d844be960817..d19ae26dffdf 100644 --- a/lesskey_parse.c +++ b/lesskey_parse.c @@ -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; diff --git a/lesstest/display.c b/lesstest/display.c index 5e904f8bc815..16356c66e46f 100644 --- a/lesstest/display.c +++ b/lesstest/display.c @@ -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) { diff --git a/lesstest/env.c b/lesstest/env.c index 407b0d51ce59..00fb70cf3bb1 100644 --- a/lesstest/env.c +++ b/lesstest/env.c @@ -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; diff --git a/lesstest/lesstest.c b/lesstest/lesstest.c index 3219b3479dbc..4630b8de092f 100644 --- a/lesstest/lesstest.c +++ b/lesstest/lesstest.c @@ -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" diff --git a/lesstest/log.c b/lesstest/log.c index 7418f6161a3a..b2a166be9d2c 100644 --- a/lesstest/log.c +++ b/lesstest/log.c @@ -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> diff --git a/lesstest/lt_screen.c b/lesstest/lt_screen.c index 162c7c180dda..76c4e144e12a 100644 --- a/lesstest/lt_screen.c +++ b/lesstest/lt_screen.c @@ -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> diff --git a/lesstest/parse.c b/lesstest/parse.c index 92d1ea0e9866..96afe47e7118 100644 --- a/lesstest/parse.c +++ b/lesstest/parse.c @@ -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" diff --git a/lesstest/pipeline.c b/lesstest/pipeline.c index cf0cfead318d..71e758f74a02 100644 --- a/lesstest/pipeline.c +++ b/lesstest/pipeline.c @@ -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; diff --git a/lesstest/run.c b/lesstest/run.c index 9797c2d8ff4c..bd125ab99267 100644 --- a/lesstest/run.c +++ b/lesstest/run.c @@ -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> diff --git a/lesstest/term.c b/lesstest/term.c index ed9627611fda..32cce943f57c 100644 --- a/lesstest/term.c +++ b/lesstest/term.c @@ -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> diff --git a/lesstest/unicode.c b/lesstest/unicode.c index fa232ee5b8d6..ea84ee5d345e 100644 --- a/lesstest/unicode.c +++ b/lesstest/unicode.c @@ -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; diff --git a/lesstest/wchar.c b/lesstest/wchar.c index 7e0e3fb8b976..bd177504fa23 100644 --- a/lesstest/wchar.c +++ b/lesstest/wchar.c @@ -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. diff --git a/linenum.c b/linenum.c index 0f7e7cdf6275..b8386f1fca09 100644 --- a/linenum.c +++ b/linenum.c @@ -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. diff --git a/lsystem.c b/lsystem.c index 0d55241eae85..63c0cf074524 100644 --- a/lsystem.c +++ b/lsystem.c @@ -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. diff --git a/mkhelp.pl b/mkhelp.pl index 452d9a0aef31..ceca53662394 100755 --- a/mkhelp.pl +++ b/mkhelp.pl @@ -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"; diff --git a/optfunc.c b/optfunc.c index 29d2748bc935..2370103349a0 100644 --- a/optfunc.c +++ b/optfunc.c @@ -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. diff --git a/pattern.c b/pattern.c index 0c72b98d2cd1..228c89b49fcc 100644 --- a/pattern.c +++ b/pattern.c @@ -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. diff --git a/pattern.h b/pattern.h index e19b007b00b5..335a316da8e4 100644 --- a/pattern.h +++ b/pattern.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. @@ -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' diff --git a/position.c b/position.c index 3de034c17af4..442e6c929f6f 100644 --- a/position.c +++ b/position.c @@ -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. diff --git a/position.h b/position.h index 609967aa1094..478ac2279015 100644 --- a/position.h +++ b/position.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. @@ -369,6 +369,15 @@ static void set_termio_flags( | ONLRET #endif ); + + s->c_iflag &= ~(0 +#ifdef ICRNL + | ICRNL +#endif +#ifdef INLCR + | INLCR +#endif + ); } #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; diff --git a/scrsize.c b/scrsize.c index 66e87161e914..fb3e28826d04 100644 --- a/scrsize.c +++ b/scrsize.c @@ -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. diff --git a/version.c b/version.c index 9d7fa034d78c..b3d83c1ca2fc 100644 --- a/version.c +++ b/version.c @@ -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" @@ -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. + */ + #ifndef XBUF_H_ #define XBUF_H_ |
