which contains both end-user and programmer documentation for the
GNU Readline Library.
-Copyright (C) 1988--2020 Free Software Foundation, Inc.
+Copyright (C) 1988--2022 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
@end table
@noindent
-(Depending on your configuration, the @key{Backspace} key be set to
+(Depending on your configuration, the @key{Backspace} key might be set to
delete the character to the left of the cursor and the @key{DEL} key set
to delete the character underneath the cursor, like @kbd{C-d}, rather
than the character to the left of the cursor.)
Word boundaries are the same as those used by @kbd{M-f}.
@item M-@key{DEL}
-Kill from the cursor the start of the current word, or, if between
+Kill from the cursor to the start of the current word, or, if between
words, to the start of the previous word.
Word boundaries are the same as those used by @kbd{M-b}.
keybindings installed by default, it is possible to use a different set
of keybindings.
Any user can customize programs that use Readline by putting
-commands in an @dfn{inputrc} file, conventionally in his home directory.
+commands in an @dfn{inputrc} file,
+conventionally in their home directory.
The name of this
@ifset BashFeatures
file is taken from the value of the shell variable @env{INPUTRC}. If
@cindex variables, readline
@table @code
+@item active-region-start-color
+@vindex active-region-start-color
+A string variable that controls the text color and background when displaying
+the text in the active region (see the description of
+@code{enable-active-region} below).
+This string must not take up any physical character positions on the display,
+so it should consist only of terminal escape sequences.
+It is output to the terminal before displaying the text in the active region.
+This variable is reset to the default value whenever the terminal type changes.
+The default value is the string that puts the terminal in standout mode,
+as obtained from the terminal's terminfo description.
+A sample value might be @samp{\e[01;33m}.
+
+@item active-region-end-color
+@vindex active-region-end-color
+A string variable that "undoes" the effects of @code{active-region-start-color}
+and restores "normal" terminal display appearance after displaying text
+in the active region.
+This string must not take up any physical character positions on the display,
+so it should consist only of terminal escape sequences.
+It is output to the terminal after displaying the text in the active region.
+This variable is reset to the default value whenever the terminal type changes.
+The default value is the string that restores the terminal from standout mode,
+as obtained from the terminal's terminfo description.
+A sample value might be @samp{\e[0m}.
+
@item bell-style
@vindex bell-style
Controls what happens when Readline wants to ring the terminal bell.
common prefix of the set of possible completions using a different color.
The color definitions are taken from the value of the @env{LS_COLORS}
environment variable.
+If there is a color definition in @env{LS_COLORS} for the custom suffix
+@samp{readline-colored-completion-prefix}, Readline uses this color for
+the common prefix instead of its default.
The default is @samp{off}.
@item colored-stats
If the number of possible completions is greater than or equal to this value,
Readline will ask whether or not the user wishes to view them;
otherwise, they are simply listed.
-This variable must be set to an integer value greater than or equal to 0.
-A negative value means Readline should never ask.
+This variable must be set to an integer value greater than or equal to zero.
+A zero value means Readline should never ask; negative values are
+treated as zero.
The default limit is @code{100}.
@item convert-meta
If set to @samp{on}, Readline will convert characters with the
eighth bit set to an @sc{ascii} key sequence by stripping the eighth
bit and prefixing an @key{ESC} character, converting them to a
-meta-prefixed key sequence. The default value is @samp{on}, but
+meta-prefixed key sequence.
+The default value is @samp{on}, but
will be set to @samp{off} if the locale is one that contains
eight-bit characters.
+This variable is dependent on the @code{LC_CTYPE} locale category, and
+may change if the locale is changed.
@item disable-completion
@vindex disable-completion
@item echo-control-characters
@vindex echo-control-characters
When set to @samp{on}, on operating systems that indicate they support it,
-readline echoes a character corresponding to a signal generated from the
+Readline echoes a character corresponding to a signal generated from the
keyboard. The default is @samp{on}.
@item editing-mode
sequence into the mode string.
The default is @samp{@@}.
+@item enable-active-region
+@vindex enable-active-region
+The @dfn{point} is the current cursor position, and @dfn{mark} refers
+to a saved cursor position (@pxref{Commands For Moving}).
+The text between the point and mark is referred to as the @dfn{region}.
+When this variable is set to @samp{On}, Readline allows certain commands
+to designate the region as @dfn{active}.
+When the region is active, Readline highlights the text in the region using
+the value of the @code{active-region-start-color}, which defaults to the
+string that enables
+the terminal's standout mode.
+The active region shows the text inserted by bracketed-paste and any
+matching text found by incremental and non-incremental history searches.
+The default is @samp{On}.
+
@item enable-bracketed-paste
@vindex enable-bracketed-paste
-When set to @samp{On}, Readline will configure the terminal in a way
-that will enable it to insert each paste into the editing buffer as a
-single string of characters, instead of treating each character as if
-it had been read from the keyboard. This can prevent pasted characters
-from being interpreted as editing commands. The default is @samp{On}.
+When set to @samp{On}, Readline configures the terminal to insert each
+paste into the editing buffer as a single string of characters, instead
+of treating each character as if it had been read from the keyboard.
+This is called putting the terminal into @dfn{bracketed paste mode};
+it prevents Readline from executing any editing commands bound to key
+sequences appearing in the pasted text.
+The default is @samp{On}.
@item enable-keypad
@vindex enable-keypad
default value is @samp{off}, but Readline will set it to @samp{on} if the
locale contains eight-bit characters.
The name @code{meta-flag} is a synonym for this variable.
+This variable is dependent on the @code{LC_CTYPE} locale category, and
+may change if the locale is changed.
@item isearch-terminators
@vindex isearch-terminators
sequence.
The default is @samp{off}, but Readline will set it to @samp{on} if the
locale contains eight-bit characters.
+This variable is dependent on the @code{LC_CTYPE} locale category, and
+may change if the locale is changed.
@item page-completions
@vindex page-completions
If set to @samp{on}, Readline will undo all changes to history lines
before returning when @code{accept-line} is executed. By default,
history lines may be modified and retain individual undo lists across
-calls to @code{readline}. The default is @samp{off}.
+calls to @code{readline()}. The default is @samp{off}.
@item show-all-if-ambiguous
@vindex show-all-if-ambiguous
@vindex skip-completed-text
If set to @samp{on}, this alters the default completion behavior when
inserting a single match into the line. It's only active when
-performing completion in the middle of a word. If enabled, readline
+performing completion in the middle of a word. If enabled, Readline
does not insert characters from the completion that match characters
after point in the word being completed, so portions of the word
following the cursor are not duplicated.
The name of the key can be expressed in different ways, depending on
what you find most comfortable.
-In addition to command names, readline allows keys to be bound
+In addition to command names, Readline allows keys to be bound
to a string that is inserted when the key is pressed (a @var{macro}).
@ifset BashFeatures
The @w{@code{bind -p}} command displays Readline function names and
-bindings in a format that can put directly into an initialization file.
+bindings in a format that can be put directly into an initialization file.
@xref{Bash Builtins}.
@end ifset
A numeric argument, if supplied, specifies the history entry to use instead
of the current line.
+@item fetch-history ()
+With a numeric argument, fetch that entry from the history list
+and make it the current line.
+Without an argument, move back to the first entry in the history list.
+
@end ftable
@node Commands For Text
in the macro appear as if typed at the keyboard.
@item print-last-kbd-macro ()
-Print the last keboard macro defined in a format suitable for the
+Print the last keyboard macro defined in a format suitable for the
@var{inputrc} file.
@end ftable
@item character-search (C-])
A character is read and point is moved to the next occurrence of that
-character. A negative count searches for previous occurrences.
+character. A negative argument searches for previous occurrences.
@item character-search-backward (M-C-])
A character is read and point is moved to the previous occurrence
-of that character. A negative count searches for subsequent
+of that character. A negative argument searches for subsequent
occurrences.
@item skip-csi-sequence ()
defined for keys like Home and End. Such sequences begin with a
Control Sequence Indicator (CSI), usually ESC-[. If this sequence is
bound to "\e[", keys producing such sequences will have no effect
-unless explicitly bound to a readline command, instead of inserting
+unless explicitly bound to a Readline command, instead of inserting
stray characters into the editing buffer. This is unbound by default,
but usually bound to ESC-[.
of an @var{inputrc} file. This command is unbound by default.
@ifset BashFeatures
+@item spell-correct-word (C-x s)
+Perform spelling correction on the current word, treating it as a directory
+or filename, in the same way as the @code{cdspell} shell option.
+Word boundaries are the same as those used by @code{shell-forward-word}.
+
@item glob-complete-word (M-g)
The word before point is treated as a pattern for pathname expansion,
with an asterisk implicitly appended. This pattern is used to
@item -C @var{command}
@var{command} is executed in a subshell environment, and its output is
used as the possible completions.
+Arguments are passed as with the @option{-F} option.
@item -F @var{function}
The shell function @var{function} is executed in the current shell
The @option{-o nospace} option tells Readline to not append a space
character to the directory name, in case we want to append to it.
The @option{-o bashdefault} option brings in the rest of the "Bash default"
-completions -- possible completion that Bash adds to the default Readline
+completions -- possible completions that Bash adds to the default Readline
set. These include things like command name completion, variable completion
for words beginning with @samp{$} or @samp{$@{}, completions containing pathname
expansion patterns (@pxref{Filename Expansion}), and so on.