diff --git a/contrib/less/NEWS b/contrib/less/NEWS index 5767ded21a00..cdc8196a5f16 100644 --- a/contrib/less/NEWS +++ b/contrib/less/NEWS @@ -1,1488 +1,1498 @@ NEWS about less ====================================================================== For the latest news about less, see https://greenwoodsoftware.com/less You can also download the latest version of less from there. Report bugs, suggestions or comments at https://github.com/gwsw/less/issues. +====================================================================== + + Major changes between "less" versions 678 and 679 + +* Fix bad parsing of lesskey file an env var is a prefix of another + env var (github #626). + +* Fix unexpected exit using -K if a key press is received while reading + the input file (github #628). + ====================================================================== Major changes between "less" versions 668 and 678 * Treat -r in LESS environment variable as -R. * Add ESC-j and ESC-k commands (github #560). * Add --no-paste option (github #523). * Add --no-edit-warn option (github #513). * Add --form-feed option (github #496). * Add ESC-b command (github #615). * Make TAB complete option name in -- command (github #531). * Update the file size on an attempt to go past end of file. * Make -R able to pass through any OSC escape sequences, not just OSC 8 (github #504). * Setting LESS_IS_MORE=0 now disables "more" compatibility even if invoked via a file link named "more" (github #500). * Pass through escape sequences in prompts even if -R is not set. * Add LESS_SHELL_LINES to support shell prompts which use more than one line (github #514). * Add LESSANSIOSCALLOW to define OSC types which may be passed through. * Add LESSANSIOSCCHARS to define non-standard OSC intro chars. * Add LESS_SIGUSR1 to define user signal handler (github #582). * Add mouse and mouse6 commands to lesskey (github #569). * Improve behavior of ^O^N and ^O^P commands. * Leave stty tabs setting unchanged (github #620). * Fix unexpected behavior when entering a partial command followed by a valid command (github #543). * Fix bug when coloring prompt string with SGR sequences (github #516). * Fix bug when searching for text near an invalid UTF-8 sequence (github #542). * Fix display bug when file contains ESC followed by NUL (github #550). * Fix bug when using +:n +:p +:x or +:d on the command line (github #552). * Fix bug with --no-number-headers when header is not at start of file (github #566). * Fix bug where lesstest fails if window is resized (github #570). * Fix bug using "configure --with-secure=no" (github #584). * Fix bug using multibyte command chars (github #595). * Fix auto_wrap setting on Windows (github #497). * Fix two bugs using ^S search modifier (github #605). * Fix bug searching for UTF-8 strings with the PCRE2 library (github #610). * Fix bug highlighting OSC 8 links when opening a new file. * Fix bug when & filtering is active (github #618). ====================================================================== Major changes between "less" versions 661 and 668 * Make 256/true colors work better on Windows without -Da (github #539, github #546, github #562). * Fix build using --with-secure (github #544). * Fix crash when using --header on command line (github #545). * Fix possible crash when scrolling left/right or toggling -S (github #547). * Fix bug when using #stop in a lesskey file (github #551). * Fix bug when using --shift or --match-shift on command line with a parameter starting with '.' (github #554). * Fix bug in R command when file size changes (github #553). * Fix bug using --header when file does not fill screen (github #556). * Fix ^X bug when output is not a terminal (github #558). * Fix bug where ^Z is not handled immediately (github #563). * Fix bug where first byte from a LESSOPEN filter is deleted if it is greater than 0x7F (github #568). * Fix uninitialized variable in edit_ifile (github #573). * Fix incorrect handling of UTF-8 chars in prompts (github #576). ====================================================================== Major changes between "less" versions 643 and 661 * Add ^O^N, ^O^P, ^O^L and ^O^O commands and mouse clicks (with --mouse) to find and open OSC8 hyperlinks (github #251). * Add --match-shift option. * Add --lesskey-content option (github #447). * Add LESSKEY_CONTENT environment variable (github #447). * Add --no-search-header-lines and --no-search-header-columns options (github #397). * Add ctrl-L search modifier (github #367). * A ctrl-P at the start of a shell command suppresses the "done" message (github #462). * Add attribute characters ('*', '~', '_', '&') to --color parameter (github #471). * Allow expansion of environment variables in lesskey files. * Add LESSSECURE_ALLOW environment variable (github #449). * Add LESS_UNSUPPORT environment variable. * Add line number parameter to --header option (github #436). * Mouse right-click jumps to position marked by left-click (github #390). * Ensure that the target line is not obscured by a header line set by --header (github #444). * Change default character set to "utf-8", except remains "dos" on MS-DOS. * Add message when search with ^W wraps (github #459). * UCRT builds on Windows 10 and later now support Unicode file names (github #438). * Improve behavior of interrupt while reading non-terminated pipe (github #414). * Improve parsing of -j, -x and -# options (github #393). * Support files larger than 4GB on Windows (github #417). * Support entry of Unicode chars larger than U+FFFF on Windows (github #391). * Improve colors of bold, underline and standout text on Windows. * Allow --rscroll to accept non-ASCII characters (github #483). * Allow the parameter to certain options to be terminated with a space (--color, --quotes, --rscroll, --search-options and --intr) (github #495). * Fix bug where # substitution failed after viewing help (github #420). * Fix crash if files are deleted while less is viewing them (github #404). * Workaround unreliable ReadConsoleInputW behavior on Windows with non-ASCII input. * Fix -J display when searching for non-ASCII characters (github #422). * Don't filter header lines via the & command (github #423). * Fix bug when horizontally shifting long lines (github #425). * Add -x and -D options to lesstest, to make it easier to diagnose a failed lesstest run. * Fix bug searching long lines with --incsearch and -S (github #428). * Fix bug that made ESC-} fail if top line on screen was empty (github #429). * Fix bug with --mouse on Windows when used with pipes (github #440). * Fix bug in --+OPTION command line syntax. * Fix display bug when using -w with an empty line with a CR/LF line ending (github #474). * When substituting '#' or '%' with a filename, quote the filename if it contains a space (github #480). * Fix wrong sleep time when system has usleep but not nanosleep (github #489). * Fix bug when file name contains a newline. * Fix bug when file name contains nonprintable characters (github #503). * Fix DJGPP build (github #497). * Update Unicode tables. ====================================================================== Major changes between "less" versions 633 and 643 * Fix problem when a program piping into less reads from the tty, like sudo asking for password (github #368). * Fix search modifier ^E after ^W. * Fix bug using negated (^N) search (github #374). * Fix bug setting colors with -D on Windows build (github #386). * Fix reading special chars like PageDown on Windows (github #378). * Fix mouse wheel scrolling on Windows (github #379). * Fix erroneous EOF when terminal window size changes (github #372). * Fix compile error with some definitions of ECHONL (github #395). * Fix crash on Windows when writing logfile (github #405). * Fix regression in exit code when stdin is /dev/null and output is a file (github #373). * Add lesstest test suite to production release (github #344). * Change lesstest output to conform with automake Simple Test Format (github #399). ====================================================================== Major changes between "less" versions 632 and 633 * Fix build on systems which have ncurses/termcap.h or ncursesw/termcap.h but not termcap.h. ====================================================================== Major changes between "less" versions 608 and 632 * Add LESSUTFCHARDEF environment variable (github #275). * Add # command (github #330). * Add ^S search modifier (github #196). * Add --wordwrap option (github #113). * Add --no-vbell option (github #304). * Add --no-search-headers option (github #44). * Add --modelines option (github #89). * Add --intr option (github #224). * Add --proc-backspace, --proc-tab and --proc-return options (github #335). * Add --show-preproc-errors option (github #258). * Add LESS_LINES and LESS_COLUMNS environment variables (github #84). * Add LESS_DATA_DELAY environment variable (github #337). * Allow empty "lines" field in --header option. * Update Unicode tables. * Improve ability of ^X to interrupt F command (github #49). * Status column (-J) shows off-screen matches. * Parenthesized sub-patterns in searches are colored with unique colors, if supported by the regular expression library (github #196). * Don't allow opening a tty as file input unless -f is set (github #309). * Don't require newline input after +&... option (github #339). * Fix incorrect handling of some Private Use Unicode characters. * Fix ANSI color bug when overstriking with colored chars (github #276). * Fix compiler const warning (github #279). * Fix signal race in iread (github #280). * Fix reading procfs files on Linux (github #282). * Fix --ignore-case with ctrl-R (no regex) search (github #300). * Fix bug doing repeat search after setting & filter (github #299). * Fix bug doing repeat search before non-repeat search. * Fix crash with -R and certain line lengths (github #338). * Fix input of Windows dead keys (github #352). * Don't retain search options from a cancelled search (github #302). * Don't call realpath on fake filenames like "-" (github #289). * Implement lesstest test suite. * Convert function parameter definitions from K&R to C89 (github #316). ====================================================================== Major changes between "less" versions 590 and 608 * Add the --header option (github #43). * Add the --no-number-headers option (github #178). * Add the --status-line option. * Add the --redraw-on-quit option (github #36). * Add the --search-options option (github #213). * Add the --exit-follow-on-close option (github #244). * Add 'H' color type to set color of header lines. * Add #version conditional to lesskey. * Add += syntax to variable section in lesskey files. * Allow option name in -- command to end with '=' in addition to '\n'. * Add $HOME/.config to possible locations of lesskey file (github #153). * Add $XDG_STATE_HOME and $HOME/.local/state to possible locations of history file (github #223). * Don't read or write history file in secure mode (github #201). * Fix display of multibyte and double-width chars in prompt. * Fix ESC-BACKSPACE command when BACKSPACE key does not send 0x08 (github #188). * Add more \k codes to lesskey format. * Fix bug when empty file is modified while viewing it. * Fix bug when parsing a malformed lesskey file (githb #234). * Fix bug scrolling history when --incsearch is set (github #214). * Fix buffer overflow when invoking lessecho with more than 63 -m/-n options (github #198). * Fix buffer overflow in bin_file (github #271). * Fix bug restoring color at end of highlighted text. * Fix bug in parsing lesskey file. * Defer moving cursor to lower left in some more cases. * Suppress TAB filename expansion in some cases where it doesn't make sense. * Fix termlib detection when compiler doesn't accept calls to undeclared functions. * Fix bug in input of non-ASCII characters on Windows (github #247) * Escape filenames when invoking LESSCLOSE. * Fix bug using multibyte UTF-8 char in search string with --incsearch (github #273). ====================================================================== Major changes between "less" versions 581 and 590 * Make less able to read lesskey source files (deprecating lesskey). * If XDG_CONFIG_HOME is set, find lesskey source file in $XDG_CONFIG_HOME/lesskey rather than $HOME/.lesskey. * If XDG_DATA_HOME is set, find and store history file in $XDG_DATA_HOME/lesshst rather than $HOME/.lesshst. * Add the --lesskey-src option. * Add the --file-size option. * With -F, if screen is resized to make file fit on one screen, don't exit. * Fix bug which could leave terminal in mouse-reporting mode after exiting less. * Fix bug which caused failure to respond to window resize. * Fix backslash bug searching in tag file. ====================================================================== Major changes between "less" versions 563 and 581 * Change ESC-u command to toggle, not disable, highlighting per man page. * Add ESC-U command. * Add ctrl-W search modifier for wrapping search. * F command can be interrupted by ^X. * Support OSC 8 hyperlinks when -R is in effect. * g command with no number will ignore -j and put first line at top of screen. * Multiple + or -p command line options are handled better. * Add the --incsearch option. * Add the --line-num-width option. * Add the --status-col-width option. * Add the --use-color and --color options. * Display -w highlight even if highlighted line is empty. * If search result is in a long line, scroll to ensure it is visible. * Editing the same file under different names now creates only one entry in the file list. * Make visual bell more visible on some terminals. * Ring end-of-file bell no more than once per second. * Build can use either Python or Perl for Makefile.aut operations. * Fix crash when using the @ search modifier. * Fix crash in the 's' command due to duplicate free. * Fix realpath crash on Darwin. ====================================================================== Major changes between "less" versions 551 and 563 * Update Unicode tables. * Treat Hangul Jamo medial vowels and final consonants as zero width. * Display error message immediately when -o is toggled and input is not a pipe. * Fix regression: make screen repaint when "squished" and a no-movement command is given. * Fix erroneous EOF calculation when F command is interrupted. * Make WIN32C version include this fix from 551: Don't count lines in initial screen if using -X with -F. * Fix display bug in WIN32C version. * Fix memory corruption when built with libtermcap. * Support libtinfow. ====================================================================== Major changes between "less" versions 530 and 551 * Add --mouse option. * Add --wheel-lines option. * Add --no-histdups option. * Add --save-marks option. * Support PCRE2 regular expression library. * Redraw screen on SIGWINCH even if screen size doesn't change. * Shell-escape filenames in history so they can be used again. * Ring bell if user enters invalid long option name. * Use PCRE_UTF8 flag for pcre regular expressions when in UTF-8 mode. * Windows: use wide-char string to set console title. * Don't count lines in initial screen if using -X with -F. * Support mingw build system. * Fix bug in v command on empty file. * Fix bug in v command when filename contains shell metacharacters. ====================================================================== Major changes between "less" versions 487 and 530 * Don't output terminal init sequence if using -F and file fits on one screen. * When using -S, mark truncated lines with a special character. The character can be changed or disabled via the new --rscroll option. * New command M marks the last line displayed on the screen. * New command ESC-m removes a line mark. * Status column (enabled via -J) now shows mark letters. * Status column shows search matches even if highlighting is disabled via -G. * A second ESC-u command will clear search match markers in the status column. * Do same ANSI escape code filtering for tag matching that we do for searching, to help when viewing syntax-highlighted code. * Catch SIGTERM and clean up before exiting. * Fix bug initializing default charset on Windows. * Handle keypad ENTER key correctly if it sends something other than newline. * Fix buffering bug when using stdin with a LESSOPEN pipe. * On Windows, allow 'u' in -D option to enable underlining. * On Windows, use underline in sgr mode. * On Windows, convert UTF-8 to multibyte if console is not UTF-8. * Update Unicode tables to 2017-03-08. * Pass-thru Unicode formatting chars (Cf type) instead of treating them as binary chars. But treat them as binary if -U is set. * Fix erroneous binary file warning when UTF-8 file contains ANSI SGR sequences. * Fix bugs when using LESSOPEN and switching between stdin and other files. * Fix some bugs handling filenames containing shell metacharacters. * Fix some memory leaks. * Allow some debugging environment variables to be set in lesskey file. * Code improvements: . Use ANSI prototypes in funcs.h declarations. . Fix some const mismatches. . Remove archaic "register" in variable declarations. ====================================================================== Major changes between "less" versions 481 and 487 * New commands ESC-{ and ESC-} to shift to start/end of displayed lines. * Make search highlights work correctly when changing caselessness with -i. * New option -Da in Windows version to enable SGR mode. * Fix "nothing to search" error when top or bottom line on screen is empty. * Fix bug when terminal has no "cm" termcap entry. * Fix incorrect display when entering double-width chars in search string. * Fix bug in Unicode handling that missed some double width characters. * Update Unicode database to 9.0.0. ====================================================================== Major changes between "less" versions 458 and 481 * Don't overwrite history file; just append to it. * New command ESC-G goes to end of currently buffered data in a pipe. * Disable history feature when compiled with LESSHISTFILE set to "-". * In more-compatible mode, make the -p option apply to every file opened, not just the first one. * In more-compatible mode, change the -e option to work like -E, not -EF. * Treat multiple CRs before LF are like one CR (all the CRs are hidden). * Allow "extra" string in lesskey file to append to a multi-char command (like a search pattern), without executing the command. * Ignore -u/-U setting while viewing help file, so that underline and bold chars are displayed correctly. * Improve detection of "binary" files in UTF-8 mode. * Fix bug with ++ commands. * Fix bug where prompt was sometimes not displayed with +G. * Fix possible memory corruption * Fix bugs and improve performance in ampersand filtering. * Automate construction of Unicode tables from Unicode database. * Allow %% escape sequence in LESSOPEN variable. ====================================================================== Major changes between "less" versions 451 and 458 * Allow backslash escaping of metacharacters in LESS environment variable after the --use-backslash option. * Don't quit if syntax errors are found in command line options. * Increase sizes of some internal buffers. * Fix configure bug with --with-regex=none. * Fix crash with "stty rows 0". * Fix Win32 attribute display bug. * Fix display bug when using up/down arrow on the command line. ====================================================================== Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. * Use exit code of LESSOPEN script if LESSOPEN starts with "||". * When up/down arrow is used on the command line immediately after typing text, the next command starting with that text is found. * Add support for GNU regex. * Add configure option --with-regex=none and fix compile errors when compiling with no regex library. * Fix bugs handling SGR sequences in Win32. * Fix possible crashes caused by malformed LESSOPEN or LESSCLOSE variables. * Fix bug highlighting text which is discontiguous in the file due to backspace processing. * Fix bug in displaying status column when scrolling backwards with -J and -S in effect. ====================================================================== Major changes between "less" versions 443 and 444 * Fix bug in unget handling that can cause strange effects on the command line. * Remove vestiges of obsolete -l option that can cause a crash. ====================================================================== Major changes between "less" versions 436 and 443 * Change search behavior such that when a search is given an explicit pattern, the entire displayed screen is included in the search and not just the portion after the target line. * Add -A option to change search behavior to the old way: only the portion of the screen after the target line is searched. * Add %F formatting to prompt strings, replaced by the last component of the input file. * Control-G while editing a command exits the command. * Less now exits with status 2 if control-C is pressed and -K is in effect. * Fix "ungetc overflow" when passing long commands via the -p option. * Fix bug in using line filtering via the & command in combination with -i and -I. * Fix bug in handling negative arguments to the -j option. * Fix bug in handling %t in prompt strings. * Improve handling of long option names. * Improve percentage calculation for very large files. ====================================================================== Major changes between "less" versions 429 and 436 * Don't pass "-" to non-pipe LESSOPEN unless it starts with "-". * Allow a fraction as the argument to the -# (--shift) option. * Fix highlight bug when underlined/overstruck text matches at end of line. * Fix non-regex searches with ctrl-R. ====================================================================== Major changes between "less" versions 424 and 429 * LESSOPEN pipe will now be used on standard input, if the LESSOPEN environment variable begins with "|-". * The -D option with one number now means use the normal background color. * Don't change permissions on history file if it is not a regular file. * Fix non-ANSI-compliant code that caused problems with some compilers. * Fix binary file detection in UTF-8 mode. * Fix display problems with long lines on "ignaw" terminals. * Fix problem interrupting the line number calculation for initial prompt. * Fix SGR emulation when dealing with multiple attributes (e.g. bold+underline). * Fix highlight bug when searching for underlined/overstruck text. ====================================================================== Major changes between "less" versions 418 and 424 * New "&" command allows filtering of lines based on a pattern. * Status column now displays a search match, even if the matched string is scrolled off screen because -S is in effect. * Improve behavior of -F option. * Allow CSI character (0x9B) to work in UTF-8 mode. * Output carriage return at startup in case terminal doesn't default to column 1. * Fix bug in '' (quote, quote) command after G command. ====================================================================== Major changes between "less" versions 416 and 418 * Color escape sequences are now supported in WIN32 build. * Makefile now uses EXEEXT feature of autoconf. * Fix search bug when using -R and text contains ANSI color escape sequences. * Fix crash when using -r with UTF-8 text containing 0x9B bytes. * Fix display bug when using ' command to move less than one page forward. * Update GPL to version 3. ====================================================================== Major changes between "less" versions 409 and 416 * New --follow-name option makes F command follow the name of a file rather than the file descriptor if an open file is renamed. * Make searching with -i/-I work correctly with non-ASCII text. * Fix DJGPP build. ====================================================================== Major changes between "less" versions 406 and 409 * Support CSI escape sequences, like SGR escape sequences. * Fix bug which caused screen to fail to repaint when window is resized. * Fix bug in using -i and -I flags with non-ASCII text. * Fix configure bug on systems which don't support langinfo.h. * Fix crash when searching text containing certain invalid UTF-8 sequences. ====================================================================== Major changes between "less" versions 394 and 406 * Allow decimal point in number for % (percent) command. * Allow decimal point in number for -j option (fraction of screen height). * Make n command fetch previous pattern from history file on first search. * Don't rewrite history file if it has not changed. * Don't move to bottom of screen on first page. * Don't output extraneous newlines, so copy & pasting lines from the output works better. * The -c option has been made identical with the -C option. * Allow "/dev/null" as synonym for "-" in LESSHISTFILE to indicate that no history file should be used. * Search can now find text which follows a null byte, if the PCRE library is used, or if no-regex searching (ctrl-R) is used. * Better compatibility with POSIX more specification. * Make -f work for directories. * Make "t" cmd traverse tags in the correct order. * Allow a few binary characters in the input file before warning that the file is binary. * Don't warn that file is binary if it merely contains ANSI color sequences and -R is in effect. * Update Unicode character tables. * Support DESTDIR in Makefile. * Fix bug when filename contains certain shell metacharacters such as "$". * Fix bug when resizing the window while waiting for input from a pipe. * Fix configure bugs. ====================================================================== Major changes between "less" versions 382 and 394 * Add history file to save search and shell command history between invocations of less. * Improve behavior of history list for search and shell commands. * Add -K (or --quit-on-intr) option to make less exit immediately on ctrl-C. * Improve handling of UTF-8 files and commands, including better line wrapping and handling double-width chars. * Added LESSUTFBINFMT environment variable to control display of non-printable characters in a UTF-8 file. * Add --with-secure option to configure, to make it easier to build a secure version of less. * Show search matches in the status column even if search highlights are disabled via the -G option or the ESC-u command. * Improve performance when the file contains very long lines. * Add "windows" charset. * Add man page for lessecho. * Add support for erase2 character, treated same as erase. * Use ASCII lowercase/uppercase logic when operating on the command line. * Update makefile for Borland C++ 5.5.1. * Fix bug in calculating number of pages for %D prompt. * Fix bug in handling tag file error. * Fix obscure bug if input file is deleted while viewing help. * Fix bug handling filenames which include square brackets. * Fix possible buffer overflow in "global" tag search. * Fix possible buffer overflow in usage of LESSOPEN and LESSCLOSE. * Fix buffer overflow in reverse search. ====================================================================== Major changes between "less" versions 381 and 382 * Removed some old copyrighted code. This probably breaks OS/9 support. ====================================================================== Major changes between "less" versions 378 and 381 * New -L option to disable LESSOPEN processing. * Further support for large (64 bit) file addressing. Large file support is now set up by the configure script. * Use autoconf 2.54. Replace configure.in, acconfig.h, defines.h.top with configure.ac. * Overstriking underscore with underscore is now bold or underlined depending on context. * Use only 7 spaces for line numbers in -N mode, if possible. * Fix some bugs in handling overstriking in UTF-8 files. * Fix some nroff issues in the man page. ====================================================================== Major changes between "less" versions 376 and 378 * Bug fixes: Default buffer space is now 64K as documented. Search highlighting works properly when used with -R. Windows version works properly when input file contains carriage returns. Clean up some compiler warnings. ====================================================================== Major changes between "less" versions 358 and 376 * -x option can now specify multiple variable-width tab stops. * -X option no longer disables keypad initialization. New option --no-keypad disables keypad initialization. * New commands t and T step through multiple tag matches. Added support for "global(1)" tags (see http://www.gnu.org/software/global/global.html). * New prompt style set by option -Pw defines the message printed while waiting for data in the F command. * System-wide lesskey file now defaults to sysless in etc directory instead of .sysless in bin directory. Use "configure --sysconfdir=..." to change it. (For backwards compatibility, .sysless in bin is still recognized.) * Pressing RightArrow or LeftArrow while entering a number now shifts the display N columns rather than editing the number itself. * Status column (enabled with -J) now shows search results. * Windows version sets window title. * Default LESSCHARSET for MS-DOS versions is now "dos". * Searching works better with ANSI (SGR) escape sequences. ANSI color escape sequences are now supported in the MS-DOS (DJGPP) version. * Improved performance in reading very large pipes. * Eliminated some dependencies on file offsets being 32 bits. * Fixed problems when viewing files with very long lines. * Fixed overstriking in UTF-8 mode, and overstriking tabs. * Improved horizontal shifting of text using -R option with ANSI color. * Improved handling of filenames containing shell metacharacters. * Some fixes for EBCDIC systems. * Some fixes for OS/2 systems. ====================================================================== Major changes between "less" versions 354 and 358 * Add -J (--status-column) option to display a status column. * Add -# (--shift) option to set default horizontal shift distance. Default horizontal shift distance is now one-half screen width. * Horizontal shifting does not shift line numbers if -N is in effect. * Horizontal shifting acts as though -S were set, to avoid confusion. ====================================================================== Major changes between "less" versions 352 and 354 * Allow space after numeric-valued command line options. * Fix problem with configuring terminal libraries on some systems. * Add support for PCRE regular expression library. * Add --with-regex option to configure to allow manually selecting a regular expression library. * Fix bug compiling with SECURE = 1. ====================================================================== Major changes between "less" versions 346 and 352 * Enable UTF-8 if "UTF-8" appears in locale-related environment variables. * Add --with-editor option to configure script. * The -M prompt and = message now show the top and bottom line number. * Fix bug in running the editor on a file whose name contains quotes, etc. * Fix bug in horizontal scrolling of long lines. * Fix bug in doing :d on a file which contains marks. * Fix bug causing cleared lines to sometimes be filled with standout, bold, underline, etc. on certain terminals. * Fixes for MS-DOS (DJGPP) version. ====================================================================== Major changes between "less" versions 340 and 346 * The UTF-8 character set is now supported. * The default character set is now latin1 rather than ascii. * New option -R (--RAW-CONTROL-CHARS) is like -r but handles long (wrapped) lines correctly, as long as the input contains only normal text and ANSI color escape sequences. * New option -F (--quit-if-one-screen) quits if the text fits on the first screen. * The -w option now highlights the target line of a g or p command. * A system-wide lesskey file is supported (LESSKEY_SYSTEM). * New escape for prompt strings: %c is replaced by column number. * New escape for prompt strings: %P is replaced by percentage into file, based on line number rather than byte offset. * HOME and END keys now jump to beginning of file or end of file. ====================================================================== Major changes between "less" versions 337 and 340 * Command line options for less may now be given in either the old single-letter form, or a new long name form (--option-name). See the less man page or "less --help" for the list of long option names. * Command line options for lesskey may now be given in a new long name form. See the lesskey man page for the list of long option names. * New command -- toggles an option using the long option name. * New command __ queries an option using the long option name. * The old -- command is renamed as -!. * If a ^P is entered between the dash and the option letter of the - command, the message describing the new setting is suppressed. * Lesskey files may now contain \k escape sequences to represent the "special" keys (arrows, PAGE-UP/PAGE-DOWN, HOME, END, INSERT, DELETE). * New command :d removes the current file from the list of files. * New option -~ (like -w before version 335) suppresses tildes after end-of-file. * Less is now released under the GNU General Public License. ====================================================================== Major changes between "less" versions 335 and 337 * Fixed bugs in "make install". ====================================================================== Major changes between "less" versions 332 and 335 * The old -w flag (suppress tildes after end-of-file) has been removed. * New -w flag highlights the first new line after a forward-screen. * New -W flag highlights the first new line after any forward movement. * Window resize works even if LINES and/or COLUMNS environment variables are incorrect. * New percent escapes for prompt strings: %d is replaced by the page number, and %D is replaced by the number of pages in the file. * Added charsets "iso8859" and "ebcdic". * In Windows version, uses HOMEDRIVE and HOMEPATH if HOME is not defined. * Fixed some bugs causing incorrect display on DOS/Windows. ====================================================================== Major changes between "less" versions 330 and 332 * Filenames from the command line are entered into the command history, so UPARROW/DOWNARROW can be used to retrieve them from the :e command. * Now works correctly on Windows when using a scrolling terminal window (buffer larger than display window). * On Windows, now restores the console screen on exit. Use -X to get the old behavior. * Fixed bug on Windows when CAPS-LOCK or NUM-LOCK is pressed. * Fixed bug on Windows when piping output of an interactive program. * Fixed bug in tags file processing when tags file has DOS-style line terminators (CR/LF). * Fixed compilation problem on OS/2. ====================================================================== Major changes between "less" versions 321 and 330 * Now supports filenames containing spaces (in double quotes). New option -" can be used to change the quoting characters. * In filename completion, a slash is appended to a directory name. If the environment variable LESSSEPARATOR is set, the value of that variable, rather than a slash, is appended. * LeftArrow and RightArrow are same as ESC-[ and ESC-]. * Added commands ESC-( and ESC-), same as ESC-[ and ESC-]. * A "quit" command defined in a lesskey file may now have an "extra" string, which is used to return an exit code from less when it quits. * New environment variables LESSMETACHARS and LESSMETAESCAPE provide more control over how less interfaces to the shell. * Ported to Microsoft Visual C compiler for Windows. * Ported to DJGPP compiler for MS-DOS. * Bug fixes. ====================================================================== Major changes between "less" versions 291 and 321 * Command line at bottom of screen now scrolls, so it can be longer than the screen width. * New commands ESC-] and ESC-[ scroll the display horizontally. * New command ESC-SPACE scrolls forward a full screen, even if it hits end-of-file. * Alternate modifiers for search commands: ^N is same as !, ^F is same as @, and ^E is same as *. * New modifier for search commands: ^K means highlight the matches currently on-screen, but don't move to the first match. * New modifier for search commands: ^R means don't use regular expressions in the search. * Environment variable LESSKEY gives name of default lesskey file. * Environment variable LESSSECURE will force less to run in "secure" mode. * Command line argument "--" signals that the rest of the arguments are files (not option flags). * Help file (less.hlp) is no longer installed. Help text is now embedded in the less executable itself. * Added -Ph to change the prompt for the help text. Added -Ps to change the default short prompt (same as plain -P). * Ported to the Borland C compiler for MS-DOS. * Ported to Windows 95 & Windows NT. * Ported to OS-9. * Ported to GNU Hurd. ====================================================================== Major changes between "less" versions 290 and 291 * Less environment variables can be specified in lesskey files. * Fixed MS-DOS build. ====================================================================== Major changes between "less" versions 278 and 290 * Accepts GNU-style options "--help" and "--version". * OS/2 version looks for less.ini in $HOME before $INIT and $PATH. * Bug fixes ====================================================================== Major changes between "less" versions 252 and 278 * A LESSOPEN preprocessor may now pipe the converted file data to less, rather than writing it to a temporary file. * Search pattern highlighting has been fixed. It now highlights reliably, even if a string is split across two screen lines, contains TABs, etc. * The -F flag (which suppress search highlighting) has been changed to -G. A new flag, -g, changes search highlighting to highlight only the string found by the last search command, instead of all strings which match the last search command. * New flag -I acts like -i, but ignores case even if the search pattern contains uppercase letters. * Less now checks for the environment variable VISUAL before EDITOR. * Ported to OS/2. ====================================================================== Major changes between "less" versions 237 and 252 * Changes in line-editing keys: The literal key is now ^V or ^A rather than \ (backslash). Filename completion commands (TAB and ^L) are disabled when typing a search pattern. * Line-editing command keys can be redefined using lesskey. * Lesskey with no input file defaults to $HOME/.lesskey rather than standard input. * New option -V displays version number of less. * New option -V displays version number of lesskey. * Help file less.hlp is now installed by default in /usr/local/share rather than /usr/local/lib. ====================================================================== Major changes between "less" versions 170 and 237 * By popular demand, text which matches the current search pattern is highlighted. New -F flag disables this feature. * Henry Spencer's regexp.c is now included, for systems which do not have a regular expression library. regexp.c is Copyright (c) 1986 by University of Toronto. * New line-editing keys, including command history (arrow keys) and filename completion (TAB). * Input preprocessor allows modification of input files (e.g. uncompress) via LESSOPEN/LESSCLOSE environment variables. * New -X flag disables sending termcap "ti" and "te" (initialize and deinitialize) strings to the terminal. * Changing -i from within less now correctly affects a subsequent repeated search. * Searching for underlined or overstruck text now works when the -u flag is in effect, rather than the -i flag. * Use setlocale (LANG and LC_CTYPE environment variables) to determine the character set if LESSCHARSET/LESSCHARDEF are not set. * The default format for displaying binary characters is now standout (reverse video) rather than blinking. This can still be changed by setting the LESSBINFMT environment variable. * Use autoconf installation technology. * Ported to MS-DOS. ******************************** Things that may surprise you ******************************** * When you enter text at the bottom of the screen (search string, filename, etc.), some keys act different than previously. Specifically, \ (backslash), ESC, TAB, BACKTAB, and control-L now have line editing functions. * Some previous unofficial versions of less were able to display compressed files. The new LESSOPEN/LESSCLOSE feature now provides this functionality in a different way. * Some previous unofficial versions of less provided a -Z flag to set the number of lines of text to retain between full screen scrolls. The -z-n flag (that is, -z with a negative number) provides this functionality. ====================================================================== Major changes between "less" versions 123 and 170 * New option -j allows target lines to be positioned anywhere on screen. * New option -S truncates displayed line at the screen width, rather than wrapping onto the next line. * New option -y limits amount of forward scroll. * New option -T specifies a "tags" file. * Non-printable, non-control characters are displayed in octal. Such characters, as well as control characters, are displayed in blinking mode. * New command -+ sets an option to its default. * New command -- sets an option to the opposite of its default. * Lesskey file may have a string appended to a key's action, which acts as though typed in after the command. * New commands ESC-^F and ESC-^B match arbitrary types of brackets. * New command F monitors a growing file (like "tail -f"). * New command | pipes a section of the input file into a shell command. * New command :x directly jumps to a file in the command line list. * Search commands have been enhanced and reorganized: n Repeat search, same direction. N Repeat search, opposite direction. ESC-/ Search forward thru file boundaries ESC-? Search backward thru file boundaries ESC-n Repeat search thru file boundaries, same direction. ESC-N Repeat search thru file boundaries, opposite direction. Special character * causes search to search thru file boundaries. Special character @ causes search to begin at start/end of file list. * Examining a new file adds it to the command line list. A list of files, or an expression which matches more than one file, may be examined; all of them are added to the command line list. * Environment variables LESSCHARSET and LESSCHARDEF can define a non-ASCII character set. * Partial support for MSDOS, including options -R for repainting screen on quit, -v/-V to select video mode, and -W to change window size. ====================================================================== Major changes between "less" versions 97 and 123 * New option (-N) causes line numbers to be displayed in the text of the file (like vi "set nu"). * New option (-?) prints help message immediately. * New option (-r) displays "raw" control characters, without mapping them to ^X notation. * New option (-f) forces less to open non-regular files (directories, etc). * New option (-k) can be used to specify lesskey files by name. * New option (-y) can be used to set a forward scroll limit (like -h sets a backward scroll limit). * File marks (set by the m command) are now preserved when a new file is edited. The ' command can thus be used to switch files. * New command ESC-/ searches all files (on the command line) for a pattern. * New command ESC-n repeats previous search, spanning files. * The N command has been changed to repeat the previous search in the reverse direction. The old N command is still available via :n. * New command ESC-N repeats previous search in the reverse direction and spanning files. * 8 bit characters are now supported. A new option (-g) can be used to strip off the eighth bit (the previous behavior). * Options which take a following string (like -t) may now optionally have a space between the option letter and the string. * Six new commands { } ( ) [ and ] can be used to match brackets of specific types, similar to vi % command. * New commands z and w move forward/backward one window and simultaneously set the window size. * Prompt string expansion now has %L for line number of the last line in the file, and %E for the name of the editor. Also, % escapes which refer to a line (b=bottom, t=top, etc.) can use j for the jump target line. * New environment variable LESSEDIT can be used to tailor the command string passed to the editor by the v command. * Examining a file which was previously examined will return to the same position in the file. * A "%" is expanded to the current filename and a "#" to the previous filename, in both shell commands and the E command. (Previously % worked only in shell commands and # worked only in the E command.) * New command ":ta" is equivalent to "-t". * New command "s" is equivalent to "-l". * The - command may be followed by "+X" to revert to the default for option X, or "-X" to get the opposite of the default. * Lesskey files may now include characters after the action as extra input to be parsed after the action; for example: "toggle-option X" to toggle a specific option X. diff --git a/contrib/less/decode.c b/contrib/less/decode.c index 2942a30863cb..8e451d1810c9 100644 --- a/contrib/less/decode.c +++ b/contrib/less/decode.c @@ -1,1244 +1,1244 @@ /* * Copyright (C) 1984-2025 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. */ /* * Routines to decode user commands. * * This is all table driven. * A command table is a sequence of command descriptors. * Each command descriptor is a sequence of bytes with the following format: * ...<0> * The characters c1,c2,...,cN are the command string; that is, * the characters which the user must type. * It is terminated by a null <0> byte. * The byte after the null byte is the action code associated * with the command string. * If an action byte is OR-ed with A_EXTRA, this indicates * that the option byte is followed by an extra string. * * There may be many command tables. * The first (default) table is built-in. * Other tables are read in from "lesskey" files. * All the tables are linked together and are searched in order. */ #include "less.h" #include "cmd.h" #include "lesskey.h" extern int erase_char, erase2_char, kill_char; extern int mousecap; extern int sc_height; static constant lbool allow_drag = TRUE; #if USERFILE /* "content" is lesskey source, never binary. */ static void add_content_table(int (*call_lesskey)(constant char *, lbool), constant char *envname, lbool sysvar); static int add_hometable(int (*call_lesskey)(constant char *, lbool), constant char *envname, constant char *def_filename, lbool sysvar); #endif /* USERFILE */ #define SK(k) \ SK_SPECIAL_KEY, (k), 6, 1, 1, 1 /* * Command table is ordered roughly according to expected * frequency of use, so the common commands are near the beginning. */ static unsigned char cmdtable[] = { '\r',0, A_F_LINE, '\n',0, A_F_LINE, 'e',0, A_F_LINE, 'j',0, A_F_LINE, SK(SK_DOWN_ARROW),0, A_F_LINE, CONTROL('E'),0, A_F_LINE, CONTROL('N'),0, A_F_LINE, 'k',0, A_B_LINE, 'y',0, A_B_LINE, CONTROL('Y'),0, A_B_LINE, SK(SK_CONTROL_K),0, A_B_LINE, CONTROL('P'),0, A_B_LINE, SK(SK_UP_ARROW),0, A_B_LINE, 'J',0, A_FF_LINE, 'K',0, A_BF_LINE, 'Y',0, A_BF_LINE, 'd',0, A_F_SCROLL, CONTROL('D'),0, A_F_SCROLL, 'u',0, A_B_SCROLL, CONTROL('U'),0, A_B_SCROLL, ESC,'[','M',0, A_X11MOUSE_IN, ESC,'[','<',0, A_X116MOUSE_IN, ' ',0, A_F_SCREEN, 'f',0, A_F_SCREEN, CONTROL('F'),0, A_F_SCREEN, CONTROL('V'),0, A_F_SCREEN, SK(SK_PAGE_DOWN),0, A_F_SCREEN, 'b',0, A_B_SCREEN, CONTROL('B'),0, A_B_SCREEN, ESC,'v',0, A_B_SCREEN, SK(SK_PAGE_UP),0, A_B_SCREEN, 'z',0, A_F_WINDOW, 'w',0, A_B_WINDOW, ESC,' ',0, A_FF_SCREEN, ESC,'b',0, A_BF_SCREEN, ESC,'j',0, A_F_NEWLINE, ESC,'k',0, A_B_NEWLINE, 'F',0, A_F_FOREVER, ESC,'F',0, A_F_UNTIL_HILITE, 'R',0, A_FREPAINT, 'r',0, A_REPAINT, CONTROL('R'),0, A_REPAINT, CONTROL('L'),0, A_REPAINT, ESC,'u',0, A_UNDO_SEARCH, ESC,'U',0, A_CLR_SEARCH, 'g',0, A_GOLINE, SK(SK_HOME),0, A_GOLINE, '<',0, A_GOLINE, ESC,'<',0, A_GOLINE, 'p',0, A_PERCENT, '%',0, A_PERCENT, ESC,'(',0, A_LSHIFT, ESC,')',0, A_RSHIFT, ESC,'{',0, A_LLSHIFT, ESC,'}',0, A_RRSHIFT, SK(SK_RIGHT_ARROW),0, A_RSHIFT, SK(SK_LEFT_ARROW),0, A_LSHIFT, SK(SK_CTL_RIGHT_ARROW),0, A_RRSHIFT, SK(SK_CTL_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, ')',0, A_B_BRACKET|A_EXTRA, '(',')',0, '[',0, A_F_BRACKET|A_EXTRA, '[',']',0, ']',0, A_B_BRACKET|A_EXTRA, '[',']',0, ESC,CONTROL('F'),0, A_F_BRACKET, ESC,CONTROL('B'),0, A_B_BRACKET, 'G',0, A_GOEND, ESC,'G',0, A_GOEND_BUF, ESC,'>',0, A_GOEND, '>',0, A_GOEND, SK(SK_END),0, A_GOEND, 'P',0, A_GOPOS, '0',0, A_DIGIT, '1',0, A_DIGIT, '2',0, A_DIGIT, '3',0, A_DIGIT, '4',0, A_DIGIT, '5',0, A_DIGIT, '6',0, A_DIGIT, '7',0, A_DIGIT, '8',0, A_DIGIT, '9',0, A_DIGIT, '.',0, A_DIGIT, '=',0, A_STAT, CONTROL('G'),0, A_STAT, ':','f',0, A_STAT, '/',0, A_F_SEARCH, '?',0, A_B_SEARCH, ESC,'/',0, A_F_SEARCH|A_EXTRA, '*',0, ESC,'?',0, A_B_SEARCH|A_EXTRA, '*',0, 'n',0, A_AGAIN_SEARCH, ESC,'n',0, A_T_AGAIN_SEARCH, 'N',0, A_REVERSE_SEARCH, ESC,'N',0, A_T_REVERSE_SEARCH, '&',0, A_FILTER, 'm',0, A_SETMARK, 'M',0, A_SETMARKBOT, ESC,'m',0, A_CLRMARK, '\'',0, A_GOMARK, CONTROL('X'),CONTROL('X'),0, A_GOMARK, 'E',0, A_EXAMINE, ':','e',0, A_EXAMINE, CONTROL('X'),CONTROL('V'),0, A_EXAMINE, ':','n',0, A_NEXT_FILE, ':','p',0, A_PREV_FILE, CONTROL('O'),CONTROL('N'),0, A_OSC8_F_SEARCH, CONTROL('O'),'n',0, A_OSC8_F_SEARCH, CONTROL('O'),CONTROL('P'),0, A_OSC8_B_SEARCH, CONTROL('O'),'p',0, A_OSC8_B_SEARCH, CONTROL('O'),CONTROL('O'),0, A_OSC8_OPEN, CONTROL('O'),'o',0, A_OSC8_OPEN, CONTROL('O'),CONTROL('L'),0, A_OSC8_JUMP, CONTROL('O'),'l',0, A_OSC8_JUMP, 't',0, A_NEXT_TAG, 'T',0, A_PREV_TAG, ':','x',0, A_INDEX_FILE, ':','d',0, A_REMOVE_FILE, '-',0, A_OPT_TOGGLE, ':','t',0, A_OPT_TOGGLE|A_EXTRA, 't',0, 's',0, A_OPT_TOGGLE|A_EXTRA, 'o',0, '_',0, A_DISP_OPTION, '|',0, A_PIPE, 'v',0, A_VISUAL, '!',0, A_SHELL, '#',0, A_PSHELL, '+',0, A_FIRSTCMD, ESC,'[','2','0','0','~',0, A_START_PASTE, ESC,'[','2','0','1','~',0, A_END_PASTE, 'H',0, A_HELP, 'h',0, A_HELP, SK(SK_F1),0, A_HELP, 'V',0, A_VERSION, 'q',0, A_QUIT, 'Q',0, A_QUIT, ':','q',0, A_QUIT, ':','Q',0, A_QUIT, 'Z','Z',0, A_QUIT }; static unsigned char edittable[] = { '\t',0, EC_F_COMPLETE, /* TAB */ '\17',0, EC_B_COMPLETE, /* BACKTAB */ SK(SK_BACKTAB),0, EC_B_COMPLETE, /* BACKTAB */ ESC,'\t',0, EC_B_COMPLETE, /* ESC TAB */ CONTROL('L'),0, EC_EXPAND, /* CTRL-L */ CONTROL('V'),0, EC_LITERAL, /* BACKSLASH */ CONTROL('A'),0, EC_LITERAL, /* BACKSLASH */ ESC,'l',0, EC_RIGHT, /* ESC l */ SK(SK_RIGHT_ARROW),0, EC_RIGHT, /* RIGHTARROW */ ESC,'h',0, EC_LEFT, /* ESC h */ SK(SK_LEFT_ARROW),0, EC_LEFT, /* LEFTARROW */ ESC,'b',0, EC_W_LEFT, /* ESC b */ ESC,SK(SK_LEFT_ARROW),0, EC_W_LEFT, /* ESC LEFTARROW */ SK(SK_CTL_LEFT_ARROW),0, EC_W_LEFT, /* CTRL-LEFTARROW */ ESC,'w',0, EC_W_RIGHT, /* ESC w */ ESC,SK(SK_RIGHT_ARROW),0, EC_W_RIGHT, /* ESC RIGHTARROW */ SK(SK_CTL_RIGHT_ARROW),0, EC_W_RIGHT, /* CTRL-RIGHTARROW */ ESC,'i',0, EC_INSERT, /* ESC i */ SK(SK_INSERT),0, EC_INSERT, /* INSERT */ ESC,'x',0, EC_DELETE, /* ESC x */ SK(SK_DELETE),0, EC_DELETE, /* DELETE */ ESC,'X',0, EC_W_DELETE, /* ESC X */ ESC,SK(SK_DELETE),0, EC_W_DELETE, /* ESC DELETE */ SK(SK_CTL_DELETE),0, EC_W_DELETE, /* CTRL-DELETE */ SK(SK_CTL_BACKSPACE),0, EC_W_BACKSPACE, /* CTRL-BACKSPACE */ ESC,SK(SK_BACKSPACE),0, EC_W_BACKSPACE, /* ESC BACKSPACE */ ESC,'0',0, EC_HOME, /* ESC 0 */ SK(SK_HOME),0, EC_HOME, /* HOME */ ESC,'$',0, EC_END, /* ESC $ */ SK(SK_END),0, EC_END, /* END */ ESC,'k',0, EC_UP, /* ESC k */ SK(SK_UP_ARROW),0, EC_UP, /* UPARROW */ ESC,'j',0, EC_DOWN, /* ESC j */ SK(SK_DOWN_ARROW),0, EC_DOWN, /* DOWNARROW */ CONTROL('G'),0, EC_ABORT, /* CTRL-G */ ESC,'[','M',0, EC_X11MOUSE, /* X11 mouse report */ ESC,'[','<',0, EC_X116MOUSE, /* X11 1006 mouse report */ ESC,'[','2','0','0','~',0, A_START_PASTE, /* open paste bracket */ ESC,'[','2','0','1','~',0, A_END_PASTE, /* close paste bracket */ }; static unsigned char dflt_vartable[] = { 'L','E','S','S','_','O','S','C','8','_','m','a','n', 0, EV_OK|A_EXTRA, /* echo '%o' | sed -e "s,^man\:\\([^(]*\\)( *\\([^)]*\\)\.*,-man '\\2' '\\1'," -e"t X" -e"s,\.*,-echo Invalid man link," -e"\: X" */ 'e','c','h','o',' ','\'','%','o','\'',' ','|',' ','s','e','d',' ','-','e',' ','"','s',',','^','m','a','n','\\',':','\\','\\','(','[','^','(',']','*','\\','\\',')','(',' ','*','\\','\\','(','[','^',')',']','*','\\','\\',')','\\','.','*',',','-','m','a','n',' ','\'','\\','\\','2','\'',' ','\'','\\','\\','1','\'',',','"',' ','-','e','"','t',' ','X','"',' ','-','e','"','s',',','\\','.','*',',','-','e','c','h','o',' ','I','n','v','a','l','i','d',' ','m','a','n',' ','l','i','n','k',',','"',' ','-','e','"','\\',':',' ','X','"', 0, 'L','E','S','S','_','O','S','C','8','_','f','i','l','e', 0, EV_OK|A_EXTRA, /* eval `echo '%o' | sed -e "s,^file://\\([^/]*\\)\\(.*\\),_H=\\1;_P=\\2;_E=0," -e"t X" -e"s,.*,_E=1," -e": X"`; if [ "$_E" = 1 ]; then echo -echo Invalid file link; elif [ -z "$_H" -o "$_H" = localhost -o "$_H" = $HOSTNAME ]; then echo ":e $_P"; else echo -echo Cannot open remote file on "$_H"; fi */ 'e','v','a','l',' ','`','e','c','h','o',' ','\'','%','o','\'',' ','|',' ','s','e','d',' ','-','e',' ','"','s',',','^','f','i','l','e','\\',':','/','/','\\','\\','(','[','^','/',']','*','\\','\\',')','\\','\\','(','\\','.','*','\\','\\',')',',','_','H','=','\\','\\','1',';','_','P','=','\\','\\','2',';','_','E','=','0',',','"',' ','-','e','"','t',' ','X','"',' ','-','e','"','s',',','\\','.','*',',','_','E','=','1',',','"',' ','-','e','"','\\',':',' ','X','"','`',';',' ','i','f',' ','[',' ','"','$','_','E','"',' ','=',' ','1',' ',']',';',' ','t','h','e','n',' ','e','c','h','o',' ','-','e','c','h','o',' ','I','n','v','a','l','i','d',' ','f','i','l','e',' ','l','i','n','k',';',' ','e','l','i','f',' ','[',' ','-','z',' ','"','$','_','H','"',' ','-','o',' ','"','$','_','H','"',' ','=',' ','l','o','c','a','l','h','o','s','t',' ','-','o',' ','"','$','_','H','"',' ','=',' ','$','H','O','S','T','N','A','M','E',' ',']',';',' ','t','h','e','n',' ','e','c','h','o',' ','"','\\',':','e',' ','$','_','P','"',';',' ','e','l','s','e',' ','e','c','h','o',' ','-','e','c','h','o',' ','C','a','n','n','o','t',' ','o','p','e','n',' ','r','e','m','o','t','e',' ','f','i','l','e',' ','o','n',' ','"','$','_','H','"',';',' ','f','i', 0, }; /* * Structure to support a list of command tables. */ struct tablelist { struct tablelist *t_next; unsigned char *t_start; unsigned char *t_end; }; /* * List of command tables and list of line-edit tables. */ static struct tablelist *list_fcmd_tables = NULL; static struct tablelist *list_ecmd_tables = NULL; static struct tablelist *list_var_tables = NULL; static struct tablelist *list_sysvar_tables = NULL; /* * Expand special key abbreviations in a command table. */ static void expand_special_keys(unsigned char *table, size_t len) { unsigned char *fm; unsigned char *to; int a; constant char *repl; size_t klen; for (fm = table; fm < table + len; ) { /* * Rewrite each command in the table with any * special key abbreviations expanded. */ for (to = fm; *fm != '\0'; ) { if (*fm != SK_SPECIAL_KEY) { *to++ = *fm++; continue; } /* * After SK_SPECIAL_KEY, next byte is the type * of special key (one of the SK_* constants), * and the byte after that is the number of bytes, * N, reserved by the abbreviation (including the * SK_SPECIAL_KEY and key type bytes). * Replace all N bytes with the actual bytes * output by the special key on this terminal. */ repl = special_key_str(fm[1]); klen = fm[2] & 0377; fm += klen; if (repl == NULL || strlen(repl) > klen) repl = "\377"; while (*repl != '\0') *to++ = (unsigned char) *repl++; /*{{type-issue}}*/ } *to++ = '\0'; /* * Fill any unused bytes between end of command and * the action byte with A_SKIP. */ while (to <= fm) *to++ = A_SKIP; fm++; a = *fm++ & 0377; if (a & A_EXTRA) { while (*fm++ != '\0') continue; } } } /* * Expand special key abbreviations in a list of command tables. */ static void expand_cmd_table(struct tablelist *tlist) { struct tablelist *t; for (t = tlist; t != NULL; t = t->t_next) { expand_special_keys(t->t_start, ptr_diff(t->t_end, t->t_start)); } } /* * Expand special key abbreviations in all command tables. */ public void expand_cmd_tables(void) { expand_cmd_table(list_fcmd_tables); expand_cmd_table(list_ecmd_tables); expand_cmd_table(list_var_tables); expand_cmd_table(list_sysvar_tables); } /* * Initialize the command lists. */ public void init_cmds(void) { /* * Add the default command tables. */ add_fcmd_table(cmdtable, sizeof(cmdtable)); add_ecmd_table(edittable, sizeof(edittable)); add_sysvar_table(dflt_vartable, sizeof(dflt_vartable)); #if USERFILE #ifdef BINDIR /* For backwards compatibility */ /* Try to add tables in the OLD system lesskey file. */ add_hometable(lesskey, NULL, BINDIR "/.sysless", TRUE); #endif /* * Try to load lesskey source file or binary file. * If the source file succeeds, don't load binary file. * The binary file is likely to have been generated from * a (possibly out of date) copy of the src file, * so loading it is at best redundant. */ /* * Try to add tables in system lesskey src file. */ #if HAVE_LESSKEYSRC if (add_hometable(lesskey_src, "LESSKEYIN_SYSTEM", LESSKEYINFILE_SYS, TRUE) != 0) #endif { /* * Try to add the tables in the system lesskey binary file. */ add_hometable(lesskey, "LESSKEY_SYSTEM", LESSKEYFILE_SYS, TRUE); } /* * Try to add tables in the lesskey src file "$HOME/.lesskey". */ #if HAVE_LESSKEYSRC if (add_hometable(lesskey_src, "LESSKEYIN", DEF_LESSKEYINFILE, FALSE) != 0) #endif { /* * Try to add the tables in the standard lesskey binary file "$HOME/.less". */ add_hometable(lesskey, "LESSKEY", LESSKEYFILE, FALSE); } add_content_table(lesskey_content, "LESSKEY_CONTENT_SYSTEM", TRUE); add_content_table(lesskey_content, "LESSKEY_CONTENT", FALSE); #endif /* USERFILE */ } /* * Add a command table. */ static int add_cmd_table(struct tablelist **tlist, unsigned char *buf, size_t len) { struct tablelist *t; if (len == 0) return (0); /* * Allocate a tablelist structure, initialize it, * and link it into the list of tables. */ if ((t = (struct tablelist *) calloc(1, sizeof(struct tablelist))) == NULL) { return (-1); } t->t_start = buf; t->t_end = buf + len; t->t_next = NULL; if (*tlist == NULL) *tlist = t; else { struct tablelist *e; for (e = *tlist; e->t_next != NULL; e = e->t_next) continue; e->t_next = t; } return (0); } /* * Remove the last command table in a list. */ static void pop_cmd_table(struct tablelist **tlist) { struct tablelist *t; if (*tlist == NULL) return; if ((*tlist)->t_next == NULL) { t = *tlist; *tlist = NULL; } else { struct tablelist *e; for (e = *tlist; e->t_next->t_next != NULL; e = e->t_next) continue; t = e->t_next; e->t_next = NULL; } free(t); } /* * Add a command table. */ public void add_fcmd_table(unsigned char *buf, size_t len) { if (add_cmd_table(&list_fcmd_tables, buf, len) < 0) error("Warning: some commands disabled", NULL_PARG); } /* * Add an editing command table. */ public void add_ecmd_table(unsigned char *buf, size_t len) { if (add_cmd_table(&list_ecmd_tables, buf, len) < 0) error("Warning: some edit commands disabled", NULL_PARG); } /* * Add an environment variable table. */ static void add_var_table(struct tablelist **tlist, unsigned char *buf, size_t len) { struct xbuffer xbuf; xbuf_init(&xbuf); expand_evars((char*)buf, len, &xbuf); /*{{unsigned-issue}}*/ /* {{ We leak the table in buf. expand_evars scribbled in it so it's useless anyway. }} */ if (add_cmd_table(tlist, xbuf.data, xbuf.end) < 0) error("Warning: environment variables from lesskey file unavailable", NULL_PARG); } public void add_uvar_table(unsigned char *buf, size_t len) { add_var_table(&list_var_tables, buf, len); } public void add_sysvar_table(unsigned char *buf, size_t len) { add_var_table(&list_sysvar_tables, buf, len); } /* * Return action for a mouse wheel down event. */ static int mouse_wheel_down(void) { return ((mousecap == OPT_ONPLUS) ? A_B_MOUSE : A_F_MOUSE); } /* * Return action for a mouse wheel up event. */ static int mouse_wheel_up(void) { return ((mousecap == OPT_ONPLUS) ? A_F_MOUSE : A_B_MOUSE); } /* * Return action for the left mouse button trigger. */ static int mouse_button_left(int x, int y, lbool down, lbool drag) { static int last_drag_y = -1; static int last_click_y = -1; if (down && !drag) { last_drag_y = last_click_y = y; } if (allow_drag && drag && last_drag_y >= 0) { /* Drag text up/down */ if (y > last_drag_y) { cmd_exec(); backward(y - last_drag_y, FALSE, FALSE, FALSE); last_drag_y = y; } else if (y < last_drag_y) { cmd_exec(); forward(last_drag_y - y, FALSE, FALSE, FALSE); last_drag_y = y; } } else if (!down) { #if OSC8_LINK if (osc8_click(y, x)) return (A_NOACTION); #else (void) x; #endif /* OSC8_LINK */ if (y < sc_height-1 && y == last_click_y) { setmark('#', y); screen_trashed(); } } return (A_NOACTION); } /* * Return action for the right mouse button trigger. */ static int mouse_button_right(int x, int y, lbool down, lbool drag) { (void) x; (void) drag; /* * {{ unlike mouse_button_left, we could return an action, * but keep it near mouse_button_left for readability. }} */ if (!down && y < sc_height-1) { gomark('#'); screen_trashed(); } return (A_NOACTION); } /* * Read a decimal integer. Return the integer and set *pterm to the terminating char. */ static int getcc_int(char *pterm) { int num = 0; int digits = 0; for (;;) { char ch = getcc(); if (ch < '0' || ch > '9') { if (pterm != NULL) *pterm = ch; if (digits == 0) return (-1); return (num); } if (ckd_mul(&num, num, 10) || ckd_add(&num, num, ch - '0')) return -1; ++digits; } } static int x11mouse_button(int btn, int x, int y, lbool down, lbool drag) { switch (btn) { case X11MOUSE_BUTTON1: return mouse_button_left(x, y, down, drag); /* is BUTTON2 the rightmost with 2-buttons mouse? */ case X11MOUSE_BUTTON2: case X11MOUSE_BUTTON3: return mouse_button_right(x, y, down, drag); } return (A_NOACTION); } /* * Read suffix of mouse input and return the action to take. * The prefix ("\e[M") has already been read. */ static int x11mouse_action(lbool skip) { static int prev_b = X11MOUSE_BUTTON_REL; int x, y; int b = getcc() - X11MOUSE_OFFSET; lbool drag = ((b & X11MOUSE_DRAG) != 0); b &= ~X11MOUSE_DRAG; x = getcc() - X11MOUSE_OFFSET-1; y = getcc() - X11MOUSE_OFFSET-1; if (skip) return (A_NOACTION); switch (b) { case X11MOUSE_WHEEL_DOWN: return mouse_wheel_down(); case X11MOUSE_WHEEL_UP: return mouse_wheel_up(); case X11MOUSE_BUTTON1: case X11MOUSE_BUTTON2: case X11MOUSE_BUTTON3: prev_b = b; return x11mouse_button(b, x, y, TRUE, drag); case X11MOUSE_BUTTON_REL: /* button up */ return x11mouse_button(prev_b, x, y, FALSE, drag); } return (A_NOACTION); } /* * Read suffix of mouse input and return the action to take. * The prefix ("\e[<") has already been read. */ static int x116mouse_action(lbool skip) { char ch; int x, y; int b = getcc_int(&ch); lbool drag = ((b & X11MOUSE_DRAG) != 0); b &= ~X11MOUSE_DRAG; if (b < 0 || ch != ';') return (A_NOACTION); x = getcc_int(&ch) - 1; if (x < 0 || ch != ';') return (A_NOACTION); y = getcc_int(&ch) - 1; if (y < 0) return (A_NOACTION); if (skip) return (A_NOACTION); switch (b) { case X11MOUSE_WHEEL_DOWN: return mouse_wheel_down(); case X11MOUSE_WHEEL_UP: return mouse_wheel_up(); case X11MOUSE_BUTTON1: case X11MOUSE_BUTTON2: case X11MOUSE_BUTTON3: { lbool down = (ch == 'M'); lbool up = (ch == 'm'); if (up || down) return x11mouse_button(b, x, y, down, drag); break; } } return (A_NOACTION); } /* * Return the largest N such that the first N chars of goal * are equal to the last N chars of str. */ static size_t cmd_match(constant char *goal, constant char *str) { size_t slen = strlen(str); size_t len; for (len = slen; len > 0; len--) if (strncmp(str + slen - len, goal, len) == 0) break; return len; } /* * Return pointer to next command table entry. * Also return the action and the extra string from the entry. */ static constant unsigned char * cmd_next_entry(constant unsigned char *entry, mutable int *action, mutable constant unsigned char **extra, mutable size_t *cmdlen) { int a; constant unsigned char *oentry = entry; while (*entry != '\0') /* skip cmd */ ++entry; if (cmdlen != NULL) *cmdlen = ptr_diff(entry, oentry); do a = *++entry; /* get action */ while (a == A_SKIP); ++entry; /* skip action */ if (extra != NULL) *extra = (a & A_EXTRA) ? entry : NULL; if (a & A_EXTRA) { while (*entry++ != '\0') /* skip extra string */ continue; a &= ~A_EXTRA; } if (action != NULL) *action = a; return entry; } /* * Search a single command table for the command string in cmd. */ static int cmd_search(constant char *cmd, constant unsigned char *table, constant unsigned char *endtable, constant unsigned char **extra, size_t *mlen) { int action = A_INVALID; size_t match_len = 0; if (extra != NULL) *extra = NULL; while (table < endtable) { int taction; const unsigned char *textra; size_t cmdlen; size_t match = cmd_match((constant char *) table, cmd); table = cmd_next_entry(table, &taction, &textra, &cmdlen); if (taction == A_END_LIST) return (-action); if (match >= match_len) { if (match == cmdlen) /* (last chars of) cmd matches this table entry */ { action = taction; *extra = textra; - } else if (match > 0) /* cmd is a prefix of this table entry */ + } else if (match > 0 && action == A_INVALID) /* cmd is a prefix of this table entry */ { action = A_PREFIX; } match_len = match; } } if (mlen != NULL) *mlen = match_len; return (action); } /* * Decode a command character and return the associated action. * The "extra" string, if any, is returned in sp. */ static int cmd_decode(struct tablelist *tlist, constant char *cmd, constant char **sp) { struct tablelist *t; int action = A_INVALID; size_t match_len = 0; /* * Search for the cmd thru all the command tables. * If we find it more than once, take the last one. */ *sp = NULL; for (t = tlist; t != NULL; t = t->t_next) { constant unsigned char *tsp; size_t mlen; int taction = cmd_search(cmd, t->t_start, t->t_end, &tsp, &mlen); if (mlen >= match_len) { match_len = mlen; if (taction == A_UINVALID) taction = A_INVALID; if (taction != A_INVALID) { *sp = (constant char *) tsp; if (taction < 0) { action = -taction; break; } action = taction; } } } if (action == A_X11MOUSE_IN) action = x11mouse_action(FALSE); else if (action == A_X116MOUSE_IN) action = x116mouse_action(FALSE); return (action); } /* * Decode a command from the cmdtables list. */ public int fcmd_decode(constant char *cmd, constant char **sp) { return (cmd_decode(list_fcmd_tables, cmd, sp)); } /* * Decode a command from the edittables list. */ public int ecmd_decode(constant char *cmd, constant char **sp) { return (cmd_decode(list_ecmd_tables, cmd, sp)); } /* * Get the value of an environment variable. * Looks first in the lesskey file, then in the real environment. */ public constant char * lgetenv(constant char *var) { int a; constant char *s; a = cmd_decode(list_var_tables, var, &s); if (a == EV_OK) return (s); s = getenv(var); if (s != NULL && *s != '\0') return (s); a = cmd_decode(list_sysvar_tables, var, &s); if (a == EV_OK) return (s); return (NULL); } /* * Like lgetenv, but also uses a buffer partially filled with an env table. */ public constant char * lgetenv_ext(constant char *var, unsigned char *env_buf, size_t env_buf_len) { constant char *r; size_t e; size_t env_end = 0; for (e = 0;;) { for (; e < env_buf_len; e++) if (env_buf[e] == '\0') break; if (e >= env_buf_len) break; if (env_buf[++e] & A_EXTRA) { for (e = e+1; e < env_buf_len; e++) if (env_buf[e] == '\0') break; } e++; if (e >= env_buf_len) break; env_end = e; } /* Temporarily add env_buf to var_tables, do the lookup, then remove it. */ add_uvar_table(env_buf, env_end); r = lgetenv(var); pop_cmd_table(&list_var_tables); return r; } /* * Is a string null or empty? */ public lbool isnullenv(constant char *s) { return (s == NULL || *s == '\0'); } #if USERFILE /* * Get an "integer" from a lesskey file. * Integers are stored in a funny format: * two bytes, low order first, in radix KRADIX. */ static size_t gint(unsigned char **sp) { size_t n; n = *(*sp)++; n += *(*sp)++ * KRADIX; return (n); } /* * Process an old (pre-v241) lesskey file. */ static int old_lesskey(unsigned char *buf, size_t len) { /* * Old-style lesskey file. * The file must end with either * ...,cmd,0,action * or ...,cmd,0,action|A_EXTRA,string,0 * So the last byte or the second to last byte must be zero. */ if (buf[len-1] != '\0' && buf[len-2] != '\0') return (-1); add_fcmd_table(buf, len); return (0); } /* * Process a new (post-v241) lesskey file. */ static int new_lesskey(unsigned char *buf, size_t len, lbool sysvar) { unsigned char *p; unsigned char *end; int c; size_t n; /* * New-style lesskey file. * Extract the pieces. */ if (buf[len-3] != C0_END_LESSKEY_MAGIC || buf[len-2] != C1_END_LESSKEY_MAGIC || buf[len-1] != C2_END_LESSKEY_MAGIC) return (-1); p = buf + 4; end = buf + len; for (;;) { c = *p++; switch (c) { case CMD_SECTION: n = gint(&p); if (p+n >= end) return (-1); add_fcmd_table(p, n); p += n; break; case EDIT_SECTION: n = gint(&p); if (p+n >= end) return (-1); add_ecmd_table(p, n); p += n; break; case VAR_SECTION: n = gint(&p); if (p+n >= end) return (-1); if (sysvar) add_sysvar_table(p, n); else add_uvar_table(p, n); p += n; break; case END_SECTION: return (0); default: /* * Unrecognized section type. */ return (-1); } } } /* * Set up a user command table, based on a "lesskey" file. */ public int lesskey(constant char *filename, lbool sysvar) { unsigned char *buf; POSITION len; ssize_t n; int f; if (!secure_allow(SF_LESSKEY)) return (1); /* * Try to open the lesskey file. */ f = open(filename, OPEN_READ); if (f < 0) return (1); /* * Read the file into a buffer. * We first figure out the size of the file and allocate space for it. * {{ Minimal error checking is done here. * A garbage .less file will produce strange results. * To avoid a large amount of error checking code here, we * rely on the lesskey program to generate a good .less file. }} */ len = filesize(f); if (len == NULL_POSITION || len < 3) { /* * Bad file (valid file must have at least 3 chars). */ close(f); return (-1); } if ((buf = (unsigned char *) calloc((size_t)len, sizeof(char))) == NULL) { close(f); return (-1); } if (less_lseek(f, (less_off_t)0, SEEK_SET) == BAD_LSEEK) { free(buf); close(f); return (-1); } n = read(f, buf, (size_t) len); close(f); if (n != len) { free(buf); return (-1); } /* * Figure out if this is an old-style (before version 241) * or new-style lesskey file format. */ if (len < 4 || buf[0] != C0_LESSKEY_MAGIC || buf[1] != C1_LESSKEY_MAGIC || buf[2] != C2_LESSKEY_MAGIC || buf[3] != C3_LESSKEY_MAGIC) return (old_lesskey(buf, (size_t) len)); return (new_lesskey(buf, (size_t) len, sysvar)); } #if HAVE_LESSKEYSRC static int lesskey_text(constant char *filename, lbool sysvar, lbool content) { int r; static struct lesskey_tables tables; if (!secure_allow(SF_LESSKEY)) return (1); r = content ? parse_lesskey_content(filename, &tables) : parse_lesskey(filename, &tables); if (r != 0) return (r); add_fcmd_table(tables.cmdtable.buf.data, tables.cmdtable.buf.end); add_ecmd_table(tables.edittable.buf.data, tables.edittable.buf.end); if (sysvar) add_sysvar_table(tables.vartable.buf.data, tables.vartable.buf.end); else add_uvar_table(tables.vartable.buf.data, tables.vartable.buf.end); return (0); } public int lesskey_src(constant char *filename, lbool sysvar) { return lesskey_text(filename, sysvar, FALSE); } public int lesskey_content(constant char *content, lbool sysvar) { return lesskey_text(content, sysvar, TRUE); } void lesskey_parse_error(char *s) { PARG parg; parg.p_string = s; error("%s", &parg); } #endif /* HAVE_LESSKEYSRC */ /* * Add a lesskey file. */ static int add_hometable(int (*call_lesskey)(constant char *, lbool), constant char *envname, constant char *def_filename, lbool sysvar) { char *filename = NULL; constant char *efilename; int r; if (envname != NULL && (efilename = lgetenv(envname)) != NULL) filename = save(efilename); else if (sysvar) /* def_filename is full path */ filename = save(def_filename); else /* def_filename is just basename */ { /* Remove first char (normally a dot) unless stored in $HOME. */ constant char *xdg = lgetenv("XDG_CONFIG_HOME"); if (!isnullenv(xdg)) filename = dirfile(xdg, &def_filename[1], 1); if (filename == NULL) { constant char *home = lgetenv("HOME"); if (!isnullenv(home)) { char *cfg_dir = dirfile(home, ".config", 0); filename = dirfile(cfg_dir, &def_filename[1], 1); free(cfg_dir); } } if (filename == NULL) filename = homefile(def_filename); } if (filename == NULL) return -1; r = (*call_lesskey)(filename, sysvar); free(filename); return (r); } /* * Add the content of a lesskey source file. */ static void add_content_table(int (*call_lesskey)(constant char *, lbool), constant char *envname, lbool sysvar) { constant char *content; (void) call_lesskey; /* not used */ content = lgetenv(envname); if (isnullenv(content)) return; lesskey_content(content, sysvar); } #endif /* USERFILE */ /* * See if a char is a special line-editing command. */ public int editchar(char c, int flags) { int action; int nch; constant char *s; char usercmd[MAX_CMDLEN+1]; /* * An editing character could actually be a sequence of characters; * for example, an escape sequence sent by pressing the uparrow key. * To match the editing string, we use the command decoder * but give it the edit-commands command table * This table is constructed to match the user's keyboard. */ if (c == erase_char || c == erase2_char) return (EC_BACKSPACE); if (c == kill_char) { #if MSDOS_COMPILER==WIN32C if (!win32_kbhit()) #endif return (EC_LINEKILL); } /* * Collect characters in a buffer. * Start with the one we have, and get more if we need them. */ nch = 0; do { if (nch > 0) c = getcc(); usercmd[nch] = c; usercmd[nch+1] = '\0'; nch++; action = ecmd_decode(usercmd, &s); } while (action == A_PREFIX && nch < MAX_CMDLEN); if (action == EC_X11MOUSE) return (x11mouse_action(TRUE)); if (action == EC_X116MOUSE) return (x116mouse_action(TRUE)); if (flags & ECF_NORIGHTLEFT) { switch (action) { case EC_RIGHT: case EC_LEFT: action = A_INVALID; break; } } #if CMD_HISTORY if (flags & ECF_NOHISTORY) { /* * The caller says there is no history list. * Reject any history-manipulation action. */ switch (action) { case EC_UP: case EC_DOWN: action = A_INVALID; break; } } #endif if (flags & ECF_NOCOMPLETE) { /* * The caller says we don't want any filename completion cmds. * Reject them. */ switch (action) { case EC_F_COMPLETE: case EC_B_COMPLETE: case EC_EXPAND: action = A_INVALID; break; } } if ((flags & ECF_PEEK) || action == A_INVALID) { /* * We're just peeking, or we didn't understand the command. * Unget all the characters we read in the loop above. * This does NOT include the original character that was * passed in as a parameter. */ while (nch > 1) { ungetcc(usercmd[--nch]); } } else { if (s != NULL) ungetsc(s); } return action; } diff --git a/contrib/less/help.c b/contrib/less/help.c index 81e0943fe4e2..5d8ba9a1b0fe 100644 --- a/contrib/less/help.c +++ b/contrib/less/help.c @@ -1,329 +1,329 @@ -/* This file was generated by mkhelp.pl from less.hlp at 20:41 on 2025/5/1 */ +/* This file was generated by mkhelp.pl from less.hlp at 19:46 on 2025/5/28 */ #include "less.h" constant char helpdata[] = { '\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','\b','S','U','\b','U','M','\b','M','M','\b','M','A','\b','A','R','\b','R','Y','\b','Y',' ','O','\b','O','F','\b','F',' ','L','\b','L','E','\b','E','S','\b','S','S','\b','S',' ','C','\b','C','O','\b','O','M','\b','M','M','\b','M','A','\b','A','N','\b','N','D','\b','D','S','\b','S','\n', '\n', ' ',' ',' ',' ',' ',' ','C','o','m','m','a','n','d','s',' ','m','a','r','k','e','d',' ','w','i','t','h',' ','*',' ','m','a','y',' ','b','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','n','u','m','b','e','r',',',' ','_','\b','N','.','\n', ' ',' ',' ',' ',' ',' ','N','o','t','e','s',' ','i','n',' ','p','a','r','e','n','t','h','e','s','e','s',' ','i','n','d','i','c','a','t','e',' ','t','h','e',' ','b','e','h','a','v','i','o','r',' ','i','f',' ','_','\b','N',' ','i','s',' ','g','i','v','e','n','.','\n', ' ',' ',' ',' ',' ',' ','A',' ','k','e','y',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','c','a','r','e','t',' ','i','n','d','i','c','a','t','e','s',' ','t','h','e',' ','C','t','r','l',' ','k','e','y',';',' ','t','h','u','s',' ','^','K',' ','i','s',' ','c','t','r','l','-','K','.','\n', '\n', ' ',' ','h',' ',' ','H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','i','s',' ','h','e','l','p','.','\n', ' ',' ','q',' ',' ',':','q',' ',' ','Q',' ',' ',':','Q',' ',' ','Z','Z',' ',' ',' ',' ',' ','E','x','i','t','.','\n', ' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', '\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','M','\b','M','O','\b','O','V','\b','V','I','\b','I','N','\b','N','G','\b','G','\n', '\n', ' ',' ','e',' ',' ','^','E',' ',' ','j',' ',' ','^','N',' ',' ','C','R',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','l','i','n','e',' ',' ',' ','(','o','r',' ','_','\b','N',' ','l','i','n','e','s',')','.','\n', ' ',' ','y',' ',' ','^','Y',' ',' ','k',' ',' ','^','K',' ',' ','^','P',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','l','i','n','e',' ',' ',' ','(','o','r',' ','_','\b','N',' ','l','i','n','e','s',')','.','\n', ' ',' ','E','S','C','-','j',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','f','i','l','e',' ','l','i','n','e',' ','(','o','r',' ','_','\b','N',' ','f','i','l','e',' ','l','i','n','e','s',')','.','\n', ' ',' ','E','S','C','-','k',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','f','i','l','e',' ','l','i','n','e',' ','(','o','r',' ','_','\b','N',' ','f','i','l','e',' ','l','i','n','e','s',')','.','\n', ' ',' ','f',' ',' ','^','F',' ',' ','^','V',' ',' ','S','P','A','C','E',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','w','i','n','d','o','w',' ','(','o','r',' ','_','\b','N',' ','l','i','n','e','s',')','.','\n', ' ',' ','b',' ',' ','^','B',' ',' ','E','S','C','-','v',' ',' ',' ',' ',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','w','i','n','d','o','w',' ','(','o','r',' ','_','\b','N',' ','l','i','n','e','s',')','.','\n', ' ',' ','z',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','w','i','n','d','o','w',' ','(','a','n','d',' ','s','e','t',' ','w','i','n','d','o','w',' ','t','o',' ','_','\b','N',')','.','\n', ' ',' ','w',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','w','i','n','d','o','w',' ','(','a','n','d',' ','s','e','t',' ','w','i','n','d','o','w',' ','t','o',' ','_','\b','N',')','.','\n', ' ',' ','E','S','C','-','S','P','A','C','E',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','w','i','n','d','o','w',',',' ','b','u','t',' ','d','o','n','\'','t',' ','s','t','o','p',' ','a','t',' ','e','n','d','-','o','f','-','f','i','l','e','.','\n', ' ',' ','E','S','C','-','b',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','w','i','n','d','o','w',',',' ','b','u','t',' ','d','o','n','\'','t',' ','s','t','o','p',' ','a','t',' ','b','e','g','i','n','n','i','n','g','-','o','f','-','f','i','l','e','.','\n', ' ',' ','d',' ',' ','^','D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','o','r','w','a','r','d',' ',' ','o','n','e',' ','h','a','l','f','-','w','i','n','d','o','w',' ','(','a','n','d',' ','s','e','t',' ','h','a','l','f','-','w','i','n','d','o','w',' ','t','o',' ','_','\b','N',')','.','\n', ' ',' ','u',' ',' ','^','U',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','B','a','c','k','w','a','r','d',' ','o','n','e',' ','h','a','l','f','-','w','i','n','d','o','w',' ','(','a','n','d',' ','s','e','t',' ','h','a','l','f','-','w','i','n','d','o','w',' ','t','o',' ','_','\b','N',')','.','\n', ' ',' ','E','S','C','-',')',' ',' ','R','i','g','h','t','A','r','r','o','w',' ','*',' ',' ','R','i','g','h','t',' ','o','n','e',' ','h','a','l','f',' ','s','c','r','e','e','n',' ','w','i','d','t','h',' ','(','o','r',' ','_','\b','N',' ','p','o','s','i','t','i','o','n','s',')','.','\n', ' ',' ','E','S','C','-','(',' ',' ','L','e','f','t','A','r','r','o','w',' ',' ','*',' ',' ','L','e','f','t',' ',' ','o','n','e',' ','h','a','l','f',' ','s','c','r','e','e','n',' ','w','i','d','t','h',' ','(','o','r',' ','_','\b','N',' ','p','o','s','i','t','i','o','n','s',')','.','\n', ' ',' ','E','S','C','-','}',' ',' ','^','R','i','g','h','t','A','r','r','o','w',' ',' ',' ','R','i','g','h','t',' ','t','o',' ','l','a','s','t',' ','c','o','l','u','m','n',' ','d','i','s','p','l','a','y','e','d','.','\n', ' ',' ','E','S','C','-','{',' ',' ','^','L','e','f','t','A','r','r','o','w',' ',' ',' ',' ','L','e','f','t',' ',' ','t','o',' ','f','i','r','s','t',' ','c','o','l','u','m','n','.','\n', ' ',' ','F',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','o','r','w','a','r','d',' ','f','o','r','e','v','e','r',';',' ','l','i','k','e',' ','"','t','a','i','l',' ','-','f','"','.','\n', ' ',' ','E','S','C','-','F',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','L','i','k','e',' ','F',' ','b','u','t',' ','s','t','o','p',' ','w','h','e','n',' ','s','e','a','r','c','h',' ','p','a','t','t','e','r','n',' ','i','s',' ','f','o','u','n','d','.','\n', ' ',' ','r',' ',' ','^','R',' ',' ','^','L',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','p','a','i','n','t',' ','s','c','r','e','e','n','.','\n', ' ',' ','R',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','p','a','i','n','t',' ','s','c','r','e','e','n',',',' ','d','i','s','c','a','r','d','i','n','g',' ','b','u','f','f','e','r','e','d',' ','i','n','p','u','t','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', ' ',' ',' ',' ',' ',' ',' ',' ','D','e','f','a','u','l','t',' ','"','w','i','n','d','o','w','"',' ','i','s',' ','t','h','e',' ','s','c','r','e','e','n',' ','h','e','i','g','h','t','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','D','e','f','a','u','l','t',' ','"','h','a','l','f','-','w','i','n','d','o','w','"',' ','i','s',' ','h','a','l','f',' ','o','f',' ','t','h','e',' ','s','c','r','e','e','n',' ','h','e','i','g','h','t','.','\n', ' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', '\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','\b','S','E','\b','E','A','\b','A','R','\b','R','C','\b','C','H','\b','H','I','\b','I','N','\b','N','G','\b','G','\n', '\n', ' ',' ','/','_','\b','p','_','\b','a','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','S','e','a','r','c','h',' ','f','o','r','w','a','r','d',' ','f','o','r',' ','(','_','\b','N','-','t','h',')',' ','m','a','t','c','h','i','n','g',' ','l','i','n','e','.','\n', ' ',' ','?','_','\b','p','_','\b','a','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','S','e','a','r','c','h',' ','b','a','c','k','w','a','r','d',' ','f','o','r',' ','(','_','\b','N','-','t','h',')',' ','m','a','t','c','h','i','n','g',' ','l','i','n','e','.','\n', ' ',' ','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','R','e','p','e','a','t',' ','p','r','e','v','i','o','u','s',' ','s','e','a','r','c','h',' ','(','f','o','r',' ','_','\b','N','-','t','h',' ','o','c','c','u','r','r','e','n','c','e',')','.','\n', ' ',' ','N',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','R','e','p','e','a','t',' ','p','r','e','v','i','o','u','s',' ','s','e','a','r','c','h',' ','i','n',' ','r','e','v','e','r','s','e',' ','d','i','r','e','c','t','i','o','n','.','\n', ' ',' ','E','S','C','-','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','R','e','p','e','a','t',' ','p','r','e','v','i','o','u','s',' ','s','e','a','r','c','h',',',' ','s','p','a','n','n','i','n','g',' ','f','i','l','e','s','.','\n', ' ',' ','E','S','C','-','N',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','R','e','p','e','a','t',' ','p','r','e','v','i','o','u','s',' ','s','e','a','r','c','h',',',' ','r','e','v','e','r','s','e',' ','d','i','r','.',' ','&',' ','s','p','a','n','n','i','n','g',' ','f','i','l','e','s','.','\n', ' ',' ','^','O','^','N',' ',' ','^','O','n',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','S','e','a','r','c','h',' ','f','o','r','w','a','r','d',' ','f','o','r',' ','(','_','\b','N','-','t','h',')',' ','O','S','C','8',' ','h','y','p','e','r','l','i','n','k','.','\n', ' ',' ','^','O','^','P',' ',' ','^','O','p',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','S','e','a','r','c','h',' ','b','a','c','k','w','a','r','d',' ','f','o','r',' ','(','_','\b','N','-','t','h',')',' ','O','S','C','8',' ','h','y','p','e','r','l','i','n','k','.','\n', ' ',' ','^','O','^','L',' ',' ','^','O','l',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','J','u','m','p',' ','t','o',' ','t','h','e',' ','c','u','r','r','e','n','t','l','y',' ','s','e','l','e','c','t','e','d',' ','O','S','C','8',' ','h','y','p','e','r','l','i','n','k','.','\n', ' ',' ','E','S','C','-','u',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','n','d','o',' ','(','t','o','g','g','l','e',')',' ','s','e','a','r','c','h',' ','h','i','g','h','l','i','g','h','t','i','n','g','.','\n', ' ',' ','E','S','C','-','U',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','l','e','a','r',' ','s','e','a','r','c','h',' ','h','i','g','h','l','i','g','h','t','i','n','g','.','\n', ' ',' ','&','_','\b','p','_','\b','a','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','D','i','s','p','l','a','y',' ','o','n','l','y',' ','m','a','t','c','h','i','n','g',' ','l','i','n','e','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', '\t','\t','S','e','a','r','c','h',' ','i','s',' ','c','a','s','e','-','s','e','n','s','i','t','i','v','e',' ','u','n','l','e','s','s',' ','c','h','a','n','g','e','d',' ','w','i','t','h',' ','-','i',' ','o','r',' ','-','I','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','A',' ','s','e','a','r','c','h',' ','p','a','t','t','e','r','n',' ','m','a','y',' ','b','e','g','i','n',' ','w','i','t','h',' ','o','n','e',' ','o','r',' ','m','o','r','e',' ','o','f',':','\n', ' ',' ',' ',' ',' ',' ',' ',' ','^','N',' ','o','r',' ','!',' ',' ','S','e','a','r','c','h',' ','f','o','r',' ','N','O','N','-','m','a','t','c','h','i','n','g',' ','l','i','n','e','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','^','E',' ','o','r',' ','*',' ',' ','S','e','a','r','c','h',' ','m','u','l','t','i','p','l','e',' ','f','i','l','e','s',' ','(','p','a','s','s',' ','t','h','r','u',' ','E','N','D',' ','O','F',' ','F','I','L','E',')','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','^','F',' ','o','r',' ','@',' ',' ','S','t','a','r','t',' ','s','e','a','r','c','h',' ','a','t',' ','F','I','R','S','T',' ','f','i','l','e',' ','(','f','o','r',' ','/',')',' ','o','r',' ','l','a','s','t',' ','f','i','l','e',' ','(','f','o','r',' ','?',')','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','^','K',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','m','a','t','c','h','e','s',',',' ','b','u','t',' ','d','o','n','\'','t',' ','m','o','v','e',' ','(','K','E','E','P',' ','p','o','s','i','t','i','o','n',')','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','^','R',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','u','s','e',' ','R','E','G','U','L','A','R',' ','E','X','P','R','E','S','S','I','O','N','S','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','^','S',' ','_','\b','n',' ',' ',' ',' ',' ','S','e','a','r','c','h',' ','f','o','r',' ','m','a','t','c','h',' ','i','n',' ','_','\b','n','-','t','h',' ','p','a','r','e','n','t','h','e','s','i','z','e','d',' ','s','u','b','p','a','t','t','e','r','n','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','^','W',' ',' ',' ',' ',' ',' ',' ','W','R','A','P',' ','s','e','a','r','c','h',' ','i','f',' ','n','o',' ','m','a','t','c','h',' ','f','o','u','n','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','^','L',' ',' ',' ',' ',' ',' ',' ','E','n','t','e','r',' ','n','e','x','t',' ','c','h','a','r','a','c','t','e','r',' ','l','i','t','e','r','a','l','l','y',' ','i','n','t','o',' ','p','a','t','t','e','r','n','.','\n', ' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', '\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', ' ',' ','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', ' ',' ','{',' ',' ','(',' ',' ','[',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','i','n','d',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t',' ','}',' ',')',' ',']','.','\n', ' ',' ','}',' ',' ',')',' ',' ',']',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','F','i','n','d',' ','o','p','e','n',' ','b','r','a','c','k','e','t',' ','{',' ','(',' ','[','.','\n', ' ',' ','E','S','C','-','^','F',' ','_','\b','<','_','\b','c','_','\b','1','_','\b','>',' ','_','\b','<','_','\b','c','_','\b','2','_','\b','>',' ',' ','*',' ',' ','F','i','n','d',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t',' ','_','\b','<','_','\b','c','_','\b','2','_','\b','>','.','\n', ' ',' ','E','S','C','-','^','B',' ','_','\b','<','_','\b','c','_','\b','1','_','\b','>',' ','_','\b','<','_','\b','c','_','\b','2','_','\b','>',' ',' ','*',' ',' ','F','i','n','d',' ','o','p','e','n',' ','b','r','a','c','k','e','t',' ','_','\b','<','_','\b','c','_','\b','1','_','\b','>','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', ' ',' ',' ',' ',' ',' ',' ',' ','E','a','c','h',' ','"','f','i','n','d',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t','"',' ','c','o','m','m','a','n','d',' ','g','o','e','s',' ','f','o','r','w','a','r','d',' ','t','o',' ','t','h','e',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t',' ','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','m','a','t','c','h','i','n','g',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','o','p','e','n',' ','b','r','a','c','k','e','t',' ','i','n',' ','t','h','e',' ','t','o','p',' ','l','i','n','e','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','E','a','c','h',' ','"','f','i','n','d',' ','o','p','e','n',' ','b','r','a','c','k','e','t','"',' ','c','o','m','m','a','n','d',' ','g','o','e','s',' ','b','a','c','k','w','a','r','d',' ','t','o',' ','t','h','e',' ','o','p','e','n',' ','b','r','a','c','k','e','t',' ','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','m','a','t','c','h','i','n','g',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','c','l','o','s','e',' ','b','r','a','c','k','e','t',' ','i','n',' ','t','h','e',' ','b','o','t','t','o','m',' ','l','i','n','e','.','\n', '\n', ' ',' ','m','_','\b','<','_','\b','l','_','\b','e','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','M','a','r','k',' ','t','h','e',' ','c','u','r','r','e','n','t',' ','t','o','p',' ','l','i','n','e',' ','w','i','t','h',' ','<','l','e','t','t','e','r','>','.','\n', ' ',' ','M','_','\b','<','_','\b','l','_','\b','e','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','M','a','r','k',' ','t','h','e',' ','c','u','r','r','e','n','t',' ','b','o','t','t','o','m',' ','l','i','n','e',' ','w','i','t','h',' ','<','l','e','t','t','e','r','>','.','\n', ' ',' ','\'','_','\b','<','_','\b','l','_','\b','e','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','G','o',' ','t','o',' ','a',' ','p','r','e','v','i','o','u','s','l','y',' ','m','a','r','k','e','d',' ','p','o','s','i','t','i','o','n','.','\n', ' ',' ','\'','\'',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','G','o',' ','t','o',' ','t','h','e',' ','p','r','e','v','i','o','u','s',' ','p','o','s','i','t','i','o','n','.','\n', ' ',' ','^','X','^','X',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','a','m','e',' ','a','s',' ','\'','.','\n', ' ',' ','E','S','C','-','m','_','\b','<','_','\b','l','_','\b','e','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ','C','l','e','a','r',' ','a',' ','m','a','r','k','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', ' ',' ',' ',' ',' ',' ',' ',' ','A',' ','m','a','r','k',' ','i','s',' ','a','n','y',' ','u','p','p','e','r','-','c','a','s','e',' ','o','r',' ','l','o','w','e','r','-','c','a','s','e',' ','l','e','t','t','e','r','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','C','e','r','t','a','i','n',' ','m','a','r','k','s',' ','a','r','e',' ','p','r','e','d','e','f','i','n','e','d',':','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','^',' ',' ','m','e','a','n','s',' ',' ','b','e','g','i','n','n','i','n','g',' ','o','f',' ','t','h','e',' ','f','i','l','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','$',' ',' ','m','e','a','n','s',' ',' ','e','n','d',' ','o','f',' ','t','h','e',' ','f','i','l','e','\n', ' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', '\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','\b','C','H','\b','H','A','\b','A','N','\b','N','G','\b','G','I','\b','I','N','\b','N','G','\b','G',' ','F','\b','F','I','\b','I','L','\b','L','E','\b','E','S','\b','S','\n', '\n', ' ',' ',':','e',' ','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','a','m','i','n','e',' ','a',' ','n','e','w',' ','f','i','l','e','.','\n', ' ',' ','^','X','^','V',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','a','m','e',' ','a','s',' ',':','e','.','\n', ' ',' ',':','n',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','E','x','a','m','i','n','e',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','n','e','x','t',' ','f','i','l','e',' ','f','r','o','m',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', ' ',' ',':','p',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','E','x','a','m','i','n','e',' ','t','h','e',' ','(','_','\b','N','-','t','h',')',' ','p','r','e','v','i','o','u','s',' ','f','i','l','e',' ','f','r','o','m',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', ' ',' ',':','x',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','*',' ',' ','E','x','a','m','i','n','e',' ','t','h','e',' ','f','i','r','s','t',' ','(','o','r',' ','_','\b','N','-','t','h',')',' ','f','i','l','e',' ','f','r','o','m',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', ' ',' ','^','O','^','O',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','O','p','e','n',' ','t','h','e',' ','c','u','r','r','e','n','t','l','y',' ','s','e','l','e','c','t','e','d',' ','O','S','C','8',' ','h','y','p','e','r','l','i','n','k','.','\n', ' ',' ',':','d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','t','h','e',' ','c','u','r','r','e','n','t',' ','f','i','l','e',' ','f','r','o','m',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',' ','l','i','s','t','.','\n', ' ',' ','=',' ',' ','^','G',' ',' ',':','f',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','P','r','i','n','t',' ','c','u','r','r','e','n','t',' ','f','i','l','e',' ','n','a','m','e','.','\n', ' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', '\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','M','\b','M','I','\b','I','S','\b','S','C','\b','C','E','\b','E','L','\b','L','L','\b','L','A','\b','A','N','\b','N','E','\b','E','O','\b','O','U','\b','U','S','\b','S',' ','C','\b','C','O','\b','O','M','\b','M','M','\b','M','A','\b','A','N','\b','N','D','\b','D','S','\b','S','\n', '\n', ' ',' ','-','_','\b','<','_','\b','f','_','\b','l','_','\b','a','_','\b','g','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','T','o','g','g','l','e',' ','a',' ','c','o','m','m','a','n','d',' ','l','i','n','e',' ','o','p','t','i','o','n',' ','[','s','e','e',' ','O','P','T','I','O','N','S',' ','b','e','l','o','w',']','.','\n', ' ',' ','-','-','_','\b','<','_','\b','n','_','\b','a','_','\b','m','_','\b','e','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','T','o','g','g','l','e',' ','a',' ','c','o','m','m','a','n','d',' ','l','i','n','e',' ','o','p','t','i','o','n',',',' ','b','y',' ','n','a','m','e','.','\n', ' ',' ','_','_','\b','<','_','\b','f','_','\b','l','_','\b','a','_','\b','g','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','e',' ','s','e','t','t','i','n','g',' ','o','f',' ','a',' ','c','o','m','m','a','n','d',' ','l','i','n','e',' ','o','p','t','i','o','n','.','\n', ' ',' ','_','_','_','\b','<','_','\b','n','_','\b','a','_','\b','m','_','\b','e','_','\b','>',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','e',' ','s','e','t','t','i','n','g',' ','o','f',' ','a','n',' ','o','p','t','i','o','n',',',' ','b','y',' ','n','a','m','e','.','\n', ' ',' ','+','_','\b','c','_','\b','m','_','\b','d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','e','c','u','t','e',' ','t','h','e',' ','l','e','s','s',' ','c','m','d',' ','e','a','c','h',' ','t','i','m','e',' ','a',' ','n','e','w',' ','f','i','l','e',' ','i','s',' ','e','x','a','m','i','n','e','d','.','\n', '\n', ' ',' ','!','_','\b','c','_','\b','o','_','\b','m','_','\b','m','_','\b','a','_','\b','n','_','\b','d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','e','c','u','t','e',' ','t','h','e',' ','s','h','e','l','l',' ','c','o','m','m','a','n','d',' ','w','i','t','h',' ','$','S','H','E','L','L','.','\n', ' ',' ','#','_','\b','c','_','\b','o','_','\b','m','_','\b','m','_','\b','a','_','\b','n','_','\b','d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','e','c','u','t','e',' ','t','h','e',' ','s','h','e','l','l',' ','c','o','m','m','a','n','d',',',' ','e','x','p','a','n','d','e','d',' ','l','i','k','e',' ','a',' ','p','r','o','m','p','t','.','\n', ' ',' ','|','X','\b','X','_','\b','c','_','\b','o','_','\b','m','_','\b','m','_','\b','a','_','\b','n','_','\b','d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','P','i','p','e',' ','f','i','l','e',' ','b','e','t','w','e','e','n',' ','c','u','r','r','e','n','t',' ','p','o','s',' ','&',' ','m','a','r','k',' ','X','\b','X',' ','t','o',' ','s','h','e','l','l',' ','c','o','m','m','a','n','d','.','\n', ' ',' ','s',' ','_','\b','f','_','\b','i','_','\b','l','_','\b','e',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','a','v','e',' ','i','n','p','u','t',' ','t','o',' ','a',' ','f','i','l','e','.','\n', ' ',' ','v',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','d','i','t',' ','t','h','e',' ','c','u','r','r','e','n','t',' ','f','i','l','e',' ','w','i','t','h',' ','$','V','I','S','U','A','L',' ','o','r',' ','$','E','D','I','T','O','R','.','\n', ' ',' ','V',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','P','r','i','n','t',' ','v','e','r','s','i','o','n',' ','n','u','m','b','e','r',' ','o','f',' ','"','l','e','s','s','"','.','\n', ' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', '\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','O','\b','O','P','\b','P','T','\b','T','I','\b','I','O','\b','O','N','\b','N','S','\b','S','\n', '\n', ' ',' ',' ',' ',' ',' ',' ',' ','M','o','s','t',' ','o','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','c','h','a','n','g','e','d',' ','e','i','t','h','e','r',' ','o','n',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',',','\n', ' ',' ',' ',' ',' ',' ',' ',' ','o','r',' ','f','r','o','m',' ','w','i','t','h','i','n',' ','l','e','s','s',' ','b','y',' ','u','s','i','n','g',' ','t','h','e',' ','-',' ','o','r',' ','-','-',' ','c','o','m','m','a','n','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','O','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','g','i','v','e','n',' ','i','n',' ','o','n','e',' ','o','f',' ','t','w','o',' ','f','o','r','m','s',':',' ','e','i','t','h','e','r',' ','a',' ','s','i','n','g','l','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','-','-','.','\n', '\n', ' ',' ','-','?',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','e','l','p','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','h','e','l','p',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n', ' ',' ','-','a',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','s','e','a','r','c','h','-','s','k','i','p','-','s','c','r','e','e','n','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','a','r','c','h',' ','s','k','i','p','s',' ','c','u','r','r','e','n','t',' ','s','c','r','e','e','n','.','\n', ' ',' ','-','A',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','S','E','A','R','C','H','-','S','K','I','P','-','S','C','R','E','E','N','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','a','r','c','h',' ','s','t','a','r','t','s',' ','j','u','s','t',' ','a','f','t','e','r',' ','t','a','r','g','e','t',' ','l','i','n','e','.','\n', ' ',' ','-','b',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','b','u','f','f','e','r','s','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','N','u','m','b','e','r',' ','o','f',' ','b','u','f','f','e','r','s','.','\n', ' ',' ','-','B',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','a','u','t','o','-','b','u','f','f','e','r','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','a','u','t','o','m','a','t','i','c','a','l','l','y',' ','a','l','l','o','c','a','t','e',' ','b','u','f','f','e','r','s',' ','f','o','r',' ','p','i','p','e','s','.','\n', ' ',' ','-','c',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','c','l','e','a','r','-','s','c','r','e','e','n','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','p','a','i','n','t',' ','b','y',' ','c','l','e','a','r','i','n','g',' ','r','a','t','h','e','r',' ','t','h','a','n',' ','s','c','r','o','l','l','i','n','g','.','\n', ' ',' ','-','d',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','d','u','m','b','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','u','m','b',' ','t','e','r','m','i','n','a','l','.','\n', ' ',' ','-','D',' ','x','\b','x','_','\b','c','_','\b','o','_','\b','l','_','\b','o','_','\b','r',' ',' ','.',' ',' ','-','-','c','o','l','o','r','=','x','\b','x','_','\b','c','_','\b','o','_','\b','l','_','\b','o','_','\b','r','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','s','c','r','e','e','n',' ','c','o','l','o','r','s','.','\n', ' ',' ','-','e',' ',' ','-','E',' ',' ','.','.','.','.',' ',' ','-','-','q','u','i','t','-','a','t','-','e','o','f',' ',' ','-','-','Q','U','I','T','-','A','T','-','E','O','F','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Q','u','i','t',' ','a','t',' ','e','n','d',' ','o','f',' ','f','i','l','e','.','\n', ' ',' ','-','f',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','f','o','r','c','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','o','r','c','e',' ','o','p','e','n',' ','n','o','n','-','r','e','g','u','l','a','r',' ','f','i','l','e','s','.','\n', ' ',' ','-','F',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','q','u','i','t','-','i','f','-','o','n','e','-','s','c','r','e','e','n','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Q','u','i','t',' ','i','f',' ','e','n','t','i','r','e',' ','f','i','l','e',' ','f','i','t','s',' ','o','n',' ','f','i','r','s','t',' ','s','c','r','e','e','n','.','\n', ' ',' ','-','g',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','i','l','i','t','e','-','s','e','a','r','c','h','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','o','n','l','y',' ','l','a','s','t',' ','m','a','t','c','h',' ','f','o','r',' ','s','e','a','r','c','h','e','s','.','\n', ' ',' ','-','G',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','H','I','L','I','T','E','-','S','E','A','R','C','H','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','h','i','g','h','l','i','g','h','t',' ','a','n','y',' ','m','a','t','c','h','e','s',' ','f','o','r',' ','s','e','a','r','c','h','e','s','.','\n', ' ',' ','-','h',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','m','a','x','-','b','a','c','k','-','s','c','r','o','l','l','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','B','a','c','k','w','a','r','d',' ','s','c','r','o','l','l',' ','l','i','m','i','t','.','\n', ' ',' ','-','i',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','i','g','n','o','r','e','-','c','a','s','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','I','g','n','o','r','e',' ','c','a','s','e',' ','i','n',' ','s','e','a','r','c','h','e','s',' ','t','h','a','t',' ','d','o',' ','n','o','t',' ','c','o','n','t','a','i','n',' ','u','p','p','e','r','c','a','s','e','.','\n', ' ',' ','-','I',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','I','G','N','O','R','E','-','C','A','S','E','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','I','g','n','o','r','e',' ','c','a','s','e',' ','i','n',' ','a','l','l',' ','s','e','a','r','c','h','e','s','.','\n', ' ',' ','-','j',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','j','u','m','p','-','t','a','r','g','e','t','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','c','r','e','e','n',' ','p','o','s','i','t','i','o','n',' ','o','f',' ','t','a','r','g','e','t',' ','l','i','n','e','s','.','\n', ' ',' ','-','J',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','s','t','a','t','u','s','-','c','o','l','u','m','n','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','a',' ','s','t','a','t','u','s',' ','c','o','l','u','m','n',' ','a','t',' ','l','e','f','t',' ','e','d','g','e',' ','o','f',' ','s','c','r','e','e','n','.','\n', ' ',' ','-','k',' ','_','\b','f','_','\b','i','_','\b','l','_','\b','e',' ',' ','.','.','.',' ',' ','-','-','l','e','s','s','k','e','y','-','f','i','l','e','=','_','\b','f','_','\b','i','_','\b','l','_','\b','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','a',' ','c','o','m','p','i','l','e','d',' ','l','e','s','s','k','e','y',' ','f','i','l','e','.','\n', ' ',' ','-','K',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','q','u','i','t','-','o','n','-','i','n','t','r','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','i','t',' ','l','e','s','s',' ','i','n',' ','r','e','s','p','o','n','s','e',' ','t','o',' ','c','t','r','l','-','C','.','\n', ' ',' ','-','L',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','n','o','-','l','e','s','s','o','p','e','n','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','I','g','n','o','r','e',' ','t','h','e',' ','L','E','S','S','O','P','E','N',' ','e','n','v','i','r','o','n','m','e','n','t',' ','v','a','r','i','a','b','l','e','.','\n', ' ',' ','-','m',' ',' ','-','M',' ',' ','.','.','.','.',' ',' ','-','-','l','o','n','g','-','p','r','o','m','p','t',' ',' ','-','-','L','O','N','G','-','P','R','O','M','P','T','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','p','r','o','m','p','t',' ','s','t','y','l','e','.','\n', ' ',' ','-','n',' ','.','.','.','.','.','.','.','.','.',' ',' ','-','-','l','i','n','e','-','n','u','m','b','e','r','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','u','p','p','r','e','s','s',' ','l','i','n','e',' ','n','u','m','b','e','r','s',' ','i','n',' ','p','r','o','m','p','t','s',' ','a','n','d',' ','m','e','s','s','a','g','e','s','.','\n', ' ',' ','-','N',' ','.','.','.','.','.','.','.','.','.',' ',' ','-','-','L','I','N','E','-','N','U','M','B','E','R','S','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','l','i','n','e',' ','n','u','m','b','e','r',' ','a','t',' ','s','t','a','r','t',' ','o','f',' ','e','a','c','h',' ','l','i','n','e','.','\n', ' ',' ','-','o',' ','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ','.','.',' ',' ','-','-','l','o','g','-','f','i','l','e','=','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','o','p','y',' ','t','o',' ','l','o','g',' ','f','i','l','e',' ','(','s','t','a','n','d','a','r','d',' ','i','n','p','u','t',' ','o','n','l','y',')','.','\n', ' ',' ','-','O',' ','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ','.','.',' ',' ','-','-','L','O','G','-','F','I','L','E','=','[','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','o','p','y',' ','t','o',' ','l','o','g',' ','f','i','l','e',' ','(','u','n','c','o','n','d','i','t','i','o','n','a','l','l','y',' ','o','v','e','r','w','r','i','t','e',')','.','\n', ' ',' ','-','p',' ','_','\b','p','_','\b','a','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','n',' ','.',' ',' ','-','-','p','a','t','t','e','r','n','=','[','_','\b','p','_','\b','a','_','\b','t','_','\b','t','_','\b','e','_','\b','r','_','\b','n',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','t','a','r','t',' ','a','t',' ','p','a','t','t','e','r','n',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n', ' ',' ','-','P',' ','[','_','\b','p','_','\b','r','_','\b','o','_','\b','m','_','\b','p','_','\b','t',']',' ',' ',' ','-','-','p','r','o','m','p','t','=','[','_','\b','p','_','\b','r','_','\b','o','_','\b','m','_','\b','p','_','\b','t',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','f','i','n','e',' ','n','e','w',' ','p','r','o','m','p','t','.','\n', ' ',' ','-','q',' ',' ','-','Q',' ',' ','.','.','.','.',' ',' ','-','-','q','u','i','e','t',' ',' ','-','-','Q','U','I','E','T',' ',' ','-','-','s','i','l','e','n','t',' ','-','-','S','I','L','E','N','T','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Q','u','i','e','t',' ','t','h','e',' ','t','e','r','m','i','n','a','l',' ','b','e','l','l','.','\n', ' ',' ','-','r',' ',' ','-','R',' ',' ','.','.','.','.',' ',' ','-','-','r','a','w','-','c','o','n','t','r','o','l','-','c','h','a','r','s',' ',' ','-','-','R','A','W','-','C','O','N','T','R','O','L','-','C','H','A','R','S','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','O','u','t','p','u','t',' ','"','r','a','w','"',' ','c','o','n','t','r','o','l',' ','c','h','a','r','a','c','t','e','r','s','.','\n', ' ',' ','-','s',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','s','q','u','e','e','z','e','-','b','l','a','n','k','-','l','i','n','e','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','q','u','e','e','z','e',' ','m','u','l','t','i','p','l','e',' ','b','l','a','n','k',' ','l','i','n','e','s','.','\n', ' ',' ','-','S',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','c','h','o','p','-','l','o','n','g','-','l','i','n','e','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','h','o','p',' ','(','t','r','u','n','c','a','t','e',')',' ','l','o','n','g',' ','l','i','n','e','s',' ','r','a','t','h','e','r',' ','t','h','a','n',' ','w','r','a','p','p','i','n','g','.','\n', ' ',' ','-','t',' ','_','\b','t','_','\b','a','_','\b','g',' ',' ','.','.','.','.',' ',' ','-','-','t','a','g','=','[','_','\b','t','_','\b','a','_','\b','g',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','i','n','d',' ','a',' ','t','a','g','.','\n', ' ',' ','-','T',' ','[','_','\b','t','_','\b','a','_','\b','g','_','\b','s','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']',' ','-','-','t','a','g','-','f','i','l','e','=','[','_','\b','t','_','\b','a','_','\b','g','_','\b','s','_','\b','f','_','\b','i','_','\b','l','_','\b','e',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','a','n',' ','a','l','t','e','r','n','a','t','e',' ','t','a','g','s',' ','f','i','l','e','.','\n', ' ',' ','-','u',' ',' ','-','U',' ',' ','.','.','.','.',' ',' ','-','-','u','n','d','e','r','l','i','n','e','-','s','p','e','c','i','a','l',' ',' ','-','-','U','N','D','E','R','L','I','N','E','-','S','P','E','C','I','A','L','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','C','h','a','n','g','e',' ','h','a','n','d','l','i','n','g',' ','o','f',' ','b','a','c','k','s','p','a','c','e','s',',',' ','t','a','b','s',' ','a','n','d',' ','c','a','r','r','i','a','g','e',' ','r','e','t','u','r','n','s','.','\n', ' ',' ','-','V',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','v','e','r','s','i','o','n','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','t','h','e',' ','v','e','r','s','i','o','n',' ','n','u','m','b','e','r',' ','o','f',' ','"','l','e','s','s','"','.','\n', ' ',' ','-','w',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','i','l','i','t','e','-','u','n','r','e','a','d','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','f','i','r','s','t',' ','n','e','w',' ','l','i','n','e',' ','a','f','t','e','r',' ','f','o','r','w','a','r','d','-','s','c','r','e','e','n','.','\n', ' ',' ','-','W',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','H','I','L','I','T','E','-','U','N','R','E','A','D','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','f','i','r','s','t',' ','n','e','w',' ','l','i','n','e',' ','a','f','t','e','r',' ','a','n','y',' ','f','o','r','w','a','r','d',' ','m','o','v','e','m','e','n','t','.','\n', ' ',' ','-','x',' ','[','_','\b','N','[',',','.','.','.',']',']',' ',' ','-','-','t','a','b','s','=','[','_','\b','N','[',',','.','.','.',']',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','t','a','b',' ','s','t','o','p','s','.','\n', ' ',' ','-','X',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','n','o','-','i','n','i','t','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','u','s','e',' ','t','e','r','m','c','a','p',' ','i','n','i','t','/','d','e','i','n','i','t',' ','s','t','r','i','n','g','s','.','\n', ' ',' ','-','y',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','m','a','x','-','f','o','r','w','-','s','c','r','o','l','l','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','F','o','r','w','a','r','d',' ','s','c','r','o','l','l',' ','l','i','m','i','t','.','\n', ' ',' ','-','z',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','w','i','n','d','o','w','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','s','i','z','e',' ','o','f',' ','w','i','n','d','o','w','.','\n', ' ',' ','-','"',' ','[','_','\b','c','[','_','\b','c',']',']',' ',' ','.',' ',' ','-','-','q','u','o','t','e','s','=','[','_','\b','c','[','_','\b','c',']',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','s','h','e','l','l',' ','q','u','o','t','e',' ','c','h','a','r','a','c','t','e','r','s','.','\n', ' ',' ','-','~',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','t','i','l','d','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','d','i','s','p','l','a','y',' ','t','i','l','d','e','s',' ','a','f','t','e','r',' ','e','n','d',' ','o','f',' ','f','i','l','e','.','\n', ' ',' ','-','#',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','s','h','i','f','t','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','h','o','r','i','z','o','n','t','a','l',' ','s','c','r','o','l','l',' ','a','m','o','u','n','t',' ','(','0',' ','=',' ','o','n','e',' ','h','a','l','f',' ','s','c','r','e','e','n',' ','w','i','d','t','h',')','.','\n', '\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','e','x','i','t','-','f','o','l','l','o','w','-','o','n','-','c','l','o','s','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','i','t',' ','F',' ','c','o','m','m','a','n','d',' ','o','n',' ','a',' ','p','i','p','e',' ','w','h','e','n',' ','w','r','i','t','e','r',' ','c','l','o','s','e','s',' ','p','i','p','e','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','f','i','l','e','-','s','i','z','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','A','u','t','o','m','a','t','i','c','a','l','l','y',' ','d','e','t','e','r','m','i','n','e',' ','t','h','e',' ','s','i','z','e',' ','o','f',' ','t','h','e',' ','i','n','p','u','t',' ','f','i','l','e','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','f','o','l','l','o','w','-','n','a','m','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','T','h','e',' ','F',' ','c','o','m','m','a','n','d',' ','c','h','a','n','g','e','s',' ','f','i','l','e','s',' ','i','f',' ','t','h','e',' ','i','n','p','u','t',' ','f','i','l','e',' ','i','s',' ','r','e','n','a','m','e','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','f','o','r','m','-','f','e','e','d','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','t','o','p',' ','s','c','r','o','l','l','i','n','g',' ','w','h','e','n',' ','a',' ','f','o','r','m',' ','f','e','e','d',' ','c','h','a','r','a','c','t','e','r',' ','i','s',' ','r','e','a','c','h','e','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','h','e','a','d','e','r','=','[','_','\b','L','[',',','_','\b','C','[',',','_','\b','N',']',']',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','_','\b','L',' ','l','i','n','e','s',' ','(','s','t','a','r','t','i','n','g',' ','a','t',' ','l','i','n','e',' ','_','\b','N',')',' ','a','n','d',' ','_','\b','C',' ','c','o','l','u','m','n','s',' ','a','s',' ','h','e','a','d','e','r','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','i','n','c','s','e','a','r','c','h','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','a','r','c','h',' ','f','i','l','e',' ','a','s',' ','e','a','c','h',' ','p','a','t','t','e','r','n',' ','c','h','a','r','a','c','t','e','r',' ','i','s',' ','t','y','p','e','d',' ','i','n','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','i','n','t','r','=','[','_','\b','C',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','_','\b','C',' ','i','n','s','t','e','a','d',' ','o','f',' ','^','X',' ','t','o',' ','i','n','t','e','r','r','u','p','t',' ','a',' ','r','e','a','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','l','e','s','s','k','e','y','-','c','o','n','t','e','x','t','=','_','\b','t','_','\b','e','_','\b','x','_','\b','t','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','l','e','s','s','k','e','y',' ','s','o','u','r','c','e',' ','f','i','l','e',' ','c','o','n','t','e','n','t','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','l','e','s','s','k','e','y','-','s','r','c','=','_','\b','f','_','\b','i','_','\b','l','_','\b','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','U','s','e',' ','a',' ','l','e','s','s','k','e','y',' ','s','o','u','r','c','e',' ','f','i','l','e','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','l','i','n','e','-','n','u','m','-','w','i','d','t','h','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','t','h','e',' ','w','i','d','t','h',' ','o','f',' ','t','h','e',' ','-','N',' ','l','i','n','e',' ','n','u','m','b','e','r',' ','f','i','e','l','d',' ','t','o',' ','_','\b','N',' ','c','h','a','r','a','c','t','e','r','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','m','a','t','c','h','-','s','h','i','f','t','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','h','o','w',' ','a','t',' ','l','e','a','s','t',' ','_','\b','N',' ','c','h','a','r','a','c','t','e','r','s',' ','t','o',' ','t','h','e',' ','l','e','f','t',' ','o','f',' ','a',' ','s','e','a','r','c','h',' ','m','a','t','c','h','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','m','o','d','e','l','i','n','e','s','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','a','d',' ','_','\b','N',' ','l','i','n','e','s',' ','f','r','o','m',' ','t','h','e',' ','i','n','p','u','t',' ','f','i','l','e',' ','a','n','d',' ','l','o','o','k',' ','f','o','r',' ','v','i','m',' ','m','o','d','e','l','i','n','e','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','m','o','u','s','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','n','a','b','l','e',' ','m','o','u','s','e',' ','i','n','p','u','t','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','e','d','i','t','-','w','a','r','n','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','w','a','r','n',' ','w','h','e','n',' ','u','s','i','n','g',' ','v',' ','c','o','m','m','a','n','d',' ','o','n',' ','a',' ','f','i','l','e',' ','o','p','e','n','e','d',' ','v','i','a',' ','L','E','S','S','O','P','E','N','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','k','e','y','p','a','d','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','s','e','n','d',' ','t','e','r','m','c','a','p',' ','k','e','y','p','a','d',' ','i','n','i','t','/','d','e','i','n','i','t',' ','s','t','r','i','n','g','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','h','i','s','t','d','u','p','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','m','o','v','e',' ','d','u','p','l','i','c','a','t','e','s',' ','f','r','o','m',' ','c','o','m','m','a','n','d',' ','h','i','s','t','o','r','y','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','n','u','m','b','e','r','-','h','e','a','d','e','r','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','g','i','v','e',' ','l','i','n','e',' ','n','u','m','b','e','r','s',' ','t','o',' ','h','e','a','d','e','r',' ','l','i','n','e','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','p','a','s','t','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','I','g','n','o','r','e',' ','p','a','s','t','e','d',' ','i','n','p','u','t','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','s','e','a','r','c','h','-','h','e','a','d','e','r','-','l','i','n','e','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','a','r','c','h','e','s',' ','d','o',' ','n','o','t',' ','i','n','c','l','u','d','e',' ','h','e','a','d','e','r',' ','l','i','n','e','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','s','e','a','r','c','h','-','h','e','a','d','e','r','-','c','o','l','u','m','n','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','a','r','c','h','e','s',' ','d','o',' ','n','o','t',' ','i','n','c','l','u','d','e',' ','h','e','a','d','e','r',' ','c','o','l','u','m','n','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','s','e','a','r','c','h','-','h','e','a','d','e','r','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','a','r','c','h','e','s',' ','d','o',' ','n','o','t',' ','i','n','c','l','u','d','e',' ','h','e','a','d','e','r',' ','l','i','n','e','s',' ','o','r',' ','c','o','l','u','m','n','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','n','o','-','v','b','e','l','l','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','a','b','l','e',' ','t','h','e',' ','t','e','r','m','i','n','a','l','\'','s',' ','v','i','s','u','a','l',' ','b','e','l','l','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','r','e','d','r','a','w','-','o','n','-','q','u','i','t','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','d','r','a','w',' ','f','i','n','a','l',' ','s','c','r','e','e','n',' ','w','h','e','n',' ','q','u','i','t','t','i','n','g','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','r','s','c','r','o','l','l','=','[','_','\b','C',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','t','h','e',' ','c','h','a','r','a','c','t','e','r',' ','u','s','e','d',' ','t','o',' ','m','a','r','k',' ','t','r','u','n','c','a','t','e','d',' ','l','i','n','e','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','s','a','v','e','-','m','a','r','k','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','t','a','i','n',' ','m','a','r','k','s',' ','a','c','r','o','s','s',' ','i','n','v','o','c','a','t','i','o','n','s',' ','o','f',' ','l','e','s','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','s','e','a','r','c','h','-','o','p','t','i','o','n','s','=','[','E','F','K','N','R','W','-',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','d','e','f','a','u','l','t',' ','o','p','t','i','o','n','s',' ','f','o','r',' ','e','v','e','r','y',' ','s','e','a','r','c','h','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','s','h','o','w','-','p','r','e','p','r','o','c','-','e','r','r','o','r','s','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','a',' ','m','e','s','s','a','g','e',' ','i','f',' ','p','r','e','p','r','o','c','e','s','s','o','r',' ','e','x','i','t','s',' ','w','i','t','h',' ','a','n',' ','e','r','r','o','r',' ','s','t','a','t','u','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','p','r','o','c','-','b','a','c','k','s','p','a','c','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','P','r','o','c','e','s','s',' ','b','a','c','k','s','p','a','c','e','s',' ','f','o','r',' ','b','o','l','d','/','u','n','d','e','r','l','i','n','e','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','P','R','O','C','-','B','A','C','K','S','P','A','C','E','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','T','r','e','a','t',' ','b','a','c','k','s','p','a','c','e','s',' ','a','s',' ','c','o','n','t','r','o','l',' ','c','h','a','r','a','c','t','e','r','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','p','r','o','c','-','r','e','t','u','r','n','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','e','l','e','t','e',' ','c','a','r','r','i','a','g','e',' ','r','e','t','u','r','n','s',' ','b','e','f','o','r','e',' ','n','e','w','l','i','n','e','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','P','R','O','C','-','R','E','T','U','R','N','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','T','r','e','a','t',' ','c','a','r','r','i','a','g','e',' ','r','e','t','u','r','n','s',' ','a','s',' ','c','o','n','t','r','o','l',' ','c','h','a','r','a','c','t','e','r','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','p','r','o','c','-','t','a','b','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','x','p','a','n','d',' ','t','a','b','s',' ','t','o',' ','s','p','a','c','e','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','P','R','O','C','-','T','A','B','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','T','r','e','a','t',' ','t','a','b','s',' ','a','s',' ','c','o','n','t','r','o','l',' ','c','h','a','r','a','c','t','e','r','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','s','t','a','t','u','s','-','c','o','l','-','w','i','d','t','h','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','e','t',' ','t','h','e',' ','w','i','d','t','h',' ','o','f',' ','t','h','e',' ','-','J',' ','s','t','a','t','u','s',' ','c','o','l','u','m','n',' ','t','o',' ','_','\b','N',' ','c','h','a','r','a','c','t','e','r','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','s','t','a','t','u','s','-','l','i','n','e','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','o','r',' ','c','o','l','o','r',' ','t','h','e',' ','e','n','t','i','r','e',' ','l','i','n','e',' ','c','o','n','t','a','i','n','i','n','g',' ','a',' ','m','a','r','k','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','u','s','e','-','b','a','c','k','s','l','a','s','h','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','S','u','b','s','e','q','u','e','n','t',' ','o','p','t','i','o','n','s',' ','u','s','e',' ','b','a','c','k','s','l','a','s','h',' ','a','s',' ','e','s','c','a','p','e',' ','c','h','a','r','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','u','s','e','-','c','o','l','o','r','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','n','a','b','l','e','s',' ','c','o','l','o','r','e','d',' ','t','e','x','t','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','w','h','e','e','l','-','l','i','n','e','s','=','[','_','\b','N',']','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','E','a','c','h',' ','c','l','i','c','k',' ','o','f',' ','t','h','e',' ','m','o','u','s','e',' ','w','h','e','e','l',' ','m','o','v','e','s',' ','_','\b','N',' ','l','i','n','e','s','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','-','-','w','o','r','d','w','r','a','p','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','W','r','a','p',' ','l','i','n','e','s',' ','a','t',' ','s','p','a','c','e','s','.','\n', '\n', '\n', ' ','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','\n', '\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','L','\b','L','I','\b','I','N','\b','N','E','\b','E',' ','E','\b','E','D','\b','D','I','\b','I','T','\b','T','I','\b','I','N','\b','N','G','\b','G','\n', '\n', ' ',' ',' ',' ',' ',' ',' ',' ','T','h','e','s','e',' ','k','e','y','s',' ','c','a','n',' ','b','e',' ','u','s','e','d',' ','t','o',' ','e','d','i','t',' ','t','e','x','t',' ','b','e','i','n','g',' ','e','n','t','e','r','e','d',' ','\n', ' ',' ',' ',' ',' ',' ',' ',' ','o','n',' ','t','h','e',' ','"','c','o','m','m','a','n','d',' ','l','i','n','e','"',' ','a','t',' ','t','h','e',' ','b','o','t','t','o','m',' ','o','f',' ','t','h','e',' ','s','c','r','e','e','n','.','\n', '\n', ' ','R','i','g','h','t','A','r','r','o','w',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','l',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','r','i','g','h','t',' ','o','n','e',' ','c','h','a','r','a','c','t','e','r','.','\n', ' ','L','e','f','t','A','r','r','o','w',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','h',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','l','e','f','t',' ','o','n','e',' ','c','h','a','r','a','c','t','e','r','.','\n', ' ','c','t','r','l','-','R','i','g','h','t','A','r','r','o','w',' ',' ','E','S','C','-','R','i','g','h','t','A','r','r','o','w',' ',' ','E','S','C','-','w',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','r','i','g','h','t',' ','o','n','e',' ','w','o','r','d','.','\n', ' ','c','t','r','l','-','L','e','f','t','A','r','r','o','w',' ',' ',' ','E','S','C','-','L','e','f','t','A','r','r','o','w',' ',' ',' ','E','S','C','-','b',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','l','e','f','t',' ','o','n','e',' ','w','o','r','d','.','\n', ' ','H','O','M','E',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','0',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','t','o',' ','s','t','a','r','t',' ','o','f',' ','l','i','n','e','.','\n', ' ','E','N','D',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','$',' ','.','.','.',' ','M','o','v','e',' ','c','u','r','s','o','r',' ','t','o',' ','e','n','d',' ','o','f',' ','l','i','n','e','.','\n', ' ','B','A','C','K','S','P','A','C','E',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','D','e','l','e','t','e',' ','c','h','a','r',' ','t','o',' ','l','e','f','t',' ','o','f',' ','c','u','r','s','o','r','.','\n', ' ','D','E','L','E','T','E',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','x',' ','.','.','.',' ','D','e','l','e','t','e',' ','c','h','a','r',' ','u','n','d','e','r',' ','c','u','r','s','o','r','.','\n', ' ','c','t','r','l','-','B','A','C','K','S','P','A','C','E',' ',' ',' ','E','S','C','-','B','A','C','K','S','P','A','C','E',' ','.','.','.','.','.','.','.','.','.','.','.',' ','D','e','l','e','t','e',' ','w','o','r','d',' ','t','o',' ','l','e','f','t',' ','o','f',' ','c','u','r','s','o','r','.','\n', ' ','c','t','r','l','-','D','E','L','E','T','E',' ','.','.','.','.',' ','E','S','C','-','D','E','L','E','T','E',' ','.','.','.','.',' ','E','S','C','-','X',' ','.','.','.',' ','D','e','l','e','t','e',' ','w','o','r','d',' ','u','n','d','e','r',' ','c','u','r','s','o','r','.','\n', ' ','c','t','r','l','-','U',' ','.','.','.','.','.','.','.','.','.',' ','E','S','C',' ','(','M','S','-','D','O','S',' ','o','n','l','y',')',' ','.','.','.','.','.','.','.',' ','D','e','l','e','t','e',' ','e','n','t','i','r','e',' ','l','i','n','e','.','\n', ' ','U','p','A','r','r','o','w',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','k',' ','.','.','.',' ','R','e','t','r','i','e','v','e',' ','p','r','e','v','i','o','u','s',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', ' ','D','o','w','n','A','r','r','o','w',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','j',' ','.','.','.',' ','R','e','t','r','i','e','v','e',' ','n','e','x','t',' ','c','o','m','m','a','n','d',' ','l','i','n','e','.','\n', ' ','T','A','B',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',' ','&',' ','c','y','c','l','e','.','\n', ' ','S','H','I','F','T','-','T','A','B',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','E','S','C','-','T','A','B',' ',' ',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',' ','&',' ','r','e','v','e','r','s','e',' ','c','y','c','l','e','.','\n', ' ','c','t','r','l','-','L',' ','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',' ','C','o','m','p','l','e','t','e',' ','f','i','l','e','n','a','m','e',',',' ','l','i','s','t',' ','a','l','l','.','\n', 0 }; constant int size_helpdata = sizeof(helpdata) - 1; diff --git a/contrib/less/less.h b/contrib/less/less.h index 94a3e2235906..7b2d2c25bfc6 100644 --- a/contrib/less/less.h +++ b/contrib/less/less.h @@ -1,673 +1,674 @@ /* * Copyright (C) 1984-2025 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. */ /* * Standard include file for "less". */ /* * Defines for MSDOS_COMPILER. */ #define MSOFTC 1 /* Microsoft C */ #define BORLANDC 2 /* Borland C */ #define WIN32C 3 /* Windows (Borland C or Microsoft C) */ #define DJGPPC 4 /* DJGPP C */ /* * Include the file of compile-time options. * The <> make cc search for it in -I., not srcdir. */ #include #ifdef _SEQUENT_ /* * Kludge for Sequent Dynix systems that have sigsetmask, but * it's not compatible with the way less calls it. * {{ Do other systems need this? }} */ #undef HAVE_SIGSETMASK #endif /* Library function declarations */ #if HAVE_SYS_TYPES_H #include #endif #if HAVE_STDIO_H #include #endif #if HAVE_FCNTL_H #include #endif #if HAVE_UNISTD_H #include #endif #if HAVE_CTYPE_H #include #endif #if HAVE_WCTYPE_H #include #endif #if HAVE_LIMITS_H #include #endif #if HAVE_STDINT_H #include #endif #if HAVE_STDLIB_H #include #endif #if HAVE_STRING_H #include #endif #if HAVE_STDCKDINT_H #include #else /* * These substitutes for C23 stdckdint macros do not set *R on overflow, * and they assume A and B are nonnegative. That is good enough for us. */ #define ckd_add(r, a, b) help_ckd_add(r, (uintmax)(a), (uintmax)(b), sizeof *(r), signed_expr(*(r))) #define ckd_mul(r, a, b) help_ckd_mul(r, (uintmax)(a), (uintmax)(b), sizeof *(r), signed_expr(*(r))) /* True if the integer expression E, after promotion, is signed. */ #define signed_expr(e) ((TRUE ? 0 : e) - 1 < 0) #endif #define muldiv(val,num,den) umuldiv((uintmax)(val), (uintmax)(num), (uintmax)(den)) #include "lang.h" #if defined UINTMAX_MAX typedef uintmax_t uintmax; #elif defined ULLONG_MAX typedef unsigned long long uintmax; #else typedef unsigned long uintmax; #endif /* OS-specific includes */ #ifdef _OSK #include #include #endif #ifdef __TANDEM #include #endif #if MSDOS_COMPILER==WIN32C || OS2 #include #endif #if MSDOS_COMPILER==DJGPPC #include #include #include #include #endif #if !HAVE_STDLIB_H char *getenv(); off_t lseek(); void *calloc(); void free(); #endif /* * Simple lowercase test which can be used during option processing * (before options are parsed which might tell us what charset to use). */ #define ASCII_IS_UPPER(c) ((c) >= 'A' && (c) <= 'Z') #define ASCII_IS_LOWER(c) ((c) >= 'a' && (c) <= 'z') #define ASCII_TO_UPPER(c) ((c) - 'a' + 'A') #define ASCII_TO_LOWER(c) ((c) - 'A' + 'a') #undef IS_UPPER #undef IS_LOWER #undef TO_UPPER #undef TO_LOWER #undef IS_SPACE #undef IS_DIGIT #if HAVE_WCTYPE #define IS_UPPER(c) iswupper((wint_t) (c)) #define IS_LOWER(c) iswlower((wint_t) (c)) #define TO_UPPER(c) towupper((wint_t) (c)) #define TO_LOWER(c) towlower((wint_t) (c)) #else #if HAVE_UPPER_LOWER #define IS_UPPER(c) (is_ascii_char(c) && isupper((unsigned char) (c))) #define IS_LOWER(c) (is_ascii_char(c) && islower((unsigned char) (c))) #define TO_UPPER(c) (is_ascii_char(c) ? toupper((unsigned char) (c)) : (c)) #define TO_LOWER(c) (is_ascii_char(c) ? tolower((unsigned char) (c)) : (c)) #else #define IS_UPPER(c) (is_ascii_char(c) && ASCII_IS_UPPER(c)) #define IS_LOWER(c) (is_ascii_char(c) && ASCII_IS_LOWER(c)) #define TO_UPPER(c) (is_ascii_char(c) ? ASCII_TO_UPPER(c) : (c)) #define TO_LOWER(c) (is_ascii_char(c) ? ASCII_TO_LOWER(c) : (c)) #endif #endif #ifdef isspace #define IS_SPACE(c) isspace((unsigned char)(c)) #else #define IS_SPACE(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\r' || (c) == '\f') #endif #ifdef isdigit #define IS_DIGIT(c) isdigit((unsigned char)(c)) #else #define IS_DIGIT(c) ((c) >= '0' && (c) <= '9') #endif #define IS_CSI_START(c) (control_char(c) && (((LWCHAR)(c)) == ESC || (((LWCHAR)(c)) == CSI))) #define OPT_OFF 0 #define OPT_ON 1 #define OPT_ONPLUS 2 #if !HAVE_MEMCPY #ifndef memcpy #define memcpy(to,from,len) bcopy((from),(to),(len)) #endif #endif #if HAVE_SNPRINTF #define SNPRINTF1(str, size, fmt, v1) snprintf((str), (size), (fmt), (v1)) #define SNPRINTF2(str, size, fmt, v1, v2) snprintf((str), (size), (fmt), (v1), (v2)) #define SNPRINTF3(str, size, fmt, v1, v2, v3) snprintf((str), (size), (fmt), (v1), (v2), (v3)) #define SNPRINTF4(str, size, fmt, v1, v2, v3, v4) snprintf((str), (size), (fmt), (v1), (v2), (v3), (v4)) #else /* Use unsafe sprintf if we don't have snprintf. */ #define SNPRINTF1(str, size, fmt, v1) sprintf((str), (fmt), (v1)) #define SNPRINTF2(str, size, fmt, v1, v2) sprintf((str), (fmt), (v1), (v2)) #define SNPRINTF3(str, size, fmt, v1, v2, v3) sprintf((str), (fmt), (v1), (v2), (v3)) #define SNPRINTF4(str, size, fmt, v1, v2, v3, v4) sprintf((str), (fmt), (v1), (v2), (v3), (v4)) #endif #define BAD_LSEEK ((off_t)-1) #ifndef SEEK_SET #define SEEK_SET 0 #endif #ifndef SEEK_END #define SEEK_END 2 #endif #ifndef CHAR_BIT #define CHAR_BIT 8 #endif /* * Upper bound on the string length of an integer converted to string. * 302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit; * add 1 for integer division truncation; add 1 more for a minus sign. */ #define INT_STRLEN_BOUND(t) ((sizeof(t) * CHAR_BIT - 1) * 302 / 1000 + 1 + 1) /* * Special types and constants. */ typedef unsigned long LWCHAR; #if defined(MINGW) || (defined(_MSC_VER) && _MSC_VER >= 1500) typedef long long less_off_t; /* __int64 */ typedef struct _stat64 less_stat_t; #define less_fstat _fstat64 #define less_stat _stat64 #define less_lseek _lseeki64 #else typedef off_t less_off_t; typedef struct stat less_stat_t; #define less_fstat fstat #define less_stat stat #define less_lseek lseek #endif typedef less_off_t POSITION; typedef off_t LINENUM; #define MIN_LINENUM_WIDTH 7 /* Default min printing width of a line number */ #define MAX_LINENUM_WIDTH 16 /* Max width of a line number */ #define MAX_STATUSCOL_WIDTH 4 /* Max width of the status column */ #define MAX_UTF_CHAR_LEN 6 /* Max bytes in one UTF-8 char */ #define MAX_PRCHAR_LEN 31 /* Max chars in prchar() result */ #define NULL_POSITION ((POSITION)(-1)) /* * Flags for open() */ #if MSDOS_COMPILER || OS2 #define OPEN_READ (O_RDONLY|O_BINARY) #else #ifdef _OSK #define OPEN_READ (S_IREAD) #else #ifdef O_RDONLY #define OPEN_READ (O_RDONLY) #else #define OPEN_READ (0) #endif #endif #endif #if defined(O_WRONLY) && defined(O_APPEND) #define OPEN_APPEND (O_APPEND|O_WRONLY) #else #ifdef _OSK #define OPEN_APPEND (S_IWRITE) #else #define OPEN_APPEND (1) #endif #endif /* * Flags for creat() */ #if MSDOS_COMPILER #define CREAT_RW (S_IREAD|S_IWRITE) #else #define CREAT_RW 0644 #endif /* * Set a file descriptor to binary mode. */ #if MSDOS_COMPILER==MSOFTC #define SET_BINARY(f) _setmode(f, _O_BINARY); #else #if MSDOS_COMPILER || OS2 #define SET_BINARY(f) setmode(f, O_BINARY) #else #define SET_BINARY(f) #endif #endif #define SPACES_IN_FILENAMES 1 /* * An IFILE represents an input file. */ #define IFILE void* #define NULL_IFILE ((IFILE)NULL) /* * The structure used to represent a "screen position". * This consists of a file position, and a screen line number. * The meaning is that the line starting at the given file * position is displayed on the ln-th line of the screen. * (Screen lines before ln are empty.) */ struct scrpos { POSITION pos; int ln; }; typedef union parg { constant char *p_string; int p_int; LINENUM p_linenum; char p_char; } PARG; #define NULL_PARG ((PARG *)NULL) struct textlist { char *string; char *endstring; }; struct wchar_range { LWCHAR first, last; }; struct wchar_range_table { struct wchar_range *table; unsigned int count; }; #if HAVE_POLL typedef short POLL_EVENTS; #endif #define EOI (-1) #define READ_ERR (-1) #define READ_INTR (-2) #define READ_AGAIN (-3) /* * A fraction is represented by a long n; the fraction is n/NUM_FRAC_DENOM. * To avoid overflow problems, 0 <= n < NUM_FRAC_DENUM <= LONG_MAX/100. */ #define NUM_FRAC_DENOM 1000000 #define NUM_LOG_FRAC_DENOM 6 /* * Max expected reasonable duration of a paste. * Increasing this value avoids accidentally reenabling unwanted paste input * in the middle of a very long paste but risks apparently frozen UI if the * end bracket is missing. */ #define MAX_PASTE_IGNORE_SEC 5 /* How quiet should we be? */ #define NOT_QUIET 0 /* Ring bell at eof and for errors */ #define LITTLE_QUIET 1 /* Ring bell only for errors */ #define VERY_QUIET 2 /* Never ring bell */ /* How should we prompt? */ #define PR_SHORT 0 /* Prompt with colon */ #define PR_MEDIUM 1 /* Prompt with message */ #define PR_LONG 2 /* Prompt with longer message */ /* How should we handle backspaces? */ #define BS_SPECIAL 0 /* Do special things for underlining and bold */ #define BS_NORMAL 1 /* \b treated as normal char; actually output */ #define BS_CONTROL 2 /* \b treated as control char; prints as ^H */ /* How should we search? */ #define SRCH_FORW (1 << 0) /* Search forward from current position */ #define SRCH_BACK (1 << 1) /* Search backward from current position */ #define SRCH_NO_MOVE (1 << 2) /* Highlight, but don't move */ #define SRCH_INCR (1 << 3) /* Incremental search */ #define SRCH_FIND_ALL (1 << 4) /* Find and highlight all matches */ #define SRCH_NO_MATCH (1 << 8) /* Search for non-matching lines */ #define SRCH_PAST_EOF (1 << 9) /* Search past end-of-file, into next file */ #define SRCH_FIRST_FILE (1 << 10) /* Search starting at the first file */ #define SRCH_NO_REGEX (1 << 12) /* Don't use regular expressions */ #define SRCH_FILTER (1 << 13) /* Search is for '&' (filter) command */ #define SRCH_AFTER_TARGET (1 << 14) /* Start search after the target line */ #define SRCH_WRAP (1 << 15) /* Wrap-around search (continue at BOF/EOF) */ #if OSC8_LINK #define SRCH_OSC8 (1 << 16) /* */ #endif #define SRCH_SUBSEARCH(i) (1 << (17+(i))) /* Search for subpattern */ /* {{ Depends on NUM_SEARCH_COLORS==5 }} */ #define SRCH_SUBSEARCH_ALL (SRCH_SUBSEARCH(1)|SRCH_SUBSEARCH(2)|SRCH_SUBSEARCH(3)|SRCH_SUBSEARCH(4)|SRCH_SUBSEARCH(5)) #define SRCH_REVERSE(t) (((t) & SRCH_FORW) ? \ (((t) & ~SRCH_FORW) | SRCH_BACK) : \ (((t) & ~SRCH_BACK) | SRCH_FORW)) /* Parsing position in an OSC8 link: "\e]8;PARAMS;URI\e\\" (final "\e\\" may be "\7") */ typedef enum osc8_state { OSC_START, /* Waiting for initial \e */ OSC_INTRO, /* Waiting for intro char, usually ']' */ OSC_TYPENUM, /* Reading OS command type */ OSC_STRING, /* Reading OS command string */ OSC_END_CSI, /* Waiting for backslash after the final ESC. */ OSC_END, /* At end */ OSC8_PARAMS, /* In the OSC8 parameters */ OSC8_URI, /* In the OSC8 URI */ OSC8_NOT, /* This is not an OSC8 link */ } osc8_state; /* */ #define NO_MCA 0 #define MCA_DONE 1 #define MCA_MORE 2 #define CC_OK 0 /* Char was accepted & processed */ #define CC_QUIT 1 /* Char was a request to abort current cmd */ #define CC_ERROR 2 /* Char could not be accepted due to error */ #define CC_PASS 3 /* Char was rejected (internal) */ #define CF_QUIT_ON_ERASE (1<<0) /* Abort cmd if its entirely erased */ #define CF_OPTION (1<<1) /* A_OPT_TOGGLE */ /* Special char bit-flags used to tell put_line() to do something special */ #define AT_NORMAL (0) #define AT_UNDERLINE (1 << 0) #define AT_BOLD (1 << 1) #define AT_BLINK (1 << 2) #define AT_STANDOUT (1 << 3) #define AT_ANSI (1 << 4) /* Content-supplied "ANSI" escape sequence */ #define AT_BINARY (1 << 5) /* LESS*BINFMT representation */ #define AT_HILITE (1 << 6) /* Internal highlights (e.g., for search) */ #define AT_COLOR_SHIFT 8 #define AT_NUM_COLORS 16 #define AT_COLOR ((AT_NUM_COLORS-1) << AT_COLOR_SHIFT) #define AT_COLOR_ATTN (1 << AT_COLOR_SHIFT) #define AT_COLOR_BIN (2 << AT_COLOR_SHIFT) #define AT_COLOR_CTRL (3 << AT_COLOR_SHIFT) #define AT_COLOR_ERROR (4 << AT_COLOR_SHIFT) #define AT_COLOR_LINENUM (5 << AT_COLOR_SHIFT) #define AT_COLOR_MARK (6 << AT_COLOR_SHIFT) #define AT_COLOR_PROMPT (7 << AT_COLOR_SHIFT) #define AT_COLOR_RSCROLL (8 << AT_COLOR_SHIFT) #define AT_COLOR_HEADER (9 << AT_COLOR_SHIFT) #define AT_COLOR_SEARCH (10 << AT_COLOR_SHIFT) #define AT_COLOR_SUBSEARCH(i) ((10+(i)) << AT_COLOR_SHIFT) #define NUM_SEARCH_COLORS (AT_NUM_COLORS-10-1) typedef enum { CT_NULL, CT_4BIT, CT_6BIT } COLOR_TYPE; typedef enum { CV_BLUE = 1, CV_GREEN = 2, CV_RED = 4, CV_BRIGHT = 8, CV_NOCHANGE = -2, CV_ERROR = -1 } COLOR_VALUE; typedef enum { CATTR_NULL = 0, CATTR_STANDOUT = (1 << 0), CATTR_BOLD = (1 << 1), CATTR_UNDERLINE = (1 << 2), CATTR_BLINK = (1 << 3), } CHAR_ATTR; /* ANSI states */ typedef enum { ANSI_NULL, ANSI_MID, ANSI_ERR, ANSI_END, } ansi_state; #if '0' == 240 #define IS_EBCDIC_HOST 1 #endif #if IS_EBCDIC_HOST /* * Long definition for EBCDIC. * Since the argument is usually a constant, this macro normally compiles * into a constant. */ #define CONTROL(c) ( \ (c)=='[' ? '\047' : \ (c)=='a' ? '\001' : \ (c)=='b' ? '\002' : \ (c)=='c' ? '\003' : \ (c)=='d' ? '\067' : \ (c)=='e' ? '\055' : \ (c)=='f' ? '\056' : \ (c)=='g' ? '\057' : \ (c)=='h' ? '\026' : \ (c)=='i' ? '\005' : \ (c)=='j' ? '\025' : \ (c)=='k' ? '\013' : \ (c)=='l' ? '\014' : \ (c)=='m' ? '\015' : \ (c)=='n' ? '\016' : \ (c)=='o' ? '\017' : \ (c)=='p' ? '\020' : \ (c)=='q' ? '\021' : \ (c)=='r' ? '\022' : \ (c)=='s' ? '\023' : \ (c)=='t' ? '\074' : \ (c)=='u' ? '\075' : \ (c)=='v' ? '\062' : \ (c)=='w' ? '\046' : \ (c)=='x' ? '\030' : \ (c)=='y' ? '\031' : \ (c)=='z' ? '\077' : \ (c)=='A' ? '\001' : \ (c)=='B' ? '\002' : \ (c)=='C' ? '\003' : \ (c)=='D' ? '\067' : \ (c)=='E' ? '\055' : \ (c)=='F' ? '\056' : \ (c)=='G' ? '\057' : \ (c)=='H' ? '\026' : \ (c)=='I' ? '\005' : \ (c)=='J' ? '\025' : \ (c)=='K' ? '\013' : \ (c)=='L' ? '\014' : \ (c)=='M' ? '\015' : \ (c)=='N' ? '\016' : \ (c)=='O' ? '\017' : \ (c)=='P' ? '\020' : \ (c)=='Q' ? '\021' : \ (c)=='R' ? '\022' : \ (c)=='S' ? '\023' : \ (c)=='T' ? '\074' : \ (c)=='U' ? '\075' : \ (c)=='V' ? '\062' : \ (c)=='W' ? '\046' : \ (c)=='X' ? '\030' : \ (c)=='Y' ? '\031' : \ (c)=='Z' ? '\077' : \ (c)=='|' ? '\031' : \ (c)=='\\' ? '\034' : \ (c)=='^' ? '\036' : \ (c)&077) #else #define CONTROL(c) ((c)&037) #endif /* IS_EBCDIC_HOST */ #define ESC CONTROL('[') #define ESCS "\33" #define CSI ((unsigned char)'\233') #if _OSK_MWC32 #define LSIGNAL(sig,func) os9_signal(sig,func) #else #define LSIGNAL(sig,func) signal(sig,func) #endif #if HAVE_SIGPROCMASK #if HAVE_SIGSET_T #else #undef HAVE_SIGPROCMASK #endif #endif #if HAVE_SIGPROCMASK #if HAVE_SIGEMPTYSET #else #undef sigemptyset #define sigemptyset(mp) *(mp) = 0 #endif #endif -#define S_INTERRUPT 01 -#define S_STOP 02 -#define S_WINCH 04 -#define ABORT_SIGS() (sigs & (S_INTERRUPT|S_STOP)) +#define S_INTERRUPT (1<<0) +#define S_SWINTERRUPT (1<<1) +#define S_STOP (1<<2) +#define S_WINCH (1<<3) +#define ABORT_SIGS() (sigs & (S_INTERRUPT|S_SWINTERRUPT|S_STOP)) #ifdef EXIT_SUCCESS #define QUIT_OK EXIT_SUCCESS #else #define QUIT_OK 0 #endif #ifdef EXIT_FAILURE #define QUIT_ERROR EXIT_FAILURE #define QUIT_INTERRUPT (EXIT_FAILURE+1) #else #define QUIT_ERROR 1 #define QUIT_INTERRUPT 2 #endif #define QUIT_SAVED_STATUS (-1) #define FOLLOW_DESC 0 #define FOLLOW_NAME 1 /* filestate flags */ #define CH_CANSEEK 001 #define CH_KEEPOPEN 002 #define CH_POPENED 004 #define CH_HELPFILE 010 #define CH_NODATA 020 /* Special case for zero length files */ #define CH_NOTRUSTSIZE 040 /* For files that claim 0 length size falsely */ #define ch_zero() ((POSITION)0) #define FAKE_HELPFILE "@/\\less/\\help/\\file/\\@" #define FAKE_EMPTYFILE "@/\\less/\\empty/\\file/\\@" /* Flags for cvt_text */ #define CVT_TO_LC 01 /* Convert upper-case to lower-case */ #define CVT_BS 02 /* Do backspace processing */ #define CVT_CRLF 04 /* Remove CR after LF */ #define CVT_ANSI 010 /* Remove ANSI escape sequences */ #if HAVE_TIME_T #define time_type time_t #else #define time_type long #endif /* X11 mouse reporting definitions */ #define X11MOUSE_BUTTON1 0 /* Left button press */ #define X11MOUSE_BUTTON2 1 /* Middle button press */ #define X11MOUSE_BUTTON3 2 /* Right button press */ #define X11MOUSE_BUTTON_REL 3 /* Button release */ #define X11MOUSE_DRAG 0x20 /* Drag with button down */ #define X11MOUSE_WHEEL_UP 0x40 /* Wheel scroll up */ #define X11MOUSE_WHEEL_DOWN 0x41 /* Wheel scroll down */ #define X11MOUSE_OFFSET 0x20 /* Added to button & pos bytes to create a char */ /* Security features. */ #define SF_EDIT (1<<1) /* Edit file (v) */ #define SF_EXAMINE (1<<2) /* Examine file (:e) */ #define SF_GLOB (1<<3) /* Expand file pattern */ #define SF_HISTORY (1<<4) /* History file */ #define SF_LESSKEY (1<<5) /* Lesskey files */ #define SF_LESSOPEN (1<<6) /* LESSOPEN */ #define SF_LOGFILE (1<<7) /* Log file (s, -o) */ #define SF_PIPE (1<<8) /* Pipe (|) */ #define SF_SHELL (1<<9) /* Shell command (!) */ #define SF_STOP (1<<10) /* Stop signal */ #define SF_TAGS (1<<11) /* Tags */ #define SF_OSC8_OPEN (1<<12) /* OSC8 open */ #if LESSTEST #define LESS_DUMP_CHAR CONTROL(']') #endif struct mlist; struct loption; struct hilite_tree; struct ansi_state; #include "pattern.h" #include "xbuf.h" #include "funcs.h" /* Functions not included in funcs.h */ void postoa(POSITION, char*, int); void linenumtoa(LINENUM, char*, int); void inttoa(int, char*, int); int lstrtoi(char*, char**, int); POSITION lstrtopos(char*, char**, int); unsigned long lstrtoul(char*, char**, int); int lstrtoic(constant char*, constant char**, int); POSITION lstrtoposc(constant char*, constant char**, int); unsigned long lstrtoulc(constant char*, constant char**, int); #if MSDOS_COMPILER==WIN32C int pclose(FILE*); #endif diff --git a/contrib/less/less.nro b/contrib/less/less.nro index 6b74ec5f161b..25a9869a9c59 100644 --- a/contrib/less/less.nro +++ b/contrib/less/less.nro @@ -1,2628 +1,2628 @@ '\" t -.TH LESS 1 "Version 678: 01 May 2025" +.TH LESS 1 "Version 679: 28 May 2025" .SH NAME less \- display the contents of a file in a terminal .SH SYNOPSIS .B "less \-?" .br .B "less \-\-help" .br .B "less \-V" .br .B "less \-\-version" .br .B "less [\-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX\(ti]" .br .B " [\-b \fIspace\/\fP] [\-h \fIlines\/\fP] [\-j \fIline\/\fP] [\-k \fIkeyfile\/\fP]" .br .B " [\-{oO} \fIlogfile\/\fP] [\-p \fIpattern\/\fP] [\-P \fIprompt\/\fP] [\-t \fItag\/\fP]" .br .B " [\-T \fItagsfile\/\fP] [\-x \fItab\/\fP,...] [\-y \fIlines\/\fP] [\-[z] \fIlines\/\fP]" .br .B " [\-# \fIshift\/\fP] [+[+]\fIcmd\/\fP] [\-\-] [\fIfilename\/\fP]..." .br (See the OPTIONS section for alternate option syntax with long option names.) . .SH DESCRIPTION .B Less is a program similar to .BR more (1), but it has many more features. .B Less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like .BR vi (1). .B Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals. There is even limited support for hardcopy terminals. (On a hardcopy terminal, lines which should be printed at the top of the screen are prefixed with a caret.) .SH COMMANDS Commands are based on both .B more and .BR vi . Commands may be preceded by a decimal number, called N in the descriptions below. The number is used by some commands, as indicated. .PP In the following descriptions, \(haX means control-X. ESC stands for the ESCAPE key; for example ESC-v means the two character sequence "ESCAPE", then "v". .IP "h or H" Help: display a summary of these commands. If you forget all the other commands, remember this one. .IP "SPACE or \(haV or f or \(haF" Scroll forward N lines, default one window (see option \-z below). If N is more than the screen size, only the final screenful is displayed. Warning: some systems use \(haV as a special literalization character. .IP "z" Like SPACE, but if N is specified, it becomes the new window size. .IP "ENTER or RETURN or \(haN or e or \(haE or j or \(haJ" Scroll forward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size. .IP "d or \(haD" Scroll forward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. .IP "b or \(haB or ESC-v" Scroll backward N lines, default one window (see option \-z below). If N is more than the screen size, only the final screenful is displayed. .IP "w" Like ESC-v, but if N is specified, it becomes the new window size. .IP "y or \(haY or \(haP or k or \(haK" Scroll backward N lines, default 1. The entire N lines are displayed, even if N is more than the screen size. Warning: some systems use \(haY as a special job control character. .IP "u or \(haU" Scroll backward N lines, default one half of the screen size. If N is specified, it becomes the new default for subsequent d and u commands. .IP "J" Like j, but continues to scroll beyond the end of the file. .IP "K or Y" Like k, but continues to scroll beyond the beginning of the file. .IP "ESC-SPACE" Like SPACE, but scrolls a full screenful, even if it reaches the end of the file. .IP "ESC-b" Like b, but scrolls a full screenful, even if it reaches the beginning of the file. .IP "ESC-j" Scroll forward N file lines, default 1. A file line is a complete line in the file, terminated by a newline. .IP "ESC-k" Scroll backwards N file lines, default 1. .IP "ESC-) or RIGHTARROW" Scroll horizontally right N characters, default half the screen width (see the \-# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW commands. While the text is scrolled, it acts as though the \-S option (chop lines) were in effect. .IP "ESC-( or LEFTARROW" Scroll horizontally left N characters, default half the screen width (see the \-# option). If a number N is specified, it becomes the default for future RIGHTARROW and LEFTARROW commands. .IP "ESC-} or \(haRIGHTARROW" Scroll horizontally right to show the end of the longest displayed line. .IP "ESC-{ or \(haLEFTARROW" Scroll horizontally left back to the first column. .IP "r or \(haR or \(haL" Repaint the screen. .IP R Repaint the screen, discarding any buffered input. That is, reload the current file. Useful if the file is changing while it is being viewed. .IP "F" Scroll forward, and keep trying to read when the end of file is reached. Normally this command would be used when already at the end of the file. It is a way to monitor the tail of a file which is growing while it is being viewed. (The behavior is similar to the "tail \-f" command.) To stop waiting for more data, enter the interrupt character (usually \(haC). On systems which support .BR poll (2) you can also use \(haX or the character specified by the \-\-intr option. If the input is a pipe and the \-\-exit-follow-on-close option is in effect, .B less will automatically stop waiting for data when the input side of the pipe is closed. .IP "ESC-F" 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-<" 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->" 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 standard input, rather than a file, is being read.) .IP "ESC-G" Same as G, except if no number N is specified and the input is standard input, goes to the last line which is currently buffered. .IP "p or %" Go to a position N percent into the file. N should be between 0 and 100, and may contain a decimal point. .IP "P" Go to the line containing byte offset N in the file. .IP "{" If a left curly bracket appears in the top line displayed on the screen, the { command will go to the matching right curly bracket. The matching right curly bracket is positioned on the bottom line of the screen. If there is more than one left curly bracket on the top line, a number N may be used to specify the N-th bracket on the line. .IP "}" If a right curly bracket appears in the bottom line displayed on the screen, the } command will go to the matching left curly bracket. The matching left curly bracket is positioned on the top line of the screen. If there is more than one right curly bracket on the bottom line, a number N may be used to specify the N-th bracket on the line. .IP "(" Like {, but applies to parentheses rather than curly brackets. .IP ")" Like }, but applies to parentheses rather than curly brackets. .IP "[" Like {, but applies to square brackets rather than curly brackets. .IP "]" Like }, but applies to square brackets rather than curly brackets. .IP "ESC-\(haF" Followed by two characters, acts like {, but uses the two characters as open and close brackets, respectively. For example, "ESC \(haF < >" could be used to go forward to the > which matches the < in the top displayed line. .IP "ESC-\(haB" Followed by two characters, acts like }, but uses the two characters as open and close brackets, respectively. For example, "ESC \(haB < >" could be used to go backward to the < which matches the > in the bottom displayed line. .IP m Followed by any lowercase or uppercase letter, marks the first displayed line with that letter. If the status column is enabled via the \-J option, the status column shows the marked line. .IP M Acts like m, except the last displayed line is marked rather than the first displayed line. .IP "\(aq" (Single quote.) Followed by any lowercase or uppercase letter, returns to the position which was previously marked with that letter. Followed by another single quote, returns to the position at which the last "large" movement command was executed. Followed by a \(ha or $, jumps to the beginning or end of the file respectively. Marks are preserved when a new file is examined, so the \(aq command can be used to switch between input files. .IP "\(haX\(haX" Same as single quote. .IP "ESC-m" Followed by any lowercase or uppercase letter, clears the mark identified by that letter. .IP /pattern Search forward in the file for the N-th line containing the pattern. N defaults to 1. The pattern is a regular expression, as recognized by the regular expression library supplied by your system. By default, searching is case-sensitive (uppercase and lowercase are considered different); the \-i option can be used to change this. The search starts at the first line displayed (but see the \-a and \-j options, which change this). .sp Certain characters are special if entered at the beginning of the pattern; they modify the type of search rather than become part of the pattern: .RS .IP "\(haN or !" Search for lines which do NOT match the pattern. .IP "\(haE or *" Search multiple files. That is, if the search reaches the END of the current file without finding a match, the search continues in the next file in the command line list. .IP "\(haF or @" Begin the search at the first line of the FIRST file in the command line list, regardless of what is currently displayed on the screen or the settings of the \-a or \-j options. .IP "\(haK" Highlight any text which matches the pattern on the current screen, but don't move to the first match (KEEP current position). .IP "\(haR" Don't interpret regular expression metacharacters; that is, do a simple textual comparison. .IP "\(haS" Followed by a digit N between 1 and 5. Only text which has a non-empty match for the N-th parenthesized SUB-PATTERN will be considered to match the pattern. For example, searching for "(abc)|(def)" modified with \(haS1 would search for instances of "abc", but would highlight instances of both "abc" and "def". (Supported only if .B less is built with one of the regular expression libraries .BR posix ", " pcre ", or " pcre2 ".)" Multiple \(haS modifiers can be specified, to match more than one sub-pattern. .IP "\(haW" WRAP around the current file. That is, if the search reaches the end of the current file without finding a match, the search continues from the first line of the current file up to the line where it started. If the \(haW modifier is set, the \(haE modifier is ignored. .IP "\(haL" The next character is taken literally; that is, it becomes part of the pattern even if it is one of the above search modifier characters. .RE .IP ?pattern Search backward in the file for the N-th line containing the pattern. The search starts at the last line displayed (but see the \-a and \-j options, which change this). .sp Certain characters are special as in the / command: .RS .IP "\(haN or !" Search for lines which do NOT match the pattern. .IP "\(haE or *" Search multiple files. That is, if the search reaches the beginning of the current file without finding a match, the search continues in the previous file in the command line list. .IP "\(haF or @" Begin the search at the last line of the last file in the command line list, regardless of what is currently displayed on the screen or the settings of the \-a or \-j options. .IP "\(haK" As in forward searches. .IP "\(haR" As in forward searches. .IP "\(haS" As in forward searches. .IP "\(haW" WRAP around the current file. That is, if the search reaches the beginning of the current file without finding a match, the search continues from the last line of the current file up to the line where it started. .IP "\(haL" As in forward searches. .RE .IP "ESC-/pattern" Same as "/*". .IP "ESC-?pattern" Same as "?*". .IP n Repeat previous search, for N-th line containing the last pattern. If the previous search was modified by \(haN, the search is made for the N-th line NOT containing the pattern. If the previous search was modified by \(haE, the search continues in the next (or previous) file if not satisfied in the current file. If the previous search was modified by \(haR, the search is done without using regular expressions. If the previous search was modified by \(haW, the search wraps at the end (or beginning) of the file. There is no effect if the previous search was modified by \(haF or \(haK. .IP N Repeat previous search, but in the reverse direction. .IP "ESC-n" Repeat previous search, but crossing file boundaries. The effect is as if the previous search were modified by *. .IP "ESC-N" Repeat previous search, but in the reverse direction and crossing file boundaries. .IP "ESC-u" Undo search highlighting. Turn off highlighting of strings matching the current search pattern. If highlighting is already off because of a previous ESC-u command, turn highlighting back on. Any search command will also turn highlighting back on. (Highlighting can also be disabled by toggling the \-G option; in that case search commands do not turn highlighting back on.) .IP "ESC-U" Like ESC-u but also clears the saved search pattern. If the status column is enabled via the \-J option, this clears all search matches marked in the status column. .IP "&pattern" Display only lines which match the pattern; lines which do not match the pattern are not displayed. If pattern is empty (if you type & immediately followed by ENTER), any filtering is turned off, and all lines are displayed. While filtering is in effect, an ampersand is displayed at the beginning of the prompt, as a reminder that some lines in the file may be hidden. Multiple & commands may be entered, in which case only lines which match all of the patterns will be displayed. .sp Certain characters are special as in the / command: .RS .IP "\(haN or !" Display only lines which do NOT match the pattern. .IP "\(haR" Don't interpret regular expression metacharacters; that is, do a simple textual comparison. .RE .IP ":e [filename]" Examine a new file. If the filename is missing, the "current" file (see the :n and :p commands below) from the list of files in the command line is re-examined. A percent sign (%) in the filename is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously examined file. However, two consecutive percent signs are simply replaced with a single percent sign. This allows you to enter a filename that contains a percent sign in the name. Similarly, two consecutive pound signs are replaced with a single pound sign. The filename is inserted into the command line list of files so that it can be seen by subsequent :n and :p commands. If the filename consists of several files, they are all inserted into the list of files and the first one is examined. If the filename contains one or more spaces, the entire filename should be enclosed in double quotes (also see the \-" option). .IP "\(haX\(haV or E" Same as :e. Warning: some systems use \(haV as a special literalization character. On such systems, you may not be able to use \(haV. .IP ":n" Examine the next file (from the list of files given in the command line). If a number N is specified, the N-th next file is examined. .IP ":p" Examine the previous file in the command line list. If a number N is specified, the N-th previous file is examined. .IP ":x" Examine the first file in the command line list. If a number N is specified, the N-th file in the list is examined. .IP ":d" Remove the current file from the list of files. .IP "t" Go to the next tag, if there were more than one matches for the current tag. See the \-t option for more details about tags. .IP "T" Go to the previous tag, if there were more than one matches for the current tag. .IP "\(haO\(haN or \(haOn" Search forward in the file for the N-th next OSC 8 hyperlink. .IP "\(haO\(haP or \(haOp" Search backward in the file for the N-th previous OSC 8 hyperlink. .IP "\(haO\(haL or \(haOl" Jump to the currently selected OSC 8 hyperlink. .IP "= or \(haG or :f" Prints some information about the file being viewed, including its name and the line number and byte offset of the bottom line being displayed. If possible, it also prints the length of the file, the number of lines in the file and the percent of the file above the last displayed line. .IP \- Followed by one of the command line option letters (see OPTIONS below), this will change the setting of that option and print a message describing the new setting. If a \(haP (CONTROL-P) is entered immediately after the dash, the setting of the option is changed but no message is printed. If the option letter has a numeric value (such as \-b or \-h), or a string value (such as \-P or \-t), a new value may be entered after the option letter. If no new value is entered, a message describing the current setting is printed and nothing is changed. .IP \-\- Like the \- command, but takes a long option name (see OPTIONS below) rather than a single option letter. Press ENTER or RETURN after typing the option name to change it. You can enter just the beginning of an option name, then press TAB to find all option names which begin with that string. A \(haP immediately after the second dash suppresses printing of a message describing the new setting, as in the \- command. .IP \-+ Followed by one of the command line option letters this will reset the option to its default setting and print a message describing the new setting. (The "\-+\fIX\fP" command does the same thing as "\-+\fIX\fP" on the command line.) This does not work for string-valued options. .IP \-\-+ Like the \-+ command, but takes a long option name rather than a single option letter. .IP \-! Followed by one of the command line option letters, this will reset the option to the "opposite" of its default setting and print a message describing the new setting. This does not work for numeric or string-valued options. .IP \-\-! Like the \-!\& command, but takes a long option name rather than a single option letter. .IP _ (Underscore.) Followed by one of the command line option letters, this will print a message describing the current setting of that option. The setting of the option is not changed. .IP __ (Double underscore.) Like the _ (underscore) command, but takes a long option name rather than a single option letter. You must press ENTER or RETURN after typing the option name. .IP +cmd Causes the specified cmd to be executed each time a new file is examined. For example, +G causes .B less to initially display each file starting at the end rather than the beginning. .IP V Prints the version number of .B less being run. .IP "q or Q or :q or :Q or ZZ" Exits .BR less . .PP The following seven commands may or may not be valid, depending on your particular installation. . .IP v Invokes an editor to edit the current file being viewed. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to "vi" if neither VISUAL nor EDITOR is defined. See also the discussion of LESSEDIT under the section on PROMPTS below. .IP "! shell-command" Invokes a shell to run the shell-command given. A percent sign (%) in the command is replaced by the name of the current file. A pound sign (#) is replaced by the name of the previously examined file. "!!" repeats the last shell command. "!" with no shell command invokes an interactive shell. If a \(haP (CONTROL-P) is entered immediately after the !, no "done" message is printed after the shell command is executed. On Unix systems, the shell is taken from the environment variable SHELL, or defaults to "sh". On MS-DOS, Windows, and OS/2 systems, the shell is the normal command processor. .IP "# shell-command" Similar to the "!" command, except that the command is expanded in the same way as prompt strings. For example, the name of the current file would be given as "%f". .IP "| shell-command" represents any mark letter. Pipes a section of the input file to the given shell command. The section of the file to be piped is between the position marked by the letter and the current screen. The entire current screen is included, regardless of whether the marked position is before or after the current screen. may also be \(ha or $ to indicate beginning or end of file respectively. If is \&.\& or newline, the current screen is piped. If a \(haP (CONTROL-P) is entered immediately after the mark letter, no "done" message is printed after the shell command is executed. .IP "s filename" Save the input to a file. This works only if the input is a pipe, not an ordinary file. .IP "\(haO\(haO" .RS Run a shell command to open the URI in the current OSC 8 hyperlink, selected by a previous \(haO\(haN or \(haO\(haP command. To find the shell command, the environment variable named "LESS_OSC8_xxx" is read, where "xxx" is the scheme from the URI (the part before the first colon), or is empty if there is no colon in the URI. The value of the environment variable is then expanded in the same way as prompt strings (in particular, any instance of "%o" is replaced with the URI) to produce an OSC 8 "handler" shell command. The standard output from the handler is an "opener" shell command which is then executed to open the URI. .PP There are two special cases: .RS .IP 1. If the URI begins with "#", the remainder of the URI is taken to be the value of the id parameter in another OSC 8 link in the same file, and \(haO\(haO will simply jump to that link. .IP 2. If the opener begins with the characters ":e" followed by whitespace and a filename, then instead of running the opener as a shell command, the specified filename is opened in the current instance of .BR less . .RE .PP In a simple case where the opener accepts the complete URI as a command line parameter, the handler may be as simple as .nf .sp echo mybrowser '%o' .sp .fi In other cases, the URI may need to be modified, so the handler may have to do some manipulation of the %o value. .PP If the LESS_OSC8_xxx variable is not set, the variable LESS_OSC8_ANY is tried. If neither LESS_OSC8_xxx nor LESS_OSC8_ANY is set, links using the "xxx" scheme cannot be opened. However, there are default handlers for the schemes "man" (used when LESS_OSC8_man is not set) and "file" (used when LESS_OSC8_file is not set), which should work on systems which provide the .BR sed (1) command and a shell with syntax compatible with the Bourne shell .BR sh (1). If you use LESS_OSC8_ANY to override LESS_OSC8_file, you must set LESS_OSC8_file to "-" to indicate that the default value should not be used, and likewise for LESS_OSC8_man. .PP The URI passed to an OSC8 handler via %o is guaranteed not to contain any single quote or double quote characters, but it may contain any other shell metacharacters such as semicolons, dollar signs, ampersands, etc. The handler should take care to appropriately quote parameters in the opener command, to prevent execution of unintended shell commands in the case of opening a URI which contains shell metacharacters. Also, since the handler command is expanded like a command prompt, any metacharacters interpreted by prompt expansion (such as percent, dot, colon, backslash, etc.) must be escaped with a backslash (see the PROMPTS section for details). .RE .IP "\(haX" When the "Waiting for data" message is displayed, such as while in the F command, pressing \(haX will stop .B less from waiting and return to a prompt. This may cause .B less to think that the file ends at the current position, so it may be necessary to use the R or F command to see more data. The \-\-intr option can be used to specify a different character to use instead of \(haX. This command works only on systems that support the .BR poll (2) function. On systems without .BR poll (2), the interrupt character (usually \(haC) can be used instead. . .SH OPTIONS Command line options are described below. Most options may be changed while .B less is running, via the "\-" command. .PP Some options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name. A long option name may be abbreviated as long as the abbreviation is unambiguous. For example, \-\-mouse may be abbreviated \-\-mou, but not \-\-mo, since both \-\-mouse and \-\-modelines begin with \-\-mo. Some long option names are in uppercase, such as \-\-QUIT-AT-EOF, as distinct from \-\-quit-at-eof. Such option names need only have their first letter capitalized; the remainder of the name may be in either case. For example, \-\-Quit-at-eof is equivalent to \-\-QUIT-AT-EOF. .PP Options are also taken from the environment variable "LESS". For example, to avoid typing "less \-options \&...\&" each time .B less is invoked, you might tell .BR csh : .sp setenv LESS "\-options" .sp or if you use .BR sh : .sp LESS="\-options"; export LESS .sp On MS-DOS and Windows, you don't need the quotes, but you should be careful that any percent signs in the options string are not interpreted as an environment variable expansion. .sp The environment variable is parsed before the command line, so command line options override the LESS environment variable. If an option appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "\-+". .sp Some options like \-k or \-D require a string to follow the option letter. The string for that option is considered to end when a dollar sign ($) is found. For example, you can set two \-D options like this: .sp LESS="Dnwb$Dsbw" .sp If the \-\-use-backslash option appears earlier in the options, then a dollar sign or backslash may be included literally in an option string by preceding it with a backslash. If the \-\-use-backslash option is not in effect, then backslashes are not treated specially, and there is no way to include a dollar sign in the option string. .IP "\-? or \-\-help" This option displays a summary of the commands accepted by .B less (the same as the h command). (Depending on how your shell interprets the question mark, it may be necessary to quote the question mark, thus: "\-\e?".) .IP "\-a or \-\-search-skip-screen" By default, forward searches start at the top of the displayed screen and backwards searches start at the bottom of the displayed screen (except for repeated searches invoked by the n or N commands, which start after or before the "target" line respectively; see the \-j option for more about the target line). The \-a option causes forward searches to instead start at the bottom of the screen and backward searches to start at the top of the screen, thus skipping all lines displayed on the screen. .IP "\-A or \-\-SEARCH-SKIP-SCREEN" Causes all forward searches (not just non-repeated searches) to start just after the target line, and all backward searches to start just before the target line. Thus, forward searches will skip part of the displayed screen (from the first line up to and including the target line). Similarly backwards searches will skip the displayed screen from the last line up to and including the target line. This was the default behavior in less versions prior to 441. .IP "\-b\fIn\fP or \-\-buffers=\fIn\fP" Specifies the amount of buffer space .B less will use for each file, in units of kilobytes (1024 bytes). By default 64\ KB of buffer space is used for each file (unless the file is a pipe; see the \-B option). The \-b option specifies instead that \fIn\fP kilobytes of buffer space should be used for each file. If \fIn\fP is \-1, buffer space is unlimited; that is, the entire file can be read into memory. .IP "\-B or \-\-auto-buffers" By default, when data is read from a pipe, buffers are allocated automatically as needed. If a large amount of data is read from the pipe, this can cause a large amount of memory to be allocated. The \-B option disables this automatic allocation of buffers for pipes, so that only 64\ KB (or the amount of space specified by the \-b option) is used for the pipe. Warning: use of \-B can result in erroneous display, since only the most recently viewed part of the piped data is kept in memory; any earlier data is lost. Lost characters are displayed as question marks. .IP "\-c or \-\-clear-screen" Causes full screen repaints to be painted from the top line down. By default, full screen repaints are done by scrolling from the bottom of the screen. .IP "\-C or \-\-CLEAR-SCREEN" Same as \-c, for compatibility with older versions of .BR less . .IP "\-d or \-\-dumb" The \-d option suppresses the error message normally displayed if the terminal is dumb; that is, lacks some important capability, such as the ability to clear the screen or scroll backward. The \-d option does not otherwise change the behavior of .B less on a dumb terminal. .IP "\-D\fBx\fP\fIcolor\fP or \-\-color=\fBx\fP\fIcolor\fP" Changes the color of different parts of the displayed text. \fBx\fP is a single character which selects the type of text whose color is being set: .RS .IP "B" Binary characters. .IP "C" Control characters. .IP "E" Errors and informational messages. .IP "H" Header lines and columns, set via the \-\-header option. .IP "M" Mark letters in the status column. .IP "N" Line numbers enabled via the \-N option. .IP "P" Prompts. .IP "R" The rscroll character. .IP "S" Search results. .IP "W" The highlight enabled via the \-w option. .IP "1-5" The text in a search result which matches the first through fifth parenthesized sub-pattern. Sub-pattern coloring works only if .B less is built with one of the regular expression libraries .BR posix ", " pcre ", or " pcre2 . .IP "d" Bold text. .IP "k" Blinking text. .IP "s" Standout text. .IP "u" Underlined text. .RE .RS The uppercase letters and digits can be used only when the \-\-use-color option is enabled. When text color is specified by both an uppercase letter and a lowercase letter, the uppercase letter takes precedence. For example, error messages are normally displayed as standout text. So if both "s" and "E" are given a color, the "E" color applies to error messages, and the "s" color applies to other standout text. The lowercase letters refer to bold and underline text formed by overstriking with backspaces (see the \-U option) and to non-content text (such as line numbers and prompts), but not to text formatted using ANSI escape sequences with the \-R option (but see the note below for different behavior on Windows and MS-DOS). .PP A lowercase letter may be followed by a + to indicate that the normal format change and the specified color should both be used. For example, \-Dug displays underlined text as green without underlining; the green color has replaced the usual underline formatting. But \-Du+g displays underlined text as both green and in underlined format. .PP \fIcolor\fP is either a 4-bit color string or an 8-bit color string: .PP A 4-bit color string is one or two characters, where the first character specifies the foreground color and the second specifies the background color as follows: .IP "b" Blue .IP "c" Cyan .IP "g" Green .IP "k" Black .IP "m" Magenta .IP "r" Red .IP "w" White .IP "y" Yellow .PP The corresponding uppercase letter denotes a brighter shade of the color. For example, \-DNGk displays line numbers as bright green text on a black background, and \-DEbR displays error messages as blue text on a bright red background. If either character is a "-" or is omitted, the corresponding color is set to that of normal text. .PP An 8-bit color string is one or two decimal integers separated by a dot, where the first integer specifies the foreground color and the second specifies the background color. Each integer is a value between 0 and 255 inclusive which selects a "CSI 38;5" color value (see .UR https://en.wikipedia.org/wiki/ANSI_escape_code#SGR .UE ). If either integer is a "-" or is omitted, the corresponding color is set to that of normal text. .PP A 4-bit or 8-bit color string may be followed by one or more of the following characters to set text attributes in addition to the color. .IP "s or ~" Standout (reverse video) .IP "u or _" Underline .IP "d or *" Bold .IP "l or &" Blinking .PP On MS-DOS and Windows, the \-\-color option behaves differently from what is described above in these ways: .IP \(bu The bold (d and *) and blinking (l and &) text attributes at the end of a color string are not supported. .IP \(bu Lowercase color selector letters refer to text formatted by ANSI escape sequences with \-R, in addition to overstruck and non-content text (but see \-Da). .IP \(bu For historical reasons, when a lowercase color selector letter is followed by a numeric color value, the number is not interpreted as an "CSI 38;5" color value as described above, but instead as a 4-bit .nh CHAR_INFO.Attributes .hy value, between 0 and 15 inclusive (see .UR https://learn.microsoft.com/en-us/windows/console/char-info-str .UE ). To avoid confusion, it is recommended that the equivalent letters rather than numbers be used after a lowercase color selector on MS-DOS/Windows. .IP \(bu Numeric color values ("CSI 38;5" color) following an uppercase color selector letter are not supported on systems earlier than Windows 10. .IP \(bu Only a limited set of ANSI escape sequences to set color in the content work correctly. 4-bit color sequences work, but "CSI 38;5" color sequences do not. .IP \(bu The \-Da option makes the behavior of \-\-color more similar to its behavior on non-MS-DOS/Windows systems by (1) making lowercase color selector letters not affect text formatted with ANSI escape sequences, and (2) allowing "CSI 38;5" color sequences in the content work by passing them to the terminal (only on Windows 10 and later; on earlier Windows systems, such sequences do not work regardless of the setting of \-Da). .RE .IP "\-e or \-\-quit-at-eof" Causes .B less to automatically exit the second time it reaches end-of-file. By default, the only way to exit .B less is via the "q" command. .IP "\-E or \-\-QUIT-AT-EOF" Causes .B less to automatically exit the first time it reaches end-of-file. .IP "\-f or \-\-force" Forces non-regular files to be opened. (A non-regular file is a directory or a device special file.) Also suppresses the warning message when a binary file is opened. By default, .B less will refuse to open non-regular files. Note that some operating systems will not allow directories to be read, even if \-f is set. .IP "\-F or \-\-quit-if-one-screen" Causes .B less to automatically exit if the entire file can be displayed on the first screen. Also see the description of the LESS_SHELL_LINES environment variable below. .IP "\-g or \-\-hilite-search" Normally, .B less will highlight ALL strings which match the last search command. The \-g option changes this behavior to highlight only the particular string which was found by the last search command. This can cause .B less to run somewhat faster than the default. .IP "\-G or \-\-HILITE-SEARCH" The \-G option suppresses all highlighting of strings found by search commands. .IP "\-h\fIn\fP or \-\-max-back-scroll=\fIn\fP" Specifies a maximum number of lines to scroll backward. If it is necessary to scroll backward more than \fIn\fP lines, the screen is repainted in a forward direction instead. (If the terminal does not have the ability to scroll backward, \-h0 is implied.) .IP "\-i or \-\-ignore-case" Causes searches to ignore case; that is, uppercase and lowercase are considered identical. This option is ignored if any uppercase letters appear in the search pattern; in other words, if a pattern contains uppercase letters, then that search does not ignore case. .IP "\-I or \-\-IGNORE-CASE" Like \-i, but searches ignore case even if the pattern contains uppercase letters. .IP "\-j\fIn\fP or \-\-jump-target=\fIn\fP" Specifies a line on the screen where the "target" line is to be positioned. The target line is the line specified by any command to search for a pattern, jump to a line number, jump to a file percentage or jump to a tag. The screen line may be specified by a number: the top line on the screen is 1, the next is 2, and so on. The number may be negative to specify a line relative to the bottom of the screen: the bottom line on the screen is \-1, the second to the bottom is \-2, and so on. Alternately, the screen line may be specified as a fraction of the height of the screen, starting with a decimal point: \&.5 is in the middle of the screen, \&.3 is three tenths down from the first line, and so on. If the line is specified as a fraction, the actual line number is recalculated if the terminal window is resized. If the \-\-header option is used and the target line specified by \-j would be obscured by the header, the target line is moved to the first line after the header. .RS .PP If any form of the \-j option is used, repeated forward searches (invoked with "n" or "N") begin at the line immediately after the target line, and repeated backward searches begin at the target line, unless changed by \-a or \-A. For example, if "\-j4" is used, the target line is the fourth line on the screen, so forward searches begin at the fifth line on the screen. However nonrepeated searches (invoked with "/" or "?") always begin at the start or end of the current screen respectively. .RE .IP "\-J or \-\-status-column" Displays a status column at the left edge of the screen. The character displayed in the status column may be one of: .RS .IP ">" The line is chopped with the \-S option, and the text that is chopped off beyond the right edge of the screen contains a match for the current search. .IP "<" The line is horizontally shifted, and the text that is shifted beyond the left side of the screen contains a match for the current search. .IP "=" The line is both chopped and shifted, and there are matches beyond both sides of the screen. .IP "*" There are matches in the visible part of the line but none to the right or left of it. .IP "a-z, A-Z" The line has been marked with the corresponding letter via the m or M command. .RE .IP "\-k\fIfilename\fP or \-\-lesskey-file=\fIfilename\fP" Causes .B less to open and interpret the named file as a .BR lesskey (1) binary file. Multiple \-k options may be specified. If the LESSKEY or LESSKEY_SYSTEM environment variable is set, or if a lesskey file is found in a standard place (see KEY BINDINGS), it is also used as a .B lesskey file. Note the warning under "\-\-lesskey-content" below. .IP "\-\-lesskey-src=\fIfilename\fP" Causes .B less to open and interpret the named file as a .BR lesskey (1) source file. If the LESSKEYIN or LESSKEYIN_SYSTEM environment variable is set, or if a lesskey source file is found in a standard place (see KEY BINDINGS), it is also used as a lesskey source file. Prior to version 582, the .B lesskey program needed to be run to convert a lesskey .I source file to a lesskey .I binary file for .B less to use. Newer versions of .B less read the lesskey source file directly and ignore the binary file if the source file exists. Note the warning under "\-\-lesskey-content" below. .IP "\-\-lesskey-content=\fItext\fP" Causes .B less to interpret the specified text as the contents of a .BR lesskey (1) source file. In the text, .B lesskey lines may be separated by either newlines as usual, or by semicolons. A literal semicolon may be represented by a backslash followed by a semicolon. .sp Warning: certain environment variables such as LESS, LESSSECURE, LESSCHARSET and others, which are used early in startup, cannot be set in a file specified by a command line option (\-\-lesskey, \-\-lesskey-src or \-\-lesskey-content). When using a .B lesskey file to set environment variables, it is safer to use the default lesskey file, or to specify the file using the LESSKEYIN or LESSKEY_CONTENT environment variables rather than using a command line option. .IP "\-K or \-\-quit-on-intr" Causes .B less to exit immediately (with status 2) when an interrupt character (usually \(haC) is typed. Normally, an interrupt character causes .B less to stop whatever it is doing and return to its command prompt. Note that use of this option makes it impossible to return to the command prompt from the "F" command. .IP "\-L or \-\-no-lessopen" Ignore the LESSOPEN environment variable (see the INPUT PREPROCESSOR section below). This option can be set from within .BR less , but it will apply only to files opened subsequently, not to the file which is currently open. .IP "\-m or \-\-long-prompt" Causes .B less to prompt verbosely (like .BR more (1)), with the percent into the file. By default, .B less prompts with a colon. .IP "\-M or \-\-LONG-PROMPT" Causes .B less to prompt even more verbosely than .BR more (1). .IP "\-n or \-\-line-numbers" Suppresses line numbers. The default (to use line numbers) may cause .B less to run more slowly in some cases, especially with a very large input file. Using line numbers means: the line number will be displayed in the verbose prompt and in the = command, and the v command will pass the current line number to the editor (see also the discussion of LESSEDIT in PROMPTS below). .IP "\-N or \-\-LINE-NUMBERS" Causes a line number to be displayed at the beginning of each line in the display. .IP "\-o\fIfilename\fP or \-\-log-file=\fIfilename\fP" Causes .B less to copy its input to the named file as it is being viewed. This applies only when the input file is a pipe, not an ordinary file. If the file already exists, .B less will ask for confirmation before overwriting it. .IP "\-O\fIfilename\fP or \-\-LOG-FILE=\fIfilename\fP" The \-O option is like \-o, but it will overwrite an existing file without asking for confirmation. .sp If no log file has been specified, the \-o and \-O options can be used from within .B less to specify a log file. Without a file name, they will simply report the name of the log file. The "s" command is equivalent to specifying \-o from within .BR less . .IP "\-p\fIpattern\fP or \-\-pattern=\fIpattern\fP" The \-p option on the command line is equivalent to specifying +/\fIpattern\fP; that is, it tells .B less to start at the first occurrence of \fIpattern\fP in the file. .IP "\-P\fIprompt\fP or \-\-prompt=\fIprompt\fP" Provides a way to tailor the three prompt styles to your own preference. This option would normally be put in the LESS environment variable, rather than being typed in with each .B less command. Such an option must either be the last option in the LESS variable, or be terminated by a dollar sign. \-Ps followed by a string changes the default (short) prompt to that string. \-Pm changes the medium (\-m) prompt. \-PM changes the long (\-M) prompt. \-Ph changes the prompt for the help screen. \-P= changes the message printed by the = command. \-Pw changes the message printed while waiting for data (in the "F" command). .sp 1 All prompt strings consist of a sequence of letters and special escape sequences. See the section on PROMPTS for more details. .IP "\-q or \-\-quiet or \-\-silent" Causes moderately "quiet" operation: the terminal bell is not rung if an attempt is made to scroll past the end of the file or before the beginning of the file. If the terminal has a "visual bell", it is used instead. The bell will be rung on certain other errors, such as typing an invalid character. The default is to ring the terminal bell in all such cases. .IP "\-Q or \-\-QUIET or \-\-SILENT" Causes totally "quiet" operation: the terminal bell is never rung. If the terminal has a "visual bell", it is used in all cases where the terminal bell would have been rung. .IP "\-r or \-\-raw-control-chars" Causes "raw" control characters to be displayed. The default is to display control characters using the caret notation; for example, a control-A (octal 001) is displayed as "\(haA" (with some exceptions as described under the \-U option). Warning: when the \-r option is used, .B less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various display problems may result, such as long lines being split in the wrong place. .sp USE OF THE \-r OPTION IS DANGEROUS AND IS NOT RECOMMENDED. .br The \-r option can be set on the command line or via the \- command, but to avoid unintentional use, it cannot be set in a LESS environment variable. If \-r appears in a LESS environment variable, it is treated as if it were \-R. .IP "\-R or \-\-RAW-CONTROL-CHARS" Like \-r, but only a limited set of escape sequences are output in "raw" form. Unlike \-r, the screen appearance is maintained correctly. The sequences which are output raw are: .sp 1. ANSI SGR ("color") sequences .sp 2. OSC 8 hyperlinks .sp 3. Other OSC sequences, if the OSC type number is listed in the LESSANSIOSCALLOW environment variable .sp 4. OSC sequences starting with a non-standard introductory character (that is, something other than "]"), if the character is listed in the LESSANSIOSCCHARS environment variable followed by an asterisk .sp ANSI color escape sequences are sequences of the form: .sp ESC [ \&...\& m .sp where the "...\&" is zero or more color specification characters. Color escape sequences are only supported when the color is changed within one line, not across lines. In other words, the beginning of each line is assumed to be normal (non-colored), regardless of any escape sequences in previous lines. .sp You can make .B less think that characters other than "m" can end ANSI color escape sequences by setting the environment variable LESSANSIENDCHARS to the list of characters which can end a color escape sequence. And you can make .B less think that characters other than the standard ones may appear between the ESC and the m by setting the environment variable LESSANSIMIDCHARS to the list of characters which can appear. .sp OSC sequences are of the form: .sp ESC ] N ; \&...\& \\7 .sp where the OSC type number N is a decimal integer. The terminating sequence may be either a BEL character (\\7) as above, or the two-character sequence "ESC \\". .IP "\-s or \-\-squeeze-blank-lines" Causes consecutive blank lines to be squeezed into a single blank line. This is useful when viewing .BR nroff (1) output. .IP "\-S or \-\-chop-long-lines" Causes lines longer than the screen width to be chopped (truncated) rather than wrapped. That is, the portion of a long line that does not fit in the screen width is not displayed until you press RIGHT-ARROW. The default is to wrap long lines; that is, display the remainder on the next line. See also the \-\-wordwrap option. While the \-\-header option is active, the \-S option is ignored, and lines longer than the screen width are truncated. .IP "\-t\fItag\fP or \-\-tag=\fItag\fP" The \-t option, followed immediately by a TAG, will edit the file containing that tag. For this to work, tag information must be available; for example, there may be a file in the current directory called "tags", which was previously built by .BR ctags (1) or an equivalent command. If the environment variable LESSGLOBALTAGS is set, it is taken to be the name of a command compatible with .BR global (1), and that command is executed to find the tag. (See .UR http://www.gnu.org/software/global/global.html .UE ). The \-t option may also be specified from within .B less (using the \- command) as a way of examining a new file. The command ":t" is equivalent to specifying \-t from within .BR less . .IP "\-T\fItagsfile\fP or \-\-tag-file=\fItagsfile\fP" Specifies a tags file to be used instead of "tags". .IP "\-u or \-\-underline-special" Causes backspaces and carriage returns to be treated as printable characters; that is, they are sent to the terminal when they appear in the input. .IP "\-U or \-\-UNDERLINE-SPECIAL" Causes backspaces, tabs, carriage returns and "formatting characters" (as defined by Unicode) to be treated as control characters; that is, they are handled as specified by the \-r option. .sp By default, if neither \-u nor \-U is given, backspaces which appear adjacent to an underscore character are treated specially: the underlined text is displayed using the terminal's hardware underlining capability. Also, backspaces which appear between two identical characters are treated specially: the overstruck text is printed using the terminal's hardware boldface capability. Other backspaces are deleted, along with the preceding character. Carriage returns immediately followed by a newline are deleted. Other carriage returns are handled as specified by the \-r option. Unicode formatting characters, such as the Byte Order Mark, are sent to the terminal. Text which is overstruck or underlined can be searched for if neither \-u nor \-U is in effect. .sp See also the \-\-proc-backspace, \-\-proc-tab, and \-\-proc-return options. .IP "\-V or \-\-version" Displays the version number of .BR less . .IP "\-w or \-\-hilite-unread" Temporarily highlights the first "new" line after a forward movement of a full page. The first "new" line is the line immediately following the line previously at the bottom of the screen. Also highlights the target line after a g or p command. The highlight is removed at the next command which causes movement. If the \-\-status-line option is in effect, the entire line (the width of the screen) is highlighted. Otherwise, only the text in the line is highlighted, unless the \-J option is in effect, in which case only the status column is highlighted. .IP "\-W or \-\-HILITE-UNREAD" Like \-w, but temporarily highlights the first new line after any forward movement command larger than one line. .IP "\-x\fIn\fP,...\& or \-\-tabs=\fIn\fP,..." Sets tab stops. If only one \fIn\fP is specified, tab stops are set at multiples of \fIn\fP. If multiple values separated by commas are specified, tab stops are set at those positions, and then continue with the same spacing as the last two. For example, "-x9,17" will set tabs at positions 9, 17, 25, 33, etc. The default for \fIn\fP is 8. .IP "\-X or \-\-no-init" Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen. .IP "\-y\fIn\fP or \-\-max-forw-scroll=\fIn\fP" Specifies a maximum number of lines to scroll forward. If it is necessary to scroll forward more than \fIn\fP lines, the screen is repainted instead. The \-c or \-C option may be used to repaint from the top of the screen if desired. By default, any forward movement causes scrolling. .IP "\-z\fIn\fP or \-\-window=\fIn\fP or \-\fIn\fP" Changes the default scrolling window size to \fIn\fP lines. The default is one screenful. The z and w commands can also be used to change the window size. The "z" may be omitted for compatibility with some versions of .BR more (1). If the number .I n is negative, it indicates .I n lines less than the current screen size. For example, if the screen is 24 lines, \fI\-z\-4\fP sets the scrolling window to 20 lines. If the screen is resized to 40 lines, the scrolling window automatically changes to 36 lines. .IP "\-\(dq\fIcc\fP\ or\ \-\-quotes=\fIcc\fP" 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 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 quote). .IP "\-\(ti or \-\-tilde" Normally lines after end of file are displayed as a single tilde (\(ti). This option causes lines after end of file to be displayed as blank lines. .IP "\-# or \-\-shift" Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number specified is zero, it sets the default number of positions to one half of the screen width. 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 window is resized. .IP "\-\-exit-follow-on-close" When using the "F" command on a pipe, .B less will automatically stop waiting for more data when the input side of the pipe is closed. .IP "\-\-file-size" If \-\-file-size is specified, .B less will 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-seekable (such as a pipe) and is large. .IP "\-\-follow-name" Normally, if the input file is renamed while an F command is executing, .B less will continue to display the contents of the original file despite its name change. If \-\-follow-name is specified, during an F command .B less will periodically attempt to reopen 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 renamed) file), .B less will display the contents of that new file. .IP "\-\-form-feed" When scrolling forward or backward in the file, stop if a line beginning with a form feed character (\(haL) is reached. This can be useful when viewing a file which uses form feeds between pages. .IP "\-\-header=\fIL\fP,\fIC\fP,\fIN\fP" .RS Sets the number of header lines and columns displayed on the screen. The number of header lines is set to \fIL\fP. If \fIL\fP is 0, header lines are disabled. If \fIL\fP is empty or missing, the number of header lines is unchanged. The number of header columns is set to \fIC\fP. If \fIC\fP is 0, header columns are disabled. If \fIC\fP is empty or missing, the number of header columns is unchanged. The first header line is set to line number \fIN\fP in the file. If \fIN\fP is empty or missing, it is taken to be the number of the line currently displayed in the first line of the screen (if the \-\-header command has been issued from within .BR less ")," or 1 (if the \-\-header option has been given on the command line). The special form "\-\-header=\-" disables header lines and header columns, and is equivalent to "\-\-header=0,0". .PP When \fIL\fP is nonzero, the first \fIL\fP lines at the top of the screen are replaced with the \fIL\fP lines of the file beginning at line \fIN\fP, regardless of what part of the file is being viewed. When header lines are displayed, any file contents before the header line cannot be viewed. When \fIC\fP is nonzero, the first \fIC\fP characters displayed at the beginning of each line are replaced with the first \fIC\fP characters of the line, even if the rest of the line is scrolled horizontally. .PP While the \-\-header option is active, lines longer than the screen width are truncated, and the \-S option is ignored. .RE .IP "\-\-incsearch" Subsequent search commands will be "incremental"; that is, .B less will advance to the next line containing the search pattern as each character of the pattern is typed in. .IP "\-\-intr=\fIc\fP" Use the character \fIc\fP instead of \(haX to interrupt a read when the "Waiting for data" message is displayed. \fIc\fP must be an ASCII character; that is, one with a value between 1 and 127 inclusive. A caret followed by a single character can be used to specify a control character. .IP "\-\-line-num-width=\fIn\fP" Sets the minimum width of the line number field when the \-N option is in effect to \fIn\fP characters. The default is 7. .IP "\-\-match-shift=\fIn\fP" When \-S is 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 after the shift. In other words, there will be \fIn\fP characters visible 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 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 window is resized. .IP "\-\-modelines=\fIn\fP" .RS Before displaying a file, .B less will read the first \fIn\fP lines to try to find a vim-compatible .IR modeline . If \fIn\fP is zero, .B less does not try to find modelines. By using a modeline, the file itself can specify the tab stops that should be used when viewing it. .PP 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 separated 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=\fIn\fP" or "ts=\fIn\fP", then tab stops are automatically set as if \-\-tabs=\fIn\fP had been given. See the \-\-tabs description for acceptable values of \fIn\fP. .RE .IP "\-\-mouse" Enables mouse input: scrolling the mouse wheel down moves forward 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 \(haO\(haN 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 \(haO\(haO command. The number of lines to scroll when the wheel is moved can be set by the \-\-wheel-lines option. Mouse input works only on terminals which support X11 mouse reporting, and on the Windows version of .BR less . .IP "\-\-MOUSE" Like \-\-mouse, except the direction scrolled on mouse wheel movement is reversed. .IP "\-\-no-edit-warn" Don't print a warning message when using the v command on a file which was opened using a LESSOPEN preprocessor (see the INPUT PREPROCESSOR section below). .IP "\-\-no-keypad" 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. .IP "\-\-no-histdups" 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 multiple times. .IP "\-\-no-number-headers" Header lines (defined via the \-\-header option) are not assigned line numbers. Line number 1 is assigned to the first line after any header lines. .IP "\-\-no-paste" If the terminal supports xterm-compatible "bracketed paste", any text pasted into .B less is 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. .IP "\-\-no-search-header-lines" Searches do not include header lines, but still include header columns. .IP "\-\-no-search-header-columns" Searches do not include header columns, but still include header lines. .IP "\-\-no-search-headers" Searches do not include header lines or header columns. .IP "\-\-no-vbell" Disables the terminal's visual bell. .IP "\-\-proc-backspace" If set, backspaces are handled as if neither the \-u option nor the \-U option were set. That is, a backspace adjacent to an underscore causes text to be displayed in underline mode, and a backspace between identical characters cause text to be displayed in boldface mode. This option overrides the \-u and \-U options, so that display of backspaces can be controlled separate from tabs and carriage returns. If not set, backspace display is controlled by the \-u and \-U options. .IP "\-\-PROC-BACKSPACE" If set, backspaces are handled as if the \-U option were set; that is backspaces are treated as control characters. .IP "\-\-proc-return" If set, carriage returns are handled as if neither the \-u option nor the \-U option were set. That is, a carriage return immediately before a newline is deleted. This option overrides the \-u and \-U options, so that display of carriage returns can be controlled separate from that of backspaces and tabs. If not set, carriage return display is controlled by the \-u and \-U options. .IP "\-\-PROC-RETURN" If set, carriage returns are handled as if the \-U option were set; that is carriage returns are treated as control characters. .IP "\-\-proc-tab" If set, tabs are handled as if the \-U option were not set. That is, tabs are expanded to spaces. This option overrides the \-U option, so that display of tabs can be controlled separate from that of backspaces and carriage returns. If not set, tab display is controlled by the \-U option. .IP "\-\-PROC-TAB" If set, tabs are handled as if the \-U option were set; that is tabs are treated as control characters. .IP "\-\-redraw-on-quit" When quitting, after sending the terminal deinitialization string, redraws the entire last screen. On terminals whose terminal deinitialization string causes the terminal to switch from an alternate screen, this makes the last screenful of the current file remain visible after .B less has quit. .IP "\-\-rscroll=\fIc\fP" This option changes the character used to mark truncated lines. It may begin with a two-character attribute indicator like LESSBINFMT does. If there is no attribute indicator, standout is used. If set to "\-", truncated lines are not marked. .IP "\-\-save-marks" Save marks in the history file, so marks are retained across different invocations of .BR less . .IP "\-\-search-options=\fI...\fP" 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 beginning of every search pattern. For example, setting \-\-search-options=W is the same as typing \(haW at the beginning of every pattern. The value may also contain a digit between 1 and 5, which has the same effect as typing \(haS followed by that digit at the beginning of every search pattern. The value "-" disables all default search modifiers. .IP "\-\-show-preproc-errors" If a preprocessor produces data, then exits with a non-zero exit code, .B less will display a warning. .IP "\-\-status-col-width=\fIn\fP" Sets the width of the status column when the \-J option is in effect. The default is 2 characters. .IP "\-\-status-line" If a line is marked, the entire line (rather than just the status column) is highlighted. Also lines highlighted due to the \-w option will have the entire line highlighted. If \-\-use-color is set, the line is colored rather than highlighted. .IP "\-\-use-backslash" This option changes the interpretations of options which follow this one. After the \-\-use-backslash option, 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 strings. .IP "\-\-use-color" Enables colored text in various places. The \-D option can be used to change the colors. Colored text works only if the terminal supports ANSI color escape sequences (as defined in .UR https://www.ecma-international.org/publications-and-standards/standards/ecma-48 .UE ). .IP "\-\-wheel-lines=\fIn\fP" Set the number of lines to scroll when the mouse wheel is scrolled and the \-\-mouse or \-\-MOUSE option is in effect. The default is 1 line. .IP "\-\-wordwrap" When the \-S option 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. .IP \-\- A command line argument of "\-\-" marks the end of option arguments. Any arguments following this are interpreted as filenames. This can be useful when viewing a file whose name begins with a "\-" or "+". .IP + If a command line option begins with \fB+\fP, the remainder of that option is taken to be an initial command to .BR less . For example, +G tells .B less to 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, + acts like +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 described previously may also be used to set (or change) an initial command for every file. . .SH "LINE EDITING" 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 \(haV or \(haA. A backslash itself may also be entered literally by entering two backslashes. .IP "LEFTARROW [ ESC-h ]" Move the cursor one space to the left. .IP "RIGHTARROW [ ESC-l ]" Move the cursor one space to the right. .IP "\(haLEFTARROW [ ESC-b or ESC-LEFTARROW ]" (That is, CONTROL and LEFTARROW simultaneously.) Move the cursor one word to the left. .IP "\(haRIGHTARROW [ ESC-w or ESC-RIGHTARROW ]" (That is, CONTROL and RIGHTARROW simultaneously.) Move the cursor one word to the right. .IP "HOME [ ESC-0 ]" Move the cursor to the beginning of the line. .IP "END [ ESC-$ ]" Move the cursor to the end of the line. .IP "BACKSPACE" Delete the character to the left of the cursor, or cancel the command if the command line is empty. .IP "DELETE or [ ESC-x ]" Delete the character under the cursor. .IP "\(haBACKSPACE [ ESC-BACKSPACE ]" (That is, CONTROL and BACKSPACE simultaneously.) Delete the word to the left of the cursor. .IP "\(haDELETE [ ESC-X or ESC-DELETE ]" (That is, CONTROL and DELETE simultaneously.) Delete the word under the cursor. .IP "UPARROW [ ESC-k ]" Retrieve the previous command line. If you first enter some text and then press UPARROW, it will retrieve the previous command which begins with that text. .IP "DOWNARROW [ ESC-j ]" 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. .IP "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 systems, a "\e" is appended.) The environment variable LESSSEPARATOR can be used to specify a different character to append to a directory name. .IP "BACKTAB [ ESC-TAB ]" Like, TAB, but cycles in the reverse direction thru the matching filenames. .IP "\(haL" 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). .IP "\(haU (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 changed your line-kill character in Unix to something other than \(haU, that character is used instead of \(haU. .IP "\(haG" Delete the entire command line and return to the main prompt. . .SH "KEY BINDINGS" You may define your own .B less commands by creating a lesskey source file. This file specifies a set of command keys and an action associated with each key. You may also change the line-editing keys (see LINE EDITING), and set environment variables used by .BR less . See the .BR lesskey (1) manual page for details about the file format. .PP If the environment variable LESSKEYIN is set, .B less uses that as the name of the lesskey source file. Otherwise, .B less looks in a standard place for the lesskey source file: On Unix systems, .B less looks for a lesskey file called "$XDG_CONFIG_HOME/lesskey" or "$HOME/.config/lesskey" or "$HOME/.lesskey". On MS-DOS and Windows systems, .B less 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 directory specified in the PATH environment variable. On OS/2 systems, .B less looks 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. .PP 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, .B less uses that as the name of the system-wide lesskey file. Otherwise, .B less looks in a standard place for the system-wide lesskey file: On Unix systems, the system-wide lesskey file is /usr/local/etc/syslesskey. (However, if .B less was built with a different 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:\e_syslesskey. On OS/2 systems, the system-wide lesskey file is c:\esyslesskey.ini. .PP Older versions of .B less (before v582) used lesskey files with a binary format, produced by the .B lesskey program. It is no longer necessary to use the .B lesskey program. . .SH "INPUT PREPROCESSOR" You may define an "input preprocessor" for .BR less . Before .B less opens 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 simply an executable program (or shell script), which writes the contents of the file to a different file, called the replacement file. The contents of the replacement file are then displayed in place of the contents of the original file. However, it will appear to the user as if the original file is opened; that is, .B less will display the original filename as the name of the current file. .PP 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 replacement filename, .B less uses the original file, as normal. The input preprocessor is not called when viewing standard input. To set up an input 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 replaced by the filename when the input preprocessor command is invoked. .PP When .B less closes a file opened in such a way, it will call another program, 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 original 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 replaced with the original name of the file and the second with the name of the replacement file, which was output by LESSOPEN. .PP For example, on many Unix systems, these two scripts will allow you to keep files in compressed format, but still let .B less view them directly: .PP lessopen.sh: .br #! /bin/sh .br case "$1" in .br *.Z) TEMPFILE=$(mktemp) .br uncompress \-c $1 >$TEMPFILE 2>/dev/null .br if [ \-s $TEMPFILE ]; then .br echo $TEMPFILE .br else .br rm \-f $TEMPFILE .br fi .br ;; .br esac .PP lessclose.sh: .br #! /bin/sh .br rm $2 .PP 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 types of compressed files, and so on. .PP It is also possible to set up an input preprocessor to pipe the file data directly to .BR less , rather than putting the data into a replacement file. This avoids the need to decompress the entire file before starting 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 replacement file on its standard output, writes the entire contents of the replacement file on its standard output. If the input pipe does not write any characters on its standard output, then there is no replacement file and .B less uses 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. .PP For example, on many Unix systems, this script will work like the previous example scripts: .PP lesspipe.sh: .br #! /bin/sh .br case "$1" in .br *.Z) uncompress \-c $1 2>/dev/null .br ;; .br *) exit 1 .br ;; .br esac .br exit $? .br .PP To use this script, put it where it can be executed and set LESSOPEN="|lesspipe.sh %s". .PP Note that a preprocessor cannot output an empty file, since that is interpreted 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 compatibility with previous versions of .BR less , if LESSOPEN starts with only one vertical bar, the exit status of the preprocessor is ignored. .PP 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 postprocessor is "\-". .PP For compatibility with previous versions of .BR less , the input preprocessor or pipe is not used if .B less is 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 standard input is being viewed, the input preprocessor is passed a file name consisting of a single dash. Similarly, if the first two characters 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. . .SH "NATIONAL CHARACTER SETS" There are three types of characters in the input file: .IP "normal characters" can be displayed directly to the screen. .IP "control characters" should not be displayed directly, but are expected to be found in ordinary text files (such as backspace and tab). .IP "binary characters" should not be displayed directly and are not expected to be found in text files. .PP A "character set" is simply a description of which characters are to be considered normal, control, and binary. The LESSCHARSET environment variable may be used to select a character set. Possible values for LESSCHARSET are: .IP 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. .IP iso8859 Selects an ISO 8859 character set. This is the same as ASCII, except characters between 160 and 255 are treated as normal characters. .IP latin1 Same as iso8859. .IP latin9 Same as iso8859. .IP dos Selects a character set appropriate for MS-DOS. .IP ebcdic Selects an EBCDIC character set. .IP IBM-1047 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. .IP koi8-r Selects a Russian character set. .IP next Selects a character set appropriate for NeXT computers. .IP 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 multi-byte characters. .IP windows Selects a character set appropriate for Microsoft Windows (cp 1252). .PP In rare cases, it may be desired to tailor .B less to use a character set other than the ones definable by LESSCHARSET. In this case, the environment 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 number 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 binary, 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 set.) .PP This table shows the value of LESSCHARDEF which is equivalent to each of the possible values for LESSCHARSET: . .RS 5m .TS l l. ascii 8bcccbcc18b95.b dos 8bcccbcc12bc5b95.b. ebcdic 5bc6bcc7bcc41b.9b7.9b5.b..8b6.10b6.b9.7b 9.8b8.17b3.3b9.7b9.8b8.6b10.b.b.b. IBM-1047 4cbcbc3b9cbccbccbb4c6bcc5b3cbbc4bc4bccbc 191.b iso8859 8bcccbcc18b95.33b. koi8-r 8bcccbcc18b95.b128. latin1 8bcccbcc18b95.33b. next 8bcccbcc18b95.bb125.bb .TE .RE .PP 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. .PP If that string is not found, but your system supports the .B setlocale interface, .B less will use setlocale to determine the character set. setlocale is controlled by setting the LANG or LC_CTYPE environment variables. .PP Finally, if the .I setlocale interface is also not available, the default character set is utf-8. .PP Control and binary characters are displayed in standout (reverse video). Each such character is displayed in caret notation if possible (e.g.\& \(haA for control-A). Caret notation is used only if inverting the 0100 bit results in a normal printable character. Otherwise, the character 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 result of expanding the character via LESSBINFMT must be less than 31 characters. .PP 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., unassigned code points). Its default value is "". 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. .PP 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 control characters, but if you are using a custom font with printable characters in that range, it may be desirable to tell .B less to treat such characters as printable. This can be done by setting the LESSUTFCHARDEF environment variable to a comma-separated list of .I "character type" definitions. Each character type definition consists of either one hexadecimal codepoint or a pair of codepoints separated by a dash, followed by a colon and a type character. Each hexadecimal codepoint may optionally be preceded by a "U" or "U+". If a pair of codepoints is given, the type is set for all characters inclusively between the two values. If there are multiple comma-separated codepoint values, they must be in ascending numerical order. The type character may be one of: .RS .IP "p" A normal printable character. .IP "w" A wide (2-space) printable character. .IP "b" A binary (non-printable) character. .IP "c" A composing (zero width) character. .RE .PP For example, setting LESSUTFCHARDEF to .nf .sp E000-F8FF:p,F0000-FFFFD:p,100000-10FFFD:p .sp .fi would make all Private Use Area characters be treated as printable. .SH "PROMPTS" The \-P option allows you to tailor the prompt to your preference. The string given to the \-P option replaces the specified prompt string. Certain characters in the string are interpreted specially. The prompt mechanism is rather complicated to provide flexibility, but the ordinary user need not understand the details of constructing personalized prompt strings. .sp 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.) .IP "%b\fIX\fP" Replaced by the byte offset into the current input file. The b is followed by a single character (shown as \fIX\fP above) which specifies the line whose byte offset is to be used. If the character 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 bottom line, a "B" means use the line just after the bottom line, and a "j" means use the "target" line, as specified by the \-j option. .IP "%B" Replaced by the size of the current input file. .IP "%c" Replaced by the column number of the text appearing in the first column of the screen. .IP "%d\fIX\fP" Replaced by the page number of a line in the input file. The line to be used is determined by the \fIX\fP, as with the %b option. .IP "%D" Replaced by the number of pages in the input file, or equivalently, the page number of the last line in the input file. .IP "%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. .IP "%f" Replaced by the name of the current input file. .IP "%F" Replaced by the last component of the name of the current input file. .IP "%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. .IP "%i" Replaced by the index of the current file in the list of input files. .IP "%l\fIX\fP" Replaced by the line number of a line in the input file. The line to be used is determined by the \fIX\fP, as with the %b option. .IP "%L" Replaced by the line number of the last line in the input file. .IP "%m" Replaced by the total number of input files. .IP "%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 \(haO\(haO command description. .IP "%p\fIX\fP" Replaced by the percent into the current input file, based on byte offsets. The line used is determined by the \fIX\fP as with the %b option. .IP "%P\fIX\fP" Replaced by the percent into the current input file, based on line numbers. The line used is determined by the \fIX\fP as with the %b option. .IP "%s" Same as %B. .IP "%t" Causes any trailing spaces to be removed. Usually used at the end of the string, but may appear anywhere. .IP "%T" Normally expands to the word "file". However if viewing files via a tags list using the \-t option, it expands to the word "tag". .IP "%x" Replaced by the name of the next input file in the list. .PP If any item is unknown (for example, the file size if input is a pipe), a question mark is printed instead. .PP 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 evaluated. 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. Condition characters (which follow a question mark) may be: .IP "?a" True if any characters have been included in the prompt so far. .IP "?b\fIX\fP" True if the byte offset of the specified line is known. .IP "?B" True if the size of current input file is known. .IP "?c" True if the text is horizontally shifted (%c is not zero). .IP "?d\fIX\fP" True if the page number of the specified line is known. .IP "?e" True if at end-of-file. .IP "?f" True if there is an input filename (that is, if input is not a pipe). .IP "?l\fIX\fP" True if the line number of the specified line is known. .IP "?L" True if the line number of the last line in the file is known. .IP "?m" True if there is more than one input file. .IP "?n" True if this is the first prompt in a new input file. .IP "?p\fIX\fP" True if the percent into the current input file, based on byte offsets, of the specified line is known. .IP "?P\fIX\fP" True if the percent into the current input file, based on line numbers, of the specified line is known. .IP "?s" Same as "?B". .IP "?x" True if there is a next input file (that is, if the current input file is not the last one). .PP Any characters other than the special ones (question mark, colon, period, 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. .PP Some examples: .sp ?f%f:Standard input. .sp This prompt prints the filename, if known; otherwise the string "Standard input". .sp ?f%f \&.?ltLine %lt:?pt%pt\e%:?btByte %bt:-... .sp This prompt would print the filename, if known. The filename is followed by the line number, if known, otherwise the percent if known, otherwise the byte offset if known. Otherwise, a dash is printed. Notice how each question mark has a matching period, and how the % after the %pt is included literally by escaping it with a backslash. .sp ?n?f%f\ .?m(%T %i of %m)\ ..?e(END)\ ?x-\ Next\e:\ %x..%t .sp This prints the filename if this is the first prompt in a file, followed 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 reference, here are the defaults for the other two prompts (\-m and \-M respectively). Each is broken into two lines here for readability only. .nf .sp ?n?f%f\ .?m(%T\ %i\ of\ %m)\ ..?e(END)\ ?x-\ Next\e:\ %x.: ?pB%pB\e%:byte\ %bB?s/%s...%t .sp ?f%f\ .?n?m(%T\ %i\ of\ %m)\ ..?ltlines\ %lt-%lb?L/%L.\ : byte\ %bB?s/%s.\ .?e(END)\ ?x-\ Next\e:\ %x.:?pB%pB\e%..%t .sp .fi And here is the default message produced by the = command: .nf .sp ?f%f\ .?m(%T\ %i\ of\ %m)\ .?ltlines\ %lt-%lb?L/%L.\ . byte\ %bB?s/%s.\ ?e(END)\ :?pB%pB\e%..%t .fi .PP 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 expanded in the same way as the prompt strings. The default value for LESSEDIT is: .nf .sp %E\ ?lm+%lm.\ %g .sp .fi 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 invocation syntax, the LESSEDIT variable can be changed to modify this default. . .SH SECURITY When the environment variable LESSSECURE is set to 1, .B less runs in a "secure" mode. In this mode, these features are disabled: .IP "edit" 10 the edit command (v) .IP "examine" the examine command (:e) .IP "glob" metacharacters such as * in filenames, .br and filename completion (TAB, \(haL) .IP "history" history file .IP "lesskey" use of lesskey files (-k and \-\-lesskey-src) .IP "lessopen" input preprocessor (LESSOPEN environment variable) .IP "logfile" log files (s and \-o) .IP "osc8" opening OSC 8 links (\(haO\(haO) .IP "pipe" the pipe command (|) .IP "shell" the shell and pshell commands (! and #) .IP "stop" stopping .B less via a SIGTSTP signal .IP "tags" use of tags files (-t) .PP The LESSSECURE_ALLOW environment variable can be set to a comma-separated 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 abbreviation is unambiguous. For example, if .nh LESSSECURE=1 .hy and .nh LESSSECURE_ALLOW=hist,edit .hy were set, all of the above features would be disabled except for history files and the edit command. .PP Less can also be compiled to be permanently in "secure" mode. In that case, the LESSSECURE and LESSSECURE_ALLOW variables are ignored. . .SH "COMPATIBILITY WITH MORE" 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 LESS_IS_MORE is not set to 0, .B less behaves (mostly) in conformance with the POSIX .BR more (1) command specification. In this mode, less behaves differently in these ways: .PP The \-e option works differently. If the \-e option is not set, .B less behaves as if the \-e option were set. If the \-e option is set, .B less behaves as if the \-E option were set. .PP The \-m option works differently. If the \-m option is not set, the medium prompt is used, and it is prefixed with the string "\-\-More\-\-". If the \-m option is set, the short prompt is used. .PP The \-n option acts like the \-z option. The normal behavior of the \-n option is unavailable in this mode. .PP The parameter to the \-p option is taken to be a .B less command rather than a search pattern. .PP The LESS environment variable is ignored, and the MORE environment variable is used in its place. . .SH "ENVIRONMENT VARIABLES" Environment variables may be specified either in the system environment as usual, or in a .BR lesskey (1) file. If environment variables are defined 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. .IP COLUMNS Sets the number of columns on the screen. Takes precedence over 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 precedence over the LINES and COLUMNS environment variables.) .IP EDITOR The name of the editor (used for the v command). .IP HOME Name of the user's home directory (used to find a lesskey file on Unix and OS/2 systems). .IP "HOMEDRIVE, HOMEPATH" Concatenation of the HOMEDRIVE and HOMEPATH environment variables is the name of the user's home directory if the HOME variable is not set (only in the Windows version). .IP INIT Name of the user's init directory (used to find a lesskey file on OS/2 systems). .IP LANG Language for determining the character set. .IP LC_CTYPE Language for determining the character set. .IP LESS Options which are passed to .B less automatically. .IP LESSANSIENDCHARS Characters which may end an ANSI color escape sequence (default "m"). .IP LESSANSIMIDCHARS Characters which may appear between the ESC character and the end character in an ANSI color escape sequence (default "0123456789:;[?!"\(aq#%()*+\ "). .IP LESSANSIOSCALLOW A comma-separated list of OSC types which are output directly to the terminal when \-R is in effect. By default, only OSC 8 sequences are output directly. .IP 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, sequences 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. .IP LESSBINFMT Format for displaying non-printable, non-control characters. .IP LESSCHARDEF Defines a character set. .IP LESSCHARSET Selects a predefined character set. .IP LESSCLOSE Command line to invoke the (optional) input-postprocessor. .IP LESSECHO Name of the lessecho program (default "lessecho"). The lessecho program is needed to expand metacharacters, such as * and ?, in filenames on Unix systems. .IP LESSEDIT Editor prototype string (used for the v command). See discussion under PROMPTS. .IP LESSGLOBALTAGS Name of the command used by the \-t option to find global tags. Normally should be set to "global" if your system has the .BR global (1) command. If not set, global tags are not used. .IP LESSHISTFILE Name of the history file used to remember search commands and shell commands between invocations of .BR less . If set to "\-" or "/dev/null", a history file is not used. The default depends on the operating system, but is usually: .RS .IP "Linux and Unix" "$XDG_STATE_HOME/lesshst" or "$HOME/.local/state/lesshst" or "$XDG_DATA_HOME/lesshst" or "$HOME/.lesshst". .IP "Windows and MS-DOS" "$HOME/_lesshst". .IP "OS/2" "$HOME/lesshst.ini" or "$INIT/lesshst.ini". .RE .IP LESSHISTSIZE The maximum number of commands to save in the history file. The default is 100. .IP LESSKEYIN Name of the default .I "lesskey source" file. .IP LESSKEY Name of the default .I "lesskey binary" file. (Not used if "$LESSKEYIN" exists.) .IP LESSKEY_CONTENT The value is parsed as if it were the parameter of a \-\-lesskey-content option. .IP LESSKEYIN_SYSTEM Name of the default system-wide .I "lesskey source" file. .IP LESSKEY_SYSTEM Name of the default system-wide .I "lesskey binary" file. (Not used if "$LESSKEYIN_SYSTEM" exists.) .IP LESSMETACHARS List of characters which are considered "metacharacters" by the shell. .IP LESSMETAESCAPE Prefix which less will add before each metacharacter in a command sent to the shell. If LESSMETAESCAPE is an empty string, commands containing metacharacters will not be passed to the shell. .IP LESSOPEN Command line to invoke the (optional) input-preprocessor. .IP LESSSECURE Runs less in "secure" mode. See discussion under SECURITY. .IP LESSSECURE_ALLOW Enables individual features which are normally disabled by LESSSECURE. See discussion under SECURITY. .IP LESSSEPARATOR String to be appended to a directory name in filename completion. .IP LESSUTFBINFMT Format for displaying non-printable Unicode code points. .IP LESSUTFCHARDEF Overrides the type of specified Unicode characters. .IP 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 .B less use 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. .IP 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 .B less use 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, .B less repaints the entire screen on every movement command, so scrolling may be slower. .IP LESS_DATA_DELAY Duration (in milliseconds) after starting to read data from the input, after which the "Waiting for data" message will be displayed. The default is 4000 (4 seconds). .IP LESS_IS_MORE Emulate the .BR more (1) command. .IP LESS_OSC8_xxx 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. .IP LESS_OSC8_ANY Sets an OSC 8 handler for opening OSC 8 links for which there is no specific LESS_OSC8_xxx handler set for the "xxx" scheme. .IP LESS_SHELL_LINES When the \-F option is set, .B less exits automatically if the number 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 \-F is used. If not set, LESS_SHELL_LINES is assumed to be 1. .IP LESS_SIGUSR1 If set to a string of one or more .B less command characters, those commands will be executed when .B less receives a SIGUSR1 signal. .IP LESS_TERMCAP_xx Where "xx" is any two characters, overrides the definition of the termcap "xx" capability for the terminal. .IP LESS_UNSUPPORT 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 listed in LESS_UNSUPPORT can still be changed by the \- and \-\- commands. Each option in LESS_UNSUPPORT is a dash followed by a single character option letter, or two dashes followed by a long option name. .IP 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 over the LINES and COLUMNS environment variables.) .IP MORE Options which are passed to .B less automatically when running in .BR more "-compatible mode." .IP PATH User's search path (used to find a lesskey file on MS-DOS, Windows, and OS/2 systems). .IP SHELL The shell used to execute the !\& command, as well as to expand filenames. .IP TERM The type of terminal on which .B less is being run. .IP VISUAL The name of the editor (used for the v command). .IP XDG_CONFIG_HOME Possible location of the .B lesskey file; see the KEY BINDINGS section. .IP XDG_DATA_HOME Possible location of the history file; see the description of the LESSHISTFILE environment variable. .IP XDG_STATE_HOME Possible location of the history file; see the description of the LESSHISTFILE environment variable. . .SH "SEE ALSO" .BR lesskey (1), .BR lessecho (1) . .SH COPYRIGHT Copyright (C) 1984-2025 Mark Nudelman .PP less is part of the GNU project and is free software. You can redistribute it and/or modify it under the terms of either (1) the GNU General 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 have received a copy of the Less License; see the file LICENSE. .PP less is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . .SH AUTHOR . Mark Nudelman .br Report bugs at .UR https://github.com/gwsw/less/issues .UE . .br For more information, see the less homepage at .br .UR https://greenwoodsoftware.com/less .UE . diff --git a/contrib/less/lessecho.nro b/contrib/less/lessecho.nro index 696fcb13b214..f0cccc4de6da 100644 --- a/contrib/less/lessecho.nro +++ b/contrib/less/lessecho.nro @@ -1,58 +1,58 @@ -.TH LESSECHO 1 "Version 678: 01 May 2025" +.TH LESSECHO 1 "Version 679: 28 May 2025" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS .B lessecho .I "[-ox] [-cx] [-pn] [-dn] [-mx] [-nn] [-ex] [-a] file ..." .SH "DESCRIPTION" .B lessecho is a program that simply echos its arguments on standard output. But any metacharacter in the output is preceded by an "escape" character, which by default is a backslash. .B lessecho is invoked internally by .BR less , and is not intended to be used directly by humans. .SH OPTIONS A summary of options is included below. .TP .B \-e\fIx\fP Specifies "\fIx\fP", rather than backslash, to be the escape char for metachars. If \fIx\fP is "-", no escape char is used and arguments containing metachars are surrounded by quotes instead. .TP .B \-o\fIx\fP Specifies "\fIx\fP", rather than double-quote, to be the open quote character, which is used if the \-e- option is specified. .TP .B \-c\fIx\fP Specifies "\fIx\fP" to be the close quote character. .TP .B \-p\fIn\fP Specifies "\fIn\fP" to be the open quote character, as an integer. .TP .B \-d\fIn\fP Specifies "\fIn\fP" to be the close quote character, as an integer. .TP .B \-m\fIx\fP Specifies "\fIx\fP" to be a metachar. By default, no characters are considered metachars. .TP .B \-n\fIn\fP Specifies "\fIn\fP" to be a metachar, as an integer. .TP .B \-f\fIn\fP Specifies "\fIn\fP" to be the escape char for metachars, as an integer. .TP .B \-a Specifies that all arguments are to be quoted. The default is that only arguments containing metacharacters are quoted. .SH "SEE ALSO" .BR less (1) .SH AUTHOR This manual page was written by Thomas Schoepf , for the Debian GNU/Linux system (but may be used by others). .PP Report bugs at .UR https://github.com/gwsw/less/issues .UE . diff --git a/contrib/less/lesskey.nro b/contrib/less/lesskey.nro index 61ba056b04c6..0a17c9deff71 100644 --- a/contrib/less/lesskey.nro +++ b/contrib/less/lesskey.nro @@ -1,491 +1,491 @@ '\" t -.TH LESSKEY 1 "Version 678: 01 May 2025" +.TH LESSKEY 1 "Version 679: 28 May 2025" .SH NAME lesskey \- customize key bindings for less .SH "SYNOPSIS (deprecated)" .B "lesskey [\-o output] [\-\-] [input]" .br .B "lesskey [\-\-output=output] [\-\-] [input]" .br .B "lesskey \-V" .br .B "lesskey \-\-version" .SH SCOPE This document describes the format of the .B lesskey source file, which is used by .B less version 582 and later. In previous versions of .BR less , a separate program called .B lesskey was used to compile the .B lesskey source file into a format understood by .BR less . This compilation step is no longer required and the .B lesskey program is therefore deprecated, although the file format remains supported by .B less itself. .PP .SH DESCRIPTION A .B lesskey file specifies a set of key bindings and environment variables to be used by subsequent invocations of .BR less . .SH FILE FORMAT The input file consists of one or more .IR sections . Each section starts with a line that identifies the type of section. Possible sections are: .IP #command Customizes command key bindings. .IP #line-edit Customizes line-editing key bindings. .IP #env Defines environment variables. .PP Blank lines are ignored. Any text that follows an unescaped hash mark (#) in a line is ignored, except as noted below. . .SH "COMMAND SECTION" The command section begins with the line .sp #command .sp If the command section is the first section in the file, this line may be omitted. The command section consists of lines of the form: .sp \fIstring\fP \fIaction\fP [extra-string] .sp Whitespace is any sequence of one or more spaces and/or tabs. The \fIstring\fP is the command key(s) which invoke the action. The \fIstring\fP may be a single command key, or a sequence of up to 15 keys. The \fIaction\fP is the name of the less action, from the lists in the EXAMPLE sections below. The characters in the \fIstring\fP may appear literally, or be prefixed by a caret to indicate a control key. A backslash followed by one to three octal digits may be used to specify a character by its octal value. A backslash followed by certain characters specifies input characters as follows: .RS 5m .TS l l l. \eb BACKSPACE (0x08) \ee ESCAPE (0x1B) \en NEWLINE (0x0A) \er RETURN (0x0D) \et TAB (0x09) .TE .sp \ek followed by a single character represents the char(s) produced when one of these keys is pressed: .TS l l. \ekb BACKSPACE (the BACKSPACE key) \ekB ctrl-BACKSPACE \ekd DOWN ARROW \ekD PAGE DOWN \eke END \ekh HOME \eki INSERT \ekl LEFT ARROW \ekL ctrl-LEFT ARROW \ekr RIGHT ARROW \ekR ctrl-RIGHT ARROW \ekt BACKTAB \eku UP ARROW \ekU PAGE UP \ekx DELETE \ekX ctrl-DELETE \ek1 F1 .TE .PP A backslash followed by any other character indicates that character is to be taken literally. Characters which must be preceded by backslash include caret, space, tab, hash mark and the backslash itself. .PP An action may be followed by an "extra" string. When such a command is entered while running .BR less , the action is performed, and then the extra string is parsed, just as if it were typed in to .BR less . This feature can be used in certain cases to extend the functionality of a command. For example, see the "{" and ":t" commands in the example below. The extra string has a special meaning for the "quit" action: when .B less quits, the ASCII value of the first character of the extra string is used as its exit status. . .SH EXAMPLE The following input file describes the set of default command keys used by .BR less . Documentation on each command can be found in the .B less man page, under the key sequence which invokes the command. .sp .RS 5m .TS l l. #command \er forw-line \en forw-line e forw-line j forw-line \ekd forw-line ^E forw-line ^N forw-line k back-line y back-line ^Y back-line ^K back-line ^P 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 ^U back-scroll \e40 forw-screen f forw-screen ^F forw-screen ^V forw-screen \ekD forw-screen b back-screen ^B back-screen \eev back-screen \ekU back-screen z forw-window w back-window \ee\e40 forw-screen-force \eeb back-screen-force F forw-forever \eeF forw-until-hilite R repaint-flush r repaint ^R repaint ^L repaint \eeu undo-hilite \eeU clear-search g goto-line \ekh goto-line < 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 { forw-bracket {} } back-bracket {} ( forw-bracket () ) back-bracket () [ forw-bracket [] ] back-bracket [] \ee^F forw-bracket \ee^B back-bracket G goto-end \ee> goto-end > goto-end \eke goto-end \eeG goto-end-buffered \&= status ^G status :f status / forw-search ? back-search \ee/ forw-search * \ee? back-search * 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 \eem clear-mark \&' goto-mark ^X^X goto-mark E examine :e examine ^X^V examine :n next-file :p prev-file t next-tag T prev-tag :x index-file :d remove-file - toggle-option :t toggle-option t s toggle-option o ## Use a long option name by starting the ## 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 H help h help V version 0 digit 1 digit 2 digit 3 digit 4 digit 5 digit 6 digit 7 digit 8 digit 9 digit q quit Q quit :q quit :Q quit ZZ quit .TE .RE .sp .SH PRECEDENCE Commands specified by .B lesskey take precedence over the default commands. A default command key may be disabled by including it in the input file with the action "invalid". Alternatively, a key may be defined to do nothing by using the action "noaction". "noaction" is similar to "invalid", but .B less will give an error beep for an "invalid" command, but not for a "noaction" command. In addition, ALL default commands may be disabled by adding this control line to the input file: .sp #stop .sp This will cause all default commands to be ignored. The #stop line should be the last line in that section of the file. .PP Be aware that #stop can be dangerous. Since all default commands are disabled, you must provide sufficient commands before the #stop line to enable all necessary actions. For example, failure to provide a "quit" command can lead to frustration. . .SH "LINE EDITING SECTION" The line-editing section begins with the line: .sp #line-edit .sp This section specifies new key bindings for the line editing commands, in a manner similar to the way key bindings for ordinary commands are specified in the #command section. The line-editing section consists of a list of keys and actions, one per line as in the example below. . .SH EXAMPLE The following input file describes the set of default line-editing keys used by .BR less : .sp .RS 5m .TS l l. #line-edit \et forw-complete \e17 back-complete \ee\et back-complete ^L expand ^V literal ^A literal \eel right \ekr right \eeh left \ekl left \eeb word-left \ee\ekl word-left \eew word-right \ee\ekr word-right \eei insert \eex delete \ekx delete \eeX word-delete \eekx word-delete \ee\eb word-backspace \ee0 home \ekh home \ee$ end \eke end \eek up \eku up \eej down ^G abort \ee[M mouse \ee[< mouse6 .TE .RE .sp . .SH "LESS ENVIRONMENT VARIABLES" The environment variable section begins with the line .sp #env .sp Following this line is a list of environment variable assignments. Each line consists of an environment variable name, an equals sign (=) and the value to be assigned to the environment variable. White space before and after the equals sign is ignored. Variables assigned in this way are visible only to .BR less . If a variable is specified in the system environment and also in a lesskey file, the value in the lesskey file takes precedence. . .sp If the variable name is followed by += rather than =, the string is appended to the variable's existing value. This currently works only if any += lines immediately follow the same variable's original definition (with an = line), without any intervening definitions of other variables. It can append only to a variable defined earlier in the file; it cannot append to a variable in the system environment. The string is appended literally, without any extra whitespace added, so if whitespace is desired, it should be appended to the end of the preceding line. (It cannot be added to the beginning of the += string because space after the equals sign is ignored, as noted above.) . .sp In the string after the = sign, a substring of the form ${NAME} is replaced with the value of the environment variable "NAME". The value of the variable may come from either the system environment, an earlier lesskey file, or an earlier definition in the current lesskey file. Simple text replacements can be performed by using the syntax ${NAME/STRING/REPL}. This replaces all instances of "STRING" in the named environment variable with the text "REPL". STRING is matched using a simple text comparison; no metacharacters are supported. An instance of slash or right curly bracket in STRING or REPL must be escaped by preceding it with \fItwo\fP backslashes. If REPL is an empty string, all instances of STRING are removed. A slash immediately before the right curly bracket may be omitted. Multiple replacements may be performed by using the syntax ${NAME/STRING1/REPL1/STRING2/REPL2} and so on. . .SH CONDITIONAL CONFIGURATION If a line begins with #version followed by a relational operator and a version number, the remainder of the line is parsed if and only if the running version of .B less (or .BR lesskey ) matches the operator. This can be helpful if a lesskey file is used by different versions of .BR less . .sp For example, suppose that a new command named 'sideways-search' is added in .B less version 777. Then the following line would assign the command to the Q key, but only in versions of .B less which support it. The line would be ignored by versions earlier than 777. .sp .nf #version >= 777 Q sideways-search .fi .sp These six operators are supported: .RS 5m .TS l l. > Greater than < Less than >= Greater than or equal to <= Less than or equal to = Equal to != Not equal to .TE .RE .sp The #version feature is not supported in .B less and .B lesskey before version 594. In those older versions, all #version lines are ignored. . .SH EXAMPLE The following input file sets the \-i and \-S options when .B less is run and, on version 595 and higher, adds a \-\-color option. .sp .nf #env ## (Note that there must be a space at the end of the next line, ## to separate the --color option from the -S option.) LESS = \-i\ \-S\ #version\ >=\ 595\ \ LESS\ +=\ \-\-color=Hkc .fi . .SH "SEE ALSO" .BR less (1) . .SH WARNINGS On MS-DOS and OS/2 systems, certain keys send a sequence of characters 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 .PP less is part of the GNU project and is free software. You can redistribute it and/or modify it under the terms of either (1) the GNU General 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 have received a copy of the Less License; see the file LICENSE. .PP less is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . .SH AUTHOR . Mark Nudelman .br Report bugs at .UR https://github.com/gwsw/less/issues .UE . diff --git a/contrib/less/os.c b/contrib/less/os.c index 98a7ecf70c3c..357cbb356a16 100644 --- a/contrib/less/os.c +++ b/contrib/less/os.c @@ -1,566 +1,566 @@ /* * Copyright (C) 1984-2025 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. */ /* * Operating system dependent routines. * * Most of the stuff in here is based on Unix, but an attempt * has been made to make things work on other operating systems. * This will sometimes result in a loss of functionality, unless * someone rewrites code specifically for the new operating system. * * The makefile provides defines to decide whether various * Unix features are present. */ #include "less.h" #include #include #if MSDOS_COMPILER==WIN32C #include #endif #if HAVE_TIME_H #include #endif #if HAVE_ERRNO_H #include #endif #if MUST_DEFINE_ERRNO extern int errno; #endif #if HAVE_VALUES_H #include #endif #if defined(__APPLE__) #include #endif #if HAVE_POLL && !MSDOS_COMPILER #define USE_POLL 1 static lbool use_poll = TRUE; #else #define USE_POLL 0 #endif #if USE_POLL #include static lbool any_data = FALSE; #endif /* * BSD setjmp() saves (and longjmp() restores) the signal mask. * This costs a system call or two per setjmp(), so if possible we clear the * signal mask with sigsetmask(), and use _setjmp()/_longjmp() instead. * On other systems, setjmp() doesn't affect the signal mask and so * _setjmp() does not exist; we just use setjmp(). */ #if HAVE_SIGSETJMP #define SET_JUMP(label) sigsetjmp(label, 1) #define LONG_JUMP(label, val) siglongjmp(label, val) #define JUMP_BUF sigjmp_buf #else #if HAVE__SETJMP && HAVE_SIGSETMASK #define SET_JUMP(label) _setjmp(label) #define LONG_JUMP(label, val) _longjmp(label, val) #define JUMP_BUF jmp_buf #else #define SET_JUMP(label) setjmp(label) #define LONG_JUMP(label, val) longjmp(label, val) #define JUMP_BUF jmp_buf #endif #endif static lbool reading; static lbool opening; public lbool waiting_for_data; public int consecutive_nulls = 0; public lbool getting_one_screen = FALSE; /* Milliseconds to wait for data before displaying "waiting for data" message. */ static int waiting_for_data_delay = 4000; /* Max milliseconds expected to "normally" read and display a screen of text. */ public int screenfill_ms = 3000; static JUMP_BUF read_label; static JUMP_BUF open_label; extern int sigs; extern int ignore_eoi; extern int exit_F_on_close; extern int follow_mode; extern int scanning_eof; extern char intr_char; extern int is_tty; extern int quit_if_one_screen; extern int one_screen; #if HAVE_TIME extern time_type less_start_time; #endif #if !MSDOS_COMPILER extern int tty; #endif public void init_poll(void) { constant char *delay = lgetenv("LESS_DATA_DELAY"); int idelay = (delay == NULL) ? 0 : atoi(delay); if (idelay > 0) waiting_for_data_delay = idelay; delay = lgetenv("LESS_SCREENFILL_TIME"); idelay = (delay == NULL) ? 0 : atoi(delay); if (idelay > 0) screenfill_ms = idelay; #if USE_POLL #if defined(__APPLE__) /* In old versions of MacOS, poll() does not work with /dev/tty. */ struct utsname uts; if (uname(&uts) < 0 || lstrtoi(uts.release, NULL, 10) < 20) use_poll = FALSE; #endif #endif } #if USE_POLL /* * Check whether data is available, either from a file/pipe or from the tty. * Return READ_AGAIN if no data currently available, but caller should retry later. * Return READ_INTR to abort F command (forw_loop). * Return 0 if safe to read from fd. */ static int check_poll(int fd, int tty) { struct pollfd poller[2] = { { fd, POLLIN, 0 }, { tty, POLLIN, 0 } }; int timeout = (waiting_for_data && !(scanning_eof && follow_mode == FOLLOW_NAME)) ? -1 : (ignore_eoi && !waiting_for_data) ? 0 : waiting_for_data_delay; #if HAVE_TIME if (getting_one_screen && get_time() < less_start_time + screenfill_ms/1000) return (0); #endif if (!any_data) { /* * Don't do polling if no data has yet been received, * to allow a program piping data into less to have temporary * access to the tty (like sudo asking for a password). */ return (0); } poll(poller, 2, timeout); #if LESSTEST if (!is_lesstest()) /* Check for ^X only on a real tty. */ #endif /*LESSTEST*/ { if (poller[1].revents & POLLIN) { int ch = getchr(); if (ch < 0 || ch == intr_char) /* Break out of "waiting for data". */ return (READ_INTR); ungetcc_back((char) ch); return (READ_INTR); } } if (ignore_eoi && exit_F_on_close && (poller[0].revents & (POLLHUP|POLLIN)) == POLLHUP) /* Break out of F loop on HUP due to --exit-follow-on-close. */ return (READ_INTR); if ((poller[0].revents & (POLLIN|POLLHUP|POLLERR)) == 0) /* No data available; let caller take action, then try again. */ return (READ_AGAIN); /* There is data (or HUP/ERR) available. Safe to call read() without blocking. */ return (0); } #endif /* USE_POLL */ public int supports_ctrl_x(void) { #if MSDOS_COMPILER==WIN32C return (TRUE); #else #if USE_POLL return (use_poll); #else return (FALSE); #endif /* USE_POLL */ #endif /* MSDOS_COMPILER==WIN32C */ } /* * Like read() system call, but is deliberately interruptible. * A call to intio() from a signal handler will interrupt * any pending iread(). */ public ssize_t iread(int fd, unsigned char *buf, size_t len) { ssize_t n; start: #if MSDOS_COMPILER==WIN32C if (ABORT_SIGS()) return (READ_INTR); #else #if MSDOS_COMPILER && MSDOS_COMPILER != DJGPPC if (kbhit()) { int c; c = getch(); if (c == '\003') return (READ_INTR); ungetch(c); } #endif #endif if (!reading && SET_JUMP(read_label)) { /* * We jumped here from intio. */ reading = FALSE; #if HAVE_SIGPROCMASK { sigset_t mask; sigemptyset(&mask); sigprocmask(SIG_SETMASK, &mask, NULL); } #else #if HAVE_SIGSETMASK sigsetmask(0); #else #ifdef _OSK sigmask(~0); #endif #endif #endif #if !MSDOS_COMPILER if (fd != tty && !ABORT_SIGS()) /* Non-interrupt signal like SIGWINCH. */ return (READ_AGAIN); #endif return (READ_INTR); } flush(); reading = TRUE; #if MSDOS_COMPILER==DJGPPC if (isatty(fd)) { /* * Don't try reading from a TTY until a character is * available, because that makes some background programs * believe DOS is busy in a way that prevents those * programs from working while "less" waits. * {{ This code was added 12 Jan 2007; still needed? }} */ fd_set readfds; FD_ZERO(&readfds); FD_SET(fd, &readfds); if (select(fd+1, &readfds, 0, 0, 0) == -1) { reading = FALSE; return (READ_ERR); } } #endif #if USE_POLL if (is_tty && fd != tty && use_poll && !(quit_if_one_screen && one_screen)) { int ret = check_poll(fd, tty); if (ret != 0) { if (ret == READ_INTR) - sigs |= S_INTERRUPT; + sigs |= S_SWINTERRUPT; reading = FALSE; return (ret); } } #else #if MSDOS_COMPILER==WIN32C if (win32_kbhit2(TRUE)) { int c; c = WIN32getch(); - sigs |= S_INTERRUPT; + sigs |= S_SWINTERRUPT; reading = FALSE; if (c != CONTROL('C') && c != intr_char) WIN32ungetch((char) c); return (READ_INTR); } #endif #endif n = read(fd, buf, len); reading = FALSE; #if 0 /* * This is a kludge to workaround a problem on some systems * where terminating a remote tty connection causes read() to * start returning 0 forever, instead of -1. */ { if (!ignore_eoi) { if (n == 0) consecutive_nulls++; else consecutive_nulls = 0; if (consecutive_nulls > 20) quit(QUIT_ERROR); } } #endif if (n < 0) { #if HAVE_ERRNO /* * Certain values of errno indicate we should just retry the read. */ #ifdef EINTR if (errno == EINTR) goto start; #endif #ifdef EAGAIN if (errno == EAGAIN) goto start; #endif #endif return (READ_ERR); } #if USE_POLL if (fd != tty && n > 0) any_data = TRUE; #endif return (n); } /* * Like open() system call, but is interruptible. */ public int iopen(constant char *filename, int flags) { int r; while (!opening && SET_JUMP(open_label)) { opening = FALSE; - if (sigs & S_INTERRUPT) + if (sigs & (S_INTERRUPT|S_SWINTERRUPT)) { sigs = 0; #if HAVE_SETTABLE_ERRNO #ifdef EINTR errno = EINTR; #endif #endif return -1; } psignals(); /* Handle S_STOP or S_WINCH */ } opening = TRUE; r = open(filename, flags); opening = FALSE; return r; } /* * Interrupt a pending iopen() or iread(). */ public void intio(void) { if (opening) { LONG_JUMP(open_label, 1); } if (reading) { LONG_JUMP(read_label, 1); } } /* * Return the current time. */ #if HAVE_TIME public time_type get_time(void) { time_type t; time(&t); return (t); } #endif #if !HAVE_STRERROR /* * Local version of strerror, if not available from the system. */ static char * strerror(int err) { static char buf[INT_STRLEN_BOUND(int)+12]; #if HAVE_SYS_ERRLIST extern char *sys_errlist[]; extern int sys_nerr; if (err < sys_nerr) return sys_errlist[err]; #endif sprintf(buf, "Error %d", err); return buf; } #endif /* * errno_message: Return an error message based on the value of "errno". */ public char * errno_message(constant char *filename) { char *p; char *m; size_t len; #if HAVE_ERRNO p = strerror(errno); #else p = "cannot open"; #endif len = strlen(filename) + strlen(p) + 3; m = (char *) ecalloc(len, sizeof(char)); SNPRINTF2(m, len, "%s: %s", filename, p); return (m); } /* * Return a description of a signal. * The return value is good until the next call to this function. */ public constant char * signal_message(int sig) { static char sigbuf[sizeof("Signal ") + INT_STRLEN_BOUND(sig) + 1]; #if HAVE_STRSIGNAL constant char *description = strsignal(sig); if (description) return description; #endif sprintf(sigbuf, "Signal %d", sig); return sigbuf; } /* * Return (VAL * NUM) / DEN, where DEN is positive * and min(VAL, NUM) <= DEN so the result cannot overflow. * Round to the nearest integer, breaking ties by rounding to even. */ public uintmax umuldiv(uintmax val, uintmax num, uintmax den) { /* * Like round(val * (double) num / den), but without rounding error. * Overflow cannot occur, so there is no need for floating point. */ uintmax q = val / den; uintmax r = val % den; uintmax qnum = q * num; uintmax rnum = r * num; uintmax quot = qnum + rnum / den; uintmax rem = rnum % den; return quot + (den / 2 < rem + (quot & ~den & 1)); } /* * Return the ratio of two POSITIONS, as a percentage. * {{ Assumes a POSITION is a long int. }} */ public int percentage(POSITION num, POSITION den) { return (int) muldiv(num, 100, den); } /* * Return the specified percentage of a POSITION. * Assume (0 <= POS && 0 <= PERCENT <= 100 * && 0 <= FRACTION < (PERCENT == 100 ? 1 : NUM_FRAC_DENOM)), * so the result cannot overflow. Round to even. */ public POSITION percent_pos(POSITION pos, int percent, long fraction) { /* * Change from percent (parts per 100) * to pctden (parts per 100 * NUM_FRAC_DENOM). */ POSITION pctden = (percent * NUM_FRAC_DENOM) + fraction; return (POSITION) muldiv(pos, pctden, 100 * NUM_FRAC_DENOM); } #if !HAVE_STRCHR /* * strchr is used by regexp.c. */ char * strchr(char *s, char c) { for ( ; *s != '\0'; s++) if (*s == c) return (s); if (c == '\0') return (s); return (NULL); } #endif #if !HAVE_MEMCPY void * memcpy(void *dst, void *src, size_t len) { char *dstp = (char *) dst; char *srcp = (char *) src; int i; for (i = 0; i < len; i++) dstp[i] = srcp[i]; return (dst); } #endif #ifdef _OSK_MWC32 /* * This implements an ANSI-style intercept setup for Microware C 3.2 */ public int os9_signal(int type, RETSIGTYPE (*handler)()) { intercept(handler); } #include int isatty(int f) { struct sgbuf sgbuf; if (_gs_opt(f, &sgbuf) < 0) return -1; return (sgbuf.sg_class == 0); } #endif public void sleep_ms(int ms) { #if MSDOS_COMPILER==WIN32C Sleep(ms); #else #if HAVE_NANOSLEEP int sec = ms / 1000; struct timespec t = { sec, (ms - sec*1000) * 1000000 }; nanosleep(&t, NULL); #else #if HAVE_USLEEP usleep(ms * 1000); #else sleep(ms / 1000 + (ms % 1000 != 0)); #endif #endif #endif } diff --git a/contrib/less/version.c b/contrib/less/version.c index 9a97f1658940..68a42a6272fa 100644 --- a/contrib/less/version.c +++ b/contrib/less/version.c @@ -1,1052 +1,1054 @@ /* * Copyright (C) 1984-2025 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. */ /* ----------------------- CHANGE HISTORY -------------------------- 1/29/84 Allowed use on standard input 2/1/84 Added E, N, P commands 4/17/84 Added '=' command, 'stop' signal handling 4/20/84 Added line folding v2 4/27/84 Fixed '=' command to use BOTTOM_PLUS_ONE, instead of TOP, added 'p' & 'v' commands v3 5/3/84 Added -m and -t options, '-' command v4 5/3/84 Added LESS environment variable v5 5/3/84 New comments, fixed '-' command slightly v6 5/15/84 Added -Q, visual bell v7 5/24/84 Fixed jump_back(n) bug: n should count real lines, not folded lines. Also allow number on G command. v8 5/30/84 Re-do -q and -Q commands v9 9/25/84 Added "+" argument v10 10/10/84 Fixed bug in -b argument processing v11 10/18/84 Made error() ring bell if \n not entered. ----------------------------------------------------------------- v12 2/13/85 Reorganized signal handling and made portable to 4.2bsd. v13 2/16/85 Reword error message for '-' command. v14 2/22/85 Added -bf and -bp variants of -b. v15 2/25/85 Miscellaneous changes. v16 3/13/85 Added -u flag for backspace processing. v17 4/13/85 Added j and k commands, changed -t default. v18 4/20/85 Rewrote signal handling code. v19 5/2/85 Got rid of "verbose" eq_message(). Made search() scroll in some cases. v20 5/21/85 Fixed screen.c ioctls for System V. v21 5/23/85 Fixed some first_cmd bugs. v22 5/24/85 Added support for no RECOMP nor REGCMP. v23 5/25/85 Miscellaneous changes and prettying up. Posted to USENET. ----------------------------------------------------------------- v24 6/3/85 Added ti,te terminal init & de-init. (Thanks to Mike Kersenbrock) v25 6/8/85 Added -U flag, standout mode underlining. v26 6/9/85 Added -M flag. Use underline termcap (us) if it exists. v27 6/15/85 Renamed some variables to make unique in 6 chars. Minor fix to -m. v28 6/28/85 Fixed right margin bug. v29 6/28/85 Incorporated M.Rose's changes to signal.c v30 6/29/85 Fixed stupid bug in argument processing. v31 7/15/85 Added -p flag, changed repaint algorithm. Added kludge for magic cookie terminals. v32 7/16/85 Added cat_file if output not a tty. v33 7/23/85 Added -e flag and EDITOR. v34 7/26/85 Added -s flag. v35 7/27/85 Rewrote option handling; added option.c. v36 7/29/85 Fixed -e flag to work if not last file. v37 8/10/85 Added -x flag. v38 8/19/85 Changed prompting; created prompt.c. v39 8/24/85 (Not -p) does not initially clear screen. v40 8/26/85 Added "skipping" indicator in forw(). Posted to USENET. ----------------------------------------------------------------- v41 9/17/85 ONLY_RETURN, control char commands, faster search, other minor fixes. v42 9/25/85 Added ++ command line syntax; ch_fsize for pipes. v43 10/15/85 Added -h flag, changed prim.c algorithms. v44 10/16/85 Made END print in all cases of eof; ignore SIGTTOU after receiv ing SIGTSTP. v45 10/16/85 Never print backspaces unless -u. v46 10/24/85 Backwards scroll in jump_loc. v47 10/30/85 Fixed bug in edit(): *first_cmd==0 v48 11/16/85 Use TIOCSETN instead of TIOCSETP. Added marks (m and ' commands). Posted to USENET. ----------------------------------------------------------------- v49 1/9/86 Fixed bug: signal didn't clear mcc. v50 1/15/86 Added ' (quote) to gomark. v51 1/16/86 Added + cmd, fixed problem if first_cmd fails, made g cmd sort of "work" on pipes ev en if bof is no longer buffered. v52 1/17/86 Made short files work better. v53 1/20/86 Added -P option. v54 1/20/86 Changed help to use HELPFILE. v55 1/23/86 Messages work better if not tty output. v56 1/24/86 Added -l option. v57 1/31/86 Fixed -l to get confirmation before ov erwriting an existing file. v58 8/28/86 Added filename globbing. v59 9/15/86 Fixed some bugs with very long filenames. v60 9/26/86 Incorporated changes from Leith (Casey) Leedom for boldface and -z option. v61 9/26/86 Got rid of annoying repaints after ! cmd. Posted to USENET. ----------------------------------------------------------------- v62 12/23/86 Added is_directory(); change -z default to -1 instead of 24; cat-and-exit if -e and file is less than a screenful. v63 1/8/87 Fixed bug in cat-and-exit if > 1 file. v64 1/12/87 Changed puts/putstr, putc/putchr, getc/getchr to av oid name conflict with stdio functions. v65 1/26/87 Allowed '-' command to change NUMBER v alued options (thanks to Gary Puckering) v66 2/13/87 Fixed bug: prepaint should use force=1. v67 2/24/87 Added !! and % expansion to ! command. v68 2/25/87 Added SIGWINCH and TIOCGWINSZ support; changed is_directory to bad_file. (thanks to J. Robert Ward) v69 2/25/87 Added SIGWIND and WIOCGETD (for Unix PC). v70 3/13/87 Changed help cmd from 'h' to 'H'; better error msgs in bad_file, errno_message. v71 5/11/87 Changed -p to -c, made triple -c/-C for clear-eol like more's -c. v72 6/26/87 Added -E, -L, use $SHELL in lsystem(). (thanks to Stev e Spearman) v73 6/26/87 Allow Examine "#" for previous file. Posted to USENET 8/25/87. ----------------------------------------------------------------- v74 9/18/87 Fix conflict in EOF symbol with stdio.h, Make os.c more portable to BSD. v75 9/23/87 Fix problems in get_term (thanks to Paul Eggert); new backwards scrolling in jump_loc (thanks to Marion Hakanson). v76 9/23/87 Added -i flag; allow single "!" to inv oke a shell (thanks to Franco Barber). v77 9/24/87 Added -n flag and line number support. v78 9/25/87 Fixed problem with prompts longer than the screen width. v79 9/29/87 Added the _ command. v80 10/6/87 Allow signal to break out of linenum scan. v81 10/6/87 Allow -b to be changed from within less. v82 10/7/87 Add cmd_decode to use a table for key binding (thanks to Dav id Nason). v83 10/9/87 Allow .less file for user-defined keys. v84 10/11/87 Fix -e/-E problems (thanks to Felix Lee). v85 10/15/87 Search now keeps track of line numbers. v86 10/20/87 Added -B option and autobuf; fixed "pipe error" bug. v87 3/1/88 Fix bug re BSD signals while reading file. v88 3/12/88 Use new format for -P option (thanks to der Mouse), allow "+-c" without message, fix bug re BSD hangup. v89 3/18/88 Turn off line numbers if linenum scan is interrupted. v90 3/30/88 Allow -P from within less. v91 3/30/88 Added tags file support (new -t option) (thanks to Brian Campbell). v92 4/4/88 Added -+option syntax. v93 4/11/88 Add support for slow input (thanks to Joe Orost & apologies for taking almost 3 years to get this in!) v94 4/11/88 Redo reading/signal stuff. v95 4/20/88 Repaint screen better after signal. v96 4/21/88 Add /! and ?! commands. v97 5/17/88 Allow -l/-L from within less. Eliminate some static arrays (use calloc). Posted to USENET. ----------------------------------------------------------------- v98 10/14/88 Fix incorrect calloc call; uninitialized var in exec_mca; core dump on unknown TERM. Make v cmd work if past last line of file. Fix some signal bugs. v99 10/29/88 Allow space between -X and string, when X is a string-valued option. v100 1/5/89 Fix globbing bug when $SHELL not set; allow spaces after -t command. v101 1/6/89 Fix problem with long (truncated) lines in tags file (thanks to Neil Dixon). v102 1/6/89 Fix bug with E# when no prev file; allow spaces after -l command. v103 3/14/89 Add -N, -f and -? options. Add z and w commands. Add %L for prompt strings. v104 3/16/89 Added EDITPROTO. v105 3/20/89 Fix bug in find_linenum which cached incorrectly on long lines. v106 3/31/89 Added -k option and multiple lesskey files. v107 4/27/89 Add 8-bit char support and -g option. Split option code into 3 files. v108 5/5/89 Allocate position table dynamically (thanks to Paul Eggert); change % command from "percent" to vi-style brace finder. v109 5/10/89 Added ESC-% command, split prim.c. v110 5/24/89 Fixed bug in + option; fixed repaint bug under Sun windows (thanks to Paul Eggert). v111 5/25/89 Generalized # and % expansion; use calloc for some error messages. v112 5/30/89 Get rid of ESC-%, add {}()[] commands. v113 5/31/89 Optimize lseeks (thanks to Paul Eggert). v114 7/25/89 Added ESC-/ and ESC-/! commands. v115 7/26/89 Added ESC-n command. v116 7/31/89 Added find_pos to optimize g command. v117 8/1/89 Change -f option to -r. v118 8/2/89 Save positions for all previous files, not just the immediately previous one. v119 8/7/89 Save marks across file boundaries. Add file handle stuff. v120 8/11/89 Add :ta command. v121 8/16/89 Add -f option. v122 8/30/89 Fix performance with many buffers. v123 8/31/89 Verbose prompts for string options. Posted beta to USENET. ----------------------------------------------------------------- v124 9/18/89 Reorganize search commands, N = rev, ESC-n = span, add ESC-N. v125 9/18/89 Fix tab bug (thanks to Alex Liu). Fix EOF bug when both -w and -c. v126 10/25/89 Add -j option. v127 10/27/89 Fix problems with blank lines before BOF. v128 10/27/89 Add %bj, etc. to prompt strings. v129 11/3/89 Add -+,-- commands; add set-option and unset-option to lesskey. v130 11/6/89 Generalize A_EXTRA to string, remove set-option, unset-option from lesskey. v131 11/7/89 Changed name of EDITPROTO to LESSEDIT. v132 11/8/89 Allow editing of command prefix. v133 11/16/89 Add -y option (thanks to Jeff Sullivan). v134 12/1/89 Glob filenames in the -l command. v135 12/5/89 Combined {}()[] commands into one, and added ESC-^F and ESC-^B commands. v136 1/20/90 Added -S, -R flags. Added | command. Added warning for binary files. (thanks to Richard Brittain and J. Sullivan). v137 1/21/90 Rewrote horrible pappend code. Added * notation for hi-bit chars. v138 1/24/90 Fix magic cookie terminal handling. Get rid of "cleanup" loop in ch_get. v139 1/27/90 Added MSDOS support. (many thanks to Richard Brittain). v140 2/7/90 Editing a new file adds it to the command line list. v141 2/8/90 Add edit_list for editing >1 file. v142 2/10/90 Add :x command. v143 2/11/90 Add * and @ modifies to search cmds. Change ESC-/ cmd from /@* to / *. v144 3/1/90 Messed around with ch_zero; no real change. v145 3/2/90 Added -R and -v/-V for MSDOS; renamed FILENAME to avoid conflict. v146 3/5/90 Pull cmdbuf functions out of command.c v147 3/7/90 Implement ?@; fix multi-file edit bugs. v148 3/29/90 Fixed bug in :e then :e#. v149 4/3/90 Change error,ierror,query to use PARG. v150 4/6/90 Add LESS_CHARSET, LESS_CHARDEF. v151 4/13/90 Remove -g option; clean up ispipe. v152 4/14/90 lsystem() closes input file, for editors which require exclusive open. v153 4/18/90 Fix bug if SHELL unset; fix bug in overstrike control char. v154 4/25/90 Output to fd 2 via buffer. v155 4/30/90 Ignore -i if uppercase in pattern (thanks to Michael Rendell.) v156 5/3/90 Remove scroll limits in forw() & back(); causes problems with -c. v157 5/4/90 Forward search starts at next real line (not screen line) after jump target. v158 6/14/90 Added F command. v159 7/29/90 Fix bug in exiting: output not flushed. v160 7/29/90 Clear screen before initial output w/ -c. v161 7/29/90 Add -T flag. v162 8/14/90 Fix bug with +F on command line. v163 8/21/90 Added LESSBINFMT variable. v164 9/5/90 Added -p, LINES, COLUMNS and unset mark ' == BOF, for 1003.2 D5. v165 9/6/90 At EOF with -c set, don't display empty screen when try to page forward. v166 9/6/90 Fix G when final line in file wraps. v167 9/11/90 Translate CR/LF -> LF for 1003.2. v168 9/13/90 Return to curr file if "tag not found". v169 12/12/90 G goes to EOF even if file has grown. v170 1/17/91 Add optimization for BSD _setjmp; fix #include ioctl.h TERMIO problem. (thanks to Paul Eggert) Posted to USENET. ----------------------------------------------------------------- v171 3/6/91 Fix -? bug in get_filename. v172 3/15/91 Fix G bug in empty file. Fix bug with ?\n and -i and uppercase pattern at EOF! (thanks to Paul Eggert) v173 3/17/91 Change N cmd to not permanently change direction. (thanks to Brian Matthews) v174 3/18/91 Fix bug with namelogfile not getting cleared when change files. v175 3/18/91 Fix bug with ++cmd on command line. (thanks to Jim Meyering) v176 4/2/91 Change | to not force current screen, include marked line, start/end from top of screen. Improve search speed. (thanks to Don Mears) v177 4/2/91 Add LESSHELP variable. Fix bug with F command with -e. Try /dev/tty for input before using fd 2. Patches posted to USENET 4/2/91. ----------------------------------------------------------------- v178 4/8/91 Fixed bug in globbing logfile name. (thanks to Jim Meyering) v179 4/9/91 Allow negative -z for screen-relative. v180 4/9/91 Clear to eos rather than eol if "db"; don't use "sr" if "da". (thanks to Tor Lillqvist) v181 4/18/91 Fixed bug with "negative" chars 80 - FF. (thanks to Benny Sander Hofmann) v182 5/16/91 Fixed bug with attribute at EOL. (thanks to Brian Matthews) v183 6/1/91 Rewrite linstall to do smart config. v184 7/11/91 Process \b in searches based on -u rather than -i. v185 7/11/91 -Pxxx sets short prompt; assume SIGWINCH after a SIGSTOP. (thanks to Ken Laprade) ----------------------------------------------------------------- v186 4/20/92 Port to MS-DOS (Microsoft C). v187 4/23/92 Added -D option & TAB_COMPLETE_FILENAME. v188 4/28/92 Added command line editing features. v189 12/8/92 Fix mem overrun in anscreen.c:init; fix edit_list to recover from bin file. v190 2/13/93 Make TAB enter one filename at a time; create ^L with old TAB functionality. v191 3/10/93 Defer creating "flash" page for MS-DOS. v192 9/6/93 Add BACK-TAB. v193 9/17/93 Simplify binary_file handling. v194 1/4/94 Add rudiments of alt_filename handling. v195 1/11/94 Port back to Unix; support keypad. ----------------------------------------------------------------- v196 6/7/94 Fix bug with bad filename; fix IFILE type problem. (thanks to David MacKenzie) v197 6/7/94 Fix bug with .less tables inserted wrong. v198 6/23/94 Use autoconf installation technology. (thanks to David MacKenzie) v199 6/29/94 Fix MS-DOS build (thanks to Tim Wiegman). v200 7/25/94 Clean up copyright, minor fixes. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v201 7/27/94 Check for no memcpy; add casts to calloc; look for regcmp in libgen.a. (thanks to Kaveh Ghazi). v202 7/28/94 Fix bug in edit_next/edit_prev with non-existent files. v203 8/2/94 Fix a variety of configuration bugs on various systems. (thanks to Sakai Kiyotaka, Harald Koenig, Bjorn Brox, Teemu Rantanen, and Thorsten Lockert) v204 8/3/94 Use strerror if available. (thanks to J.T. Conklin) v205 8/5/94 Fix bug in finding "me" termcap entry. (thanks to Andreas Stolcke) 8/10/94 v205+: Change BUFSIZ to LBUFSIZE to avoid name conflict with stdio.h. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v206 8/10/94 Use initial_scrpos for -t to avoid displaying first page before init(). (thanks to Dominique Petitpierre) v207 8/12/94 Fix bug if stdout is not tty. v208 8/16/94 Fix bug in close_altfile if goto err1 in edit_ifile. (Thanks to M.J. Hewitt) v209 8/16/94 Change scroll to wscroll to avoid conflict with library function. v210 8/16/94 Fix bug with bold on 8 bit chars. (thanks to Vitor Duarte) v211 8/16/94 Don't quit on EOI in jump_loc / forw. v212 8/18/94 Use time_t if available. v213 8/20/94 Allow ospeed to be defined in termcap.h. v214 8/20/94 Added HILITE_SEARCH, -F, ESC-u cmd. (thanks to Paul Lew and Bob Byrnes) v215 8/23/94 Fix -i toggle behavior. v216 8/23/94 Process BS in all searches, not only -u. v217 8/24/94 Added -X flag. v218 8/24/94 Reimplement undo_search. v219 8/24/94 Find tags marked with line number instead of pattern. v220 8/24/94 Stay at same position after SIG_WINCH. v221 8/24/94 Fix bug in file percentage in big file. v222 8/25/94 Do better if can't reopen current file. v223 8/27/94 Support setlocale. (thanks to Robert Joop) v224 8/29/94 Revert v216: process BS in search only if -u. v225 9/6/94 Rewrite undo_search again: toggle. v226 9/15/94 Configuration fixes. (thanks to David MacKenzie) v227 9/19/94 Fixed strerror config problem. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v228 9/21/94 Fix bug in signals: repeated calls to get_editkeys overflowed st_edittable. v229 9/21/94 Fix "Nothing to search" error if -a and SRCH_PAST_EOF. v230 9/21/94 Don't print extra error msg in search after regerror(). v231 9/22/94 Fix hilite bug if search matches 0 chars. (thanks to John Polstra) v232 9/23/94 Deal with weird systems that have termios.h but not tcgetattr(). Posted to prep.ai.mit.edu ----------------------------------------------------------------- v233 9/26/94 Use get_term() instead of pos_init() in psignals to re-get lower_left termcap. (Thanks to John Malecki) v234 9/26/94 Make MIDDLE closer to middle of screen. v235 9/27/94 Use local strchr if system doesn't have. v236 9/28/94 Don't use libucb; use libterm if libtermcap & libcurses doesn't work. (Fix for Solaris; thanks to Frank Kaefer) v237 9/30/94 Use system isupper() etc if provided. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v238 10/6/94 Make binary non-blinking if LESSBINFMT is set to a string without a *. v239 10/7/94 Don't let delimit_word run back past beginning of cmdbuf. v240 10/10/94 Don't write into termcap buffer. (Thanks to Benoit Speckel) v241 10/13/94 New lesskey file format. Don't expand filenames in search command. v242 10/14/94 Allow lesskey specification of "literal". v243 10/14/94 Add #stop command to lesskey. v244 10/16/94 Add -f flag to lesskey. v245 10/25/94 Allow TAB_COMPLETE_FILENAME to be undefd. v246 10/27/94 Move help file to /usr/local/share. v247 10/27/94 Add -V option. v248 11/5/94 Add -V option to lesskey. v249 11/5/94 Remove -f flag from lesskey; default input file is ~/.lesskey.in, not stdin. v250 11/7/94 Lesskey input file "-" means stdin. v251 11/9/94 Convert cfgetospeed result to ospeed. (Thanks to Andrew Chernov) v252 11/16/94 Change default lesskey input file from .lesskey.in to .lesskey. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v253 11/21/94 Fix bug when tags file has a backslash. v254 12/6/94 Fix -k option. v255 12/8/94 Add #define EXAMINE to disable :e etc. v256 12/10/94 Change highlighting: only highlite search results (but now it is reliable). v257 12/10/94 Add goto_line and repaint_highlight to optimize highlight repaints. v258 12/12/94 Fixup in hilite_line if BS_SPECIAL. v259 12/12/94 Convert to autoconf 2.0. v260 12/13/94 Add SECURE define. v261 12/14/94 Use system WERASE char as EC_W_BACKSPACE. v262 12/16/94 Add -g/-G flag and screen_hilite. v263 12/20/94 Reimplement/optimize -G flag behavior. v264 12/23/94 Allow EXTRA string after line-edit cmd in lesskey file. v265 12/24/94 Add LESSOPEN=|cmd syntax. v266 12/26/94 Add -I flag. v267 12/28/94 Formalize the four-byte header emitted by a LESSOPEN pipe. v268 12/28/94 Get rid of four-byte header. v269 1/2/95 Close alt file before open new one. Avoids multiple popen(). v270 1/3/95 Use VISUAL; use S_ISDIR/S_ISREG; fix config problem with Solaris POSIX regcomp. v271 1/4/95 Don't quit on read error. v272 1/5/95 Get rid of -L. v273 1/6/95 Fix ch_ungetchar bug; don't call LESSOPEN on a pipe. v274 1/6/95 Ported to OS/2 (thanks to Kai Uwe Rommel) v275 1/18/95 Fix bug if toggle -G at EOF. v276 1/30/95 Fix OS/2 version. v277 1/31/95 Add "next" charset; don't display ^X for X > 128. v278 2/14/95 Change default for -G. Posted to prep.ai.mit.edu ----------------------------------------------------------------- v279 2/22/95 Add GNU options --help, --version. Minor config fixes. v280 2/24/95 Clean up calls to glob(); don't set # if we can't open the new file. v281 2/24/95 Repeat search should turn on hilites. v282 3/2/95 Minor fixes. v283 3/2/95 Fix homefile; make OS2 look in $HOME. v284 3/2/95 Error if "v" on LESSOPENed file; "%" figures out file size on pipe. v285 3/7/95 Don't set # in lsystem; lesskey try $HOME first. v286 3/7/95 Reformat change history (too much free time?). v287 3/8/95 Fix hilite bug if overstrike multiple chars. v288 3/8/95 Allow lesskey to override get_editkey keys. v289 3/9/95 Fix adj_hilite bug when line gets processed by hilite_line more than once. v290 3/9/95 Make configure automatically. Fix Sequent problem with incompatible sigsetmask(). Posted to prep.ai.mit.edu ----------------------------------------------------------------- v291 3/21/95 Add #env to lesskey. Fix MS-DOS build. Posted to simtel. ----------------------------------------------------------------- v292 4/24/95 Add MS-DOS support for Borland C. Fix arrow keys in MS-DOS versions. v293 4/28/95 Add auto-versioning stuff to make dist. v294 5/12/95 Fix Borland build. v295 1/20/96 Fix search on squished file; add /@@. v296 1/23/96 Allow cmdbuf larger than screen width. v297 1/24/96 Don't call termcap if tgetent fails; add #defines for buffers. v298 1/24/96 Change @@ to ^K. Add alternate search modifiers ^N, ^F, ^E. v299 1/25/96 Fix percent overflow in jump_percent (thanks to Brent Wiese); don't send "ti" after shell command till RETURN pressed. v300 1/25/96 Change -U to print tabs as ^I. v301 1/30/96 Make hilites work in cmd F output. v302 1/31/96 Fix cmd F to notice window-change signals. v303 1/31/96 Add ESC-SPACE command. v304 2/1/96 Add ^R search modifier; add LESSSECURE. v305 2/2/96 Workaround Linux /proc kernel bug; add LESSKEY. v306 3/16/96 Minor fixes. v307 3/25/96 Allow cmd line arg "--"; fix DOS & OS/2 defines.h. v308 4/4/96 Port to OS-9 (thanks to Boisy Pitre); fix -d. v309 4/9/96 Fix OS-9 version; fix tags bug with "$". v310 4/10/96 Get rid of HELPFILE. v311 4/22/96 Add Windows32 support; merge doscreen.c into screen.c. v312 4/24/96 Don't quit after "cannot reopen" error. v313 4/25/96 Added horizontal scrolling. v314 4/26/96 Modified -e to quit on reaching end of a squished file. v315 4/26/96 Fix "!;TAB" bug. v316 5/2/96 Make "|a" when (a < curr screen) go to end of curr screen. v317 5/14/96 Various fixes for the MS-DOS and OS/2 builds. Added ## and %% handling for filenames v318 5/29/96 Port to OS-9 Microware compiler; minor fixes (thanks to Martin Gregorie). v319 7/8/96 Fix Windows port (thanks to Jeff Paquette). v320 7/11/96 Final fixes for Windows port. v321 7/18/96 Minor fixes. Posted to Web page. ----------------------------------------------------------------- v322 8/13/96 Fix bug in shell escape from help file; add support for Microsoft Visual C under Windows; numerous small fixes. v323 8/19/96 Fixes for Windows version (thanks to Simon Munton); fix for Linux library weirdness (thanks to Jim Diamond); port to DJGPP (thanks to Eli Zaretskii). v324 8/21/96 Add support for spaces in filenames (thanks to Simon Munton). v325 8/21/96 Add lessecho, for spaces in filenames under Unix. v326 8/27/96 Fix DJGPP version. v327 9/1/96 Reorganize lglob, make spaces in filenames work better in Unix. v328 10/7/96 Append / to directory name in filename completion. Fix MS-DOS and OS-9 versions. v329 10/11/96 Fix more MS-DOS bugs; add LESSSEPARATOR; add -" option. Add LESSMETACHARS, LESSMETAESCAPE. v330 10/21/96 Minor fixes. Posted to Web page. ----------------------------------------------------------------- v331 4/22/97 Various Windows fixes (thanks to Gurusamy Sarathy). v332 4/22/97 Enter filenames from cmd line into edit history. Posted to Web page. ----------------------------------------------------------------- v333 3/4/99 Changed -w to highlite new line after forward movement. v334 3/9/99 Avoid overflowing prompt buffer; add %d and %D. v335 3/20/99 Add EBCDIC support (thanks to Thomas Dorner). Use HOMEDRIVE/HOMEPATH on Windows (thanks to Preston Bannister). Posted to Web page. ----------------------------------------------------------------- v336 4/8/99 Fix installation bugs. v337 4/9/99 Fix another installation bug. Posted to Web page. ----------------------------------------------------------------- v338 4/13/99 Add support for long option names. v339 4/18/99 Add \k, long option names to lesskey. Add -^P. Add :d. v340 4/21/99 Add regexec2. Fix Windows build. Posted to Web page. ----------------------------------------------------------------- v341 5/6/99 Add -F option; %c & ?c prompt escapes. (Thanks to Michele Maltoni) v342 7/22/99 Add system-wide lesskey file; allow GPL or Less License. v343 9/23/99 Support UTF-8 (Thanks to Robert Brady). Add %P and ?P in prompts. v344 10/27/99 -w highlights target line of g and p commands. v345 10/29/99 Make -R pass thru ESC but not other control chars. Posted to Web page. ----------------------------------------------------------------- v346 11/4/99 Fix bugs in long option processing; R cmd should clear hilites. Posted to Web page. ----------------------------------------------------------------- v347 12/13/99 Fixes for DJGPP version (thanks to Eli Zaretskii). v348 12/28/99 Fix deleting file with marks (thanks to Dimitar Jekov). Fix color problem in DJGPP version (thanks to Eli Zaretskii). v349 1/24/00 Fix minor DJGPP bugs; check environment vars for UTF-8; add --with-editor (thanks to Eli, Markus Kuhn, Thomas Schoepf). v350 3/1/00 Fix clear-while-standout bug. v351 3/5/00 Change -M and = prompts to show top & bottom line number. Posted to Web page. ----------------------------------------------------------------- v352 3/8/00 Fix scan_option NULL dereference. ----------------------------------------------------------------- v353 3/20/00 Fix SECURE compile bug, allow space after numeric option. v354 3/23/00 Add support for PCRE; add --with-regex configure option. ----------------------------------------------------------------- v355 6/28/00 Add -# option (thanks to Andy Levinson). v356 7/5/00 Add -J option. v357 7/6/00 Support sigprocmask. ----------------------------------------------------------------- v358 7/8/00 Fix problems with #stop in lesskey file. Posted to Web page. ----------------------------------------------------------------- v359 9/10/00 Fixes for Win32 display problems (thanks to Maurizio Vairani). v360 1/17/01 Move sysless to etc. v361 12/4/01 Add IBM-1047 charset & EBCDIC fixes (thanks to Thomas Dorner). Fix 32 bit dependencies (thanks to Paul Eggert). Fix UTF-8 overstriking (thanks to Robert Brady). v362 12/4/01 Make status column show search targets. v363 12/6/01 Add --no-keypad option. Add variable width tabstops (thanks to Peter Samuelson). v364 12/10/01 Better handling of very long lines in input; Fix horizontal shifting of colored text. v365 12/11/01 Fix overstriking of tabs; Add support for global(1) and multiple tag matches (thanks to Shigio Yamaguchi and Tim Vanderhoek). v366 12/11/01 Fixes for OS/2 (thanks to Kyosuke Tokoro). v367 12/13/01 Allow -D and -x options to terminate without dollar sign; Right/left arrow when entering N are shift cmds, not line edit. v368 12/18/01 Update lesskey commands. v370 12/23/01 Fix tags error messages. Posted to Web page. ----------------------------------------------------------------- v371 12/26/01 Fix new_file bug; use popen in Windows version; fix some compiler warnings. v372 12/29/01 Make -b be in units of 1K. v373 1/14/02 Improve handling of filenames containing shell metachars. v374 2/7/02 Fix memory leak; fix bug in -x argument parsing. v375 4/7/02 Fix searching for SGR sequences; fix SECURE build; add SGR support to DJGPP version (thanks to Eli Zaretskii). v376 6/10/02 Fix bug in overstriking multibyte UTF-8 characters (thanks to Jungshik Shin). Posted to Web page. ----------------------------------------------------------------- v377 9/10/02 Fix bug in Windows version when file contains CR; fix bug in search highlights with -R; make initial buffer limit really be 64K not unlimited. v378 9/30/02 Misc bug fixes and compiler warning cleanup. Posted to Web page. ----------------------------------------------------------------- v379 11/23/02 Add -L option; fix bug with ctrl-K in lesskey files; improve UTF-8 overstriking and underscore overstriking; fix minor man page problems; change to autoconf 2.54. v380 11/24/02 Make LINENUM same as POSITION. v381 11/28/02 Make -N use 7 columns for line number if possible. ----------------------------------------------------------------- v382 2/3/04 Remove copyrighted code. ----------------------------------------------------------------- v383 2/16/04 Add history file; add -K option; improve UTF-8 handling; fix some signed char bugs (thanks to Christian Biere); fix some upper/lower case bugs (thanks to Bjoern Jacke); add erase2 char (thanks to David Lawrence); add windows charset (thanks to Dimitar Zhekov). v384 2/20/04 Improvements in UTF-8 handling. v385 2/23/04 Fix UTF-8 output bug. ----------------------------------------------------------------- v386 9/13/05 Improvements to UTF-8 shift & color (thanks to Charles Levert); protect against invalid LESSOPEN and LESSCLOSE values. v387 9/14/05 Update Charles Levert's UTF-8 patch. v388 9/14/05 Change history behavior; change most sprintf calls to snprintf. v389 9/14/05 Fix copy & paste with long lines; improve performance of expand_linebuf; fix crash in init_mlist; v390 9/15/05 Show search matches in status column even if -G is set. ----------------------------------------------------------------- v391 9/17/05 Fix bugs. v392 10/14/05 Fix line wrapping bug. v393 10/19/05 Allow multiple attributes per char; fix bold+underline bug (thanks again to Charles Levert). v394 11/8/05 Fix prompt bug; fix compile problem in Windows build. ----------------------------------------------------------------- v395 1/12/07 Update Unicode tables (thanks to Charles Levert); don't chmod if LESSHISTFILE = /dev/null; make -f work for directories; support DESTDIR in Makefile; fix sigset_t detection in configure; make "t" cmd traverse tags in correct order v396 1/13/07 Add compatibility with POSIX more. v397 3/21/07 Allow decimal point in number for % command; Allow decimal point in number for -j option; Allow n command to fetch last search pattern from history (thanks to arno). v398 3/22/07 Don't rewrite history file if not necessary; fix bug when filenames contain "$". v399 3/22/07 Don't move to bottom of screen at startup; don't output extraneous newlines. v400 3/23/07 Allow search to find pattern after null byte (PCRE and no-regex) (thanks to Michael Constant). ----------------------------------------------------------------- v401 3/24/07 Minor documentation fixes. v402 3/30/07 Fix autoconf bug when memcpy etc are inline; fix bug in terminating number following -j option. v403 5/25/07 Fix Windows build. v404 6/5/07 Fix display bug with F command and long lines. v405 6/17/07 Fix display bug when using -w option. v406 6/17/07 Fix secure build. v407 8/16/07 Fix bugs; support CSI chars. v408 10/1/07 Fix bug in -i with non-ASCII chars. v409 10/12/07 Fix crash when viewing text with invalid UTF-8 sequences. v411 11/6/07 Fix case-insensitive searching with non-ASCII text. v412 11/6/07 Use symbolic SEEK constants. v413 11/6/07 Fix search highlight bug with non-ASCII text. v414 11/6/07 Fix display bug with no-wrap terminals. v415 11/14/07 Add --follow-name option. v416 11/22/07 Fix crash when searching text with invalid UTF-8 sequences. v417 12/31/07 Don't support single-char CSI in UTF-8 mode; fix bug with -R and invalid CSI sequences; fix bug searching text with SGR sequences with -r; emulate SGR sequences in WIN32 build. v418 12/31/07 Clean up. ----------------------------------------------------------------- v419 1/16/08 Make CSI char 0x9B work in UTF-8 mode (thanks to Colin Watson). v420 2/24/08 Add & command; fix -F option; fix '' after G. v421 2/24/08 Ignore filtered lines when searching. v422 3/2/08 Output CR at startup. v423 5/27/08 Clean up. v424 6/16/08 Fix compile bug with pcre; don't filter help file. v425 7/14/08 Fix non-ANSI code in list handling in ch.c. v426 10/27/08 Fix ignaw terminal handling (thanks to Per Hedeland); fix binary file detection in UTF-8 mode. v427 3/16/09 A few Win32 fixes (thanks to Jason Hood). v428 3/30/09 Add "|-" syntax to LESSOPEN. v429 4/10/09 Fix search highlighting bug with underlined text. ----------------------------------------------------------------- v430 4/22/09 Don't pass "-" to non-pipe LESSOPEN unless it starts with "-". v431 4/29/09 Fix highlight bug when match is at end of line. v432 6/27/09 Better fix for highlight bugs; fix new problems with ignaw terminals. v433 6/28/09 Cleanup search code. v434 6/29/09 More cleanup. v435 7/04/09 Fix bugs with non-regex filtering. v436 7/05/09 Fix memory leak. ----------------------------------------------------------------- v437 7/14/09 Fix bug in handling some long option names; make percentage calculation more accurate. v438 12/29/10 Fix bugs with -i/-I and & filtering; exit with status 2 on ctrl-C with -K. v439 12/31/10 Add -A option. v440 1/5/11 Fix bug displaying prompt after = command. v441 1/21/11 Fix semi-infinite loop if no newlines in file; make new -A behavior the default. ----------------------------------------------------------------- v442 3/2/11 Fix search bug. Add ctrl-G line edit command. v443 4/9/11 Fix Windows build. v444 6/8/11 Fix ungetc bug; remove vestiges of obsolete -l option. ----------------------------------------------------------------- v445 10/19/11 Fix hilite bug in backwards scroll with -J. Fix hilite bug with backspaces. Fix bugs handling SGR sequences in Win32 (thanks to Eric Lee). Add support for GNU regex (thanks to Reuben Thomas). v446 5/15/12 Up/down arrows in cmd editing search for matching cmd. v447 5/21/12 Add ESC-F command, two-pipe LESSOPEN syntax. v448 6/15/12 Print name of regex library in version message. v449 6/23/12 Allow config option --with-regex=none. v450 7/4/12 Fix EOF bug with ESC-F. v451 7/20/12 Fix typo. ----------------------------------------------------------------- v452 10/19/12 Fix --with-regex=none, fix "stty 0", fix Win32. Don't quit if errors in cmd line options. v453 10/27/12 Increase buffer sizes. v454 11/5/12 Fix typo. v455 11/5/12 Fix typo. v456 11/8/12 Fix option string incompatibility. v457 12/8/12 Use new option string syntax only after --use-backslash. v458 4/4/13 Fix display bug in using up/down in cmd buffer. ----------------------------------------------------------------- v459 5/6/13 Fix ++ bug. v460 6/19/13 Automate construction of Unicode tables. v461 6/21/13 Collapse multiple CRs before LF. v462 11/26/13 Don't overwrite history file, just append to it. v463 7/13/14 Misc. fixes. v464 7/19/14 Fix bugs & improve performance in & filtering (thanks to John Sullivan). v465 8/9/14 More fixes from John Sullivan. v466 8/23/14 Add colon to LESSANSIMIDCHARS. v467 9/18/14 Misc. fixes. v468 9/18/14 Fix typo v469 10/2/14 Allow extra string in command to append to a multichar cmd without executing it; fix bug using GNU regex. v470 10/5/14 Fix some compiler warnings. v471 12/14/14 Fix unget issues with prompt. Allow disabling history when compiled value of LESSHISTFILE = "-". v473 12/19/14 Fix prompt bug with stdin and -^P in lesskey extra string. v474 1/30/15 Fix bug in backwards search with match on bottom line. Make follow mode reopen file if file shrinks. v475 3/2/15 Fix possible buffer overrun with invalid UTF-8; fix bug when compiled with no regex; fix non-match search. v476 5/3/15 Update man pages. v477 5/19/15 Fix off-by-one in jump_forw_buffered; don't add FAKE_* files to cmd history. v478 5/21/15 Fix nonportable pointer usage in hilite tree. v479 7/6/15 Allow %% escapes in LESSOPEN variable. v480 7/24/15 Fix bug in no-regex searches; support MSVC v1900. v481 8/20/15 Fix broken -g option. ----------------------------------------------------------------- v482 2/25/16 Update Unicode database to "2015-06-16, 20:24:00 GMT [KW]". v483 2/27/16 Regenerate hilite when change search caselessness. (Thanks to Jason Hood) Fix bug when terminal has no "cm". (Thanks to Noel Cragg) v484 9/20/16 Update to Unicode 9.0.0 database. v485 10/21/16 Fix "nothing to search" bug when top/bottom line is empty; Display line numbers in bold. (thanks to Jason Hood); Fix incorrect display when entering double-width chars in search string. v486 10/22/16 New commands ESC-{ and ESC-} to shift to start/end of displayed lines; new option -Da in Windows version to enable SGR mode (thanks to Jason Hood). v487 10/23/16 configure --help formatting. ----------------------------------------------------------------- v488 2/23/17 Fix memory leaks in search (thanks to John Brooks). v489 3/30/17 Make -F not do init/deinit if file fits on one screen (thanks to Jindrich Novy). v490 4/5/17 Switch to ANSI prototypes in funcs.h; remove "register". v491 4/7/17 Fix signed char bug. v492 4/21/17 Handle SIGTERM. v493 6/22/17 Fix bug initializing charset in MSDOS build. v494 6/26/17 Update Unicode tables; make Cf chars composing not binary. v495 7/3/17 Improve binary file detection (thanks to Bela Lubkin); do -R filter when matching tags (thanks to Matthew Malcomson). v496 7/5/17 Add LESSRSCROLL marker. v497 7/5/17 Sync. v498 7/7/17 Fix early truncation of text if last char is double-width. v499 7/10/17 Misc fixes. v500 7/11/17 Fix bug where certain env variables couldn't be set in lesskey. v501 7/12/17 Make sure rscroll char is standout by default. v502 7/13/17 Control rscroll char via command line option not env variable. v503 7/13/17 Switch to git. v504 7/13/17 Call opt_rscroll at startup; change mkhelp.c to mkhelp.pl. v505 7/17/17 Add M and ESC-M commands; fix buffer handling with stdin and LESSOPEN. v506 7/17/17 On Windows, convert UTF-8 to multibyte if console is not UTF-8; handle extended chars on input (thanks to Jason Hood). v507 7/18/17 Fix some bugs handling filenames containing shell metachars. v508 7/19/17 Fix bugs when using LESSOPEN to read stdin. v509 7/19/17 Fix another stdin bug. v510 7/20/17 Fix bug in determining when to reopen a file. v511 7/25/17 Fix bugs in recent MSDOS changes (thanks to Jason Hood). v512 7/26/17 Fix MSDOS build. v513 7/26/17 Fix switch to normal attr at end of line with -R and rscroll. v514 7/27/17 Fix bug in fcomplete when pattern does not match a file. v515 7/28/17 Allow 'u' in -D option on Windows. v516 7/29/17 Fix bug using LESSOPEN with filename containing metachars. v517 7/30/17 Status column shows matches even if hiliting is disabled via -G. v518 8/1/17 Use underline in sgr mode in MSDOS (thanks to Jason Hood). v519 8/10/17 Fix rscroll bug when last char of line starts coloration. v520 9/3/17 Fix compiler warning. v521 10/20/17 Fix binary file warning in UTF-8 files with SGI sequences. v522 10/20/17 Handle keypad ENTER key properly. v523 10/23/17 Cleanup. v524 10/24/17 Fix getcc bug. v525 10/24/17 Change M command to mark last displayed line. v526 10/25/17 Fix search hilite bug introduced in v517. v527 10/30/17 Fix search hilite bug on last page with -a. v528 11/3/17 Make second ESC-u clear status column. v529 11/12/17 Display Unicode formatting chars in hex if -U is set. v530 12/2/17 Minor doc change and add missing VOID_PARAM. ----------------------------------------------------------------- v531 5/13/18 Fix bug with v on empty file; fix bug with v on file with metachars in name; add --nohistdups option. v532 7/27/18 Redraw screen on SIGWINCH even if screen size doesn't change. v533 8/1/18 Shell escape filenames in history; use PCRE_UTF8 flag; use wide-chars for Windows console title (thanks to Jason Hood). v534 8/9/18 Support PCRE2. v535 8/16/18 Don't count lines of initial screen if using -X with -F (thanks to Linus Torvalds). v536 8/31/18 Use descriptive error messages for PCRE2. v537 8/31/18 Support mingw build system (thanks to Mike Soyka). v538 9/3/18 Clean up some WIN32 code. v539 9/13/18 Fix spurious input on Windows with CAPSLOCK. v540 10/29/18 Add --mouse option. v541 10/30/18 Add --MOUSE option. v542 11/6/18 Add mouse support for WIN32; add --wheel-lines option. (thanks to Jason Hood). v543 11/12/18 Code cleanup. v544 11/16/18 Don't init/deinit keyboard/mouse if quit due to -F. v545 11/22/18 Fix Windows build, memory leaks. v546 11/29/18 Add --save-marks option. v547 11/30/18 Fix some bugs with saved marks. v548 12/14/18 Ignore mouse input when line editing. v549 2/10/19 Support X11 mouse extension 1006; Win32 fixes (thanks to Jason Hood). v550 2/16/19 Fix Win32 build; don't enable mouse unless --mouse is set. v551 6/10/19 Doc changes. ----------------------------------------------------------------- v552 7/8/19 Update Unicode tables. v553 10/17/19 Support tinfow; handle zero-width Hangul chars. v554 1/19/20 Remove erroneous free(). v555 3/15/20 Display error msg immediately when toggle -o without stdin. v556 3/15/20 Update copyright. v557 3/21/20 Fix memory corruption with libtermcap. v558 4/17/20 Don't init terminal if -F and file fits on one screen (WIN32). v559 4/19/20 Handle deinit correctly on WIN32. v560 5/3/20 Fix regression when command results in no movement; fix some less.nro issues (thanks to Bjarni I. Gislason). v561 5/11/20 Fix erroneous EOF calculation when F command is interrupted. v562 5/19/20 Update Unicode tables; minor doc formatting. v563 6/13/20 Fix crash due to realpath() incompatibility. v564 8/25/20 Handle realpath consistently; update docs. v565 11/3/20 Add ESC-U command, optimize calls to realpath(). v566 11/25/20 Fix crash when reopening a file while using LESSOPEN; support OSC 8 hyperlinks. v567 11/25/20 Fix typo. v568 11/29/20 Fix some hyperlink bugs; add ^W search modifier (thanks to Arminius); allow Makefile.aut to use Python instead of Perl (thanks to Charlie Lin). v569 12/1/20 Allow multiple & filters (thanks to Mattias Johansson), allow ^X to exit F command. v570 12/12/20 Better handling of multiple + or -p options; fix bugs in horizontal scrolling. v571 12/30/20 Add --line-num-width and --status-col-width options. v572 1/4/21 Save lastmark in history file; don't toggle mouse reporting; implement termcap delays. v573 1/9/21 Limit eof bell to 1 per second. v574 1/13/21 Add incremental search. v575 1/17/21 Fix build without HILITE_SEARCH; fix bug with ^K in lesskey extra string. v576 2/4/21 Make sure search result is visible; add --use-color and --color. v577 2/9/21 Use ttyname to get name of tty device. v578 2/9/21 Doc v579 2/14/21 Fix double-width char bugs and non-match search crash. v580 3/2/21 Some color fixes; fix compiler warnings; some lesstest support. v581 4/6/21 Ignore SIGTSTP in secure mode; don't print "skipping" when filtering. v582 4/21/21 Less now reads lesskey source file rather than binary; fix bug in finding tags with backslashes. v583 4/21/21 Use XDG_CONFIG_HOME and XDG_DATA_HOME to find files. v584 4/30/21 Add --file-size option. v585 5/2/21 Allow color desc W per man page. v586 5/7/21 Doc changes. v587 5/27/21 Fix --with-secure; fix --file-size message on Windows; fix colored search hilite in colored text; don't exit if -F and screen is resized; fix memcpy usage. v588 5/27/21 Fix release. v589 5/29/21 Copyright & build changes. v590 6/3/21 Fix non-autoconf Makefiles. v591 8/8/21 Use \kB for backspace key in lesskey; add more \k codes; handle multibyte chars in prompt. v592 8/24/21 Add --status-line option; limit use of /proc kludge; add --header. v593 8/30/21 Add header columns, --no-number-headers. v594 10/1/21 Let regex library handle caseless; add --redraw-on-quit option; add #version to lesskey. v595 10/12/21 Add H color type; add += to lesskey var section; add --search-options. v596 11/8/21 Look for lesskey in $HOME/.config. v597 11/16/21 Fix bugs in --header. v598 12/6/21 Look for lesshst in $XDG_STATE_HOME and $HOME/.local/state. v599 12/28/21 Defer moving to lower left in some cases; suppress TAB expansion in some cases. v600 1/7/22 Use /dev/tty if cannot open ttyname(). v601 1/31/22 Add --exit-follow-on-close option. v602 3/1/22 Doc changes. v603 3/14/22 Fix --header. v604 5/14/22 Fix termlib detection; fix non-ASCII input on Windows. v605 6/14/22 Update version number. v606 7/17/22 Fix bug with multibyte chars and --incsearch; escape filenames in LESSCLOSE; fix bin_file overrun. v607 7/19/22 Update Unicode tables. v608 7/22/22 Fix highlighting on colored text boundaries. v609 11/10/22 Add LESSUTFCHARDEF; fix overstrike color bug; fix procfs bug; fix signal race. v610 11/14/22 Update Unicode tables; fix again-search after filter; improve ^X to interrupt F command. v611 11/16/22 Fix EOF bug related to ^X change. v612 11/18/22 Fix more bugs related to ^X change. v613 11/28/22 Even more ^X issues. v614 11/28/22 Add ^X to wait message. v615 11/30/22 Add --no-vbell option. v616 12/9/22 Don't open tty as input file without -f. v617 12/10/22 Support poll on newer versions of MacOS. v618 12/29/22 Add --no-search-headers option; use C89 function definitions. v619 12/30/22 Fix bug using 'n' before '/'. v620 1/12/23 Add --modelines option; add --intr option; add subpattern coloring. v621 1/15/23 Add --wordwrap option; add LESS_LINES & LESS_COLUMNS. v622 1/27/23 Add --show-preproc-errors option. v623 2/2/23 Add # command; add ^S search modifier. v624 2/11/23 Add --proc-backspace, --proc-tab and --proc-return options. v625 2/16/23 Minor fixes. v626 2/19/23 Fix rare crash in add_attr_normal. v627 2/19/23 Doc. v628 2/20/23 Don't require newline after +&... v629 2/26/23 Delay "waiting for data" message for 500 ms. v630 3/18/23 Add LESS_DATA_DELAY. v631 3/26/23 Fix input of dead keys on Windows. v632 4/6/23 Make lesstest work on MacOS; minor fixes. v633 5/3/23 Fix build on systems with ncurses/termcap.h or ncursesw/termcap.h. v634 5/29/23 Allow program piping into less to access tty; fix search modifier ^E after ^W. v635 6/2/23 Fix crash with ! search modifier. v636 6/18/23 Fix -D in MS-DOS build; fix mouse wheel in MS-DOS build. v637 6/28/23 Fix early EOF when SIGWINCH is received. v638 6/29/23 Fix compile error with ECHONL. v639 6/29/23 Fix SIGWINCH while reading tty. v640 7/10/23 Add lesstest to release. v641 7/10/23 Fix release. v642 7/10/23 Fix release. v643 7/20/23 Fix crash on Windows with -o. v644 9/16/23 Improve ^C on non-terminated pipe; fix crash when files are deleted; support large files and non-BMP chars on Windows; fix # bug; don't filter header lines; fix shifting long lines; add --match-shift. v645 11/5/23 Default Windows charset is utf-8; update Unicode tables; fix ESC-} bug; mouse right-click jumps to '#'; add LESSSECURE_ALLOW; add --lesskey-content & LESSKEY_CONTENT; allow env var expansion in lesskey files; add LESS_UNSUPPORT. v646 11/6/23 Bug fixes. v647 11/16/23 Fix --+option; fix compiler warnings. v648 11/16/23 Add lang.h to release. v649 12/1/23 Add line number param to --header. v650 2/6/24 Add --no-search-header-lines and --no-search-header-columns; add ^L search modifier; add ^P shell command modifier; add search wrap message; add ^O^N, ^O^P, ^O^L and ^O^O commands. v651 3/4/24 Add --color attributes (*~_&); fix #/% substitution if name contains spaces; allow --rscroll with non-ASCII char. v652 3/11/24 Fix sleep_ms with usleep. v653 3/20/24 Make default charset utf-8. v654 4/28/24 Allow space to end parameter for some options; fix usleep bug; fix bugs when filename contains control chars; fix DJGPP build. v655 5/16/24 Fix search history bug with --incsearch. v656 5/23/24 Fix bug using escape sequences in prompt. v657 5/31/24 Fix buffer overrun when using LESSOPEN. v658 6/13/24 Fix double-free in lesskey parser; fix crash using small value for --line-num-width. v659 6/20/24 Fix typo in help. v660 6/24/24 Fix bug in ixerror. v661 6/29/24 Simpler fix for ixerror bug. v662 8/8/24 Fix build with --with-secure; improve true colors on Windows; fix crash with --header; fix crash with -S; fix #stop; fix --shift with fractional parameter; fix EOF bug in R command; fix --header with short file; fix ^X bug when output is not tty. v663 8/16/24 Fix ^X bug when output is not a tty. v664 8/28/24 Fix Windows compile error, fix output bug on Windows with -Da. v665 9/4/24 Fix ^Z bug. v666 9/21/24 Fix missing first byte from LESSOPEN if >0x7f. v667 9/26/24 Fix uninitialized variable in edit_ifile. v668 10/6/24 Fix UTF-8 chars in prompt. v669 11/6/24 Add --no-paste; add --no-edit-warn; add TAB for -- command; add LESSANSIOSCALLOW and LESSANSIOSCCCHARS; fix bug searching near invalid UTF-8 sequence; add LESS_SHELL_LINES; fix bug with --no-number-headers; add mouse cmds to lesskey; add form-feed; add --no-poll; add LESS_SIGUSR1; fix "configure --with-secure=no". v670 11/16/24 Fix SIGWINCH handling; add iopen. v671 12/6/24 Fix multibyte command chars; fix Windows auto_wrap. v672 1/20/25 Don't poll with -F on short file; remove --no-poll. v673 3/13/25 Treat -r in LESS var as -R; add ESC-j and ESC-k. v674 3/24/25 Improve behavior of ^O^N and ^O^P commands. v675 4/3/25 Add ESC-b. v676 4/16/25 Fix two OSC 8 display bugs. v677 4/27/25 Fix & filtering bug. v678 5/1/25 Don't change stty tab setting. +v679 5/28/25 Fix lesskey parsing bug when env var is prefix of another; + fix unexpected exit when using -K. */ -char version[] = "678"; +char version[] = "679";