summaryrefslogtreecommitdiff
path: root/doc/rluser.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/rluser.texi')
-rw-r--r--doc/rluser.texi110
1 files changed, 88 insertions, 22 deletions
diff --git a/doc/rluser.texi b/doc/rluser.texi
index 26b0ff0..cbcbb45 100644
--- a/doc/rluser.texi
+++ b/doc/rluser.texi
@@ -9,7 +9,7 @@ use these features. There is a document entitled "readline.texinfo"
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.
@@ -179,7 +179,7 @@ empty line.
@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.)
@@ -246,7 +246,7 @@ words, to the end of the next word.
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}.
@@ -339,7 +339,8 @@ Although the Readline library comes with a set of Emacs-like
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
@@ -418,6 +419,32 @@ variables.
@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.
@@ -444,6 +471,9 @@ If set to @samp{on}, when listing completions, Readline displays the
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
@@ -496,8 +526,9 @@ asked whether the list of possibilities should be displayed.
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
@@ -505,9 +536,12 @@ The default limit is @code{100}.
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
@@ -518,7 +552,7 @@ been mapped to @code{self-insert}. The default is @samp{off}.
@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
@@ -540,13 +574,30 @@ non-printing characters, which can be used to embed a terminal control
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
@@ -601,6 +652,8 @@ regardless of what the terminal claims it can support. The
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
@@ -683,6 +736,8 @@ eighth bit set directly rather than as a meta-prefixed escape
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
@@ -700,7 +755,7 @@ The default is @samp{off}.
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
@@ -732,7 +787,7 @@ The default value is @samp{off}.
@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.
@@ -792,12 +847,12 @@ interpreted as part of the key name.
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
@@ -1332,6 +1387,11 @@ for editing.
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
@@ -1668,7 +1728,7 @@ Re-execute the last keyboard macro defined, by making the characters
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
@@ -1721,11 +1781,11 @@ the saved position, and the old cursor position is saved as the mark.
@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 ()
@@ -1733,7 +1793,7 @@ Read enough characters to consume a multi-key sequence such as those
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-[.
@@ -1772,6 +1832,11 @@ the output is formatted in such a way that it can be made part
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
@@ -2224,6 +2289,7 @@ Names of all shell variables. May also be specified as @option{-v}.
@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
@@ -2401,7 +2467,7 @@ via @var{CDPATH}: Readline can't tell those completions are directories).
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.