version 1.1.1.1, 2014/07/30 08:16:45
|
version 1.1.1.2, 2021/03/17 01:01:01
|
Line 9 use these features. There is a document entitled "rea
|
Line 9 use these features. There is a document entitled "rea
|
which contains both end-user and programmer documentation for the |
which contains both end-user and programmer documentation for the |
GNU Readline Library. |
GNU Readline Library. |
|
|
Copyright (C) 1988--2014 Free Software Foundation, Inc. | Copyright (C) 1988--2020 Free Software Foundation, Inc. |
|
|
Authored by Brian Fox and Chet Ramey. |
Authored by Brian Fox and Chet Ramey. |
|
|
Line 350 file is taken from the value of the environment variab
|
Line 350 file is taken from the value of the environment variab
|
that variable is unset, the default is @file{~/.inputrc}. If that |
that variable is unset, the default is @file{~/.inputrc}. If that |
file does not exist or cannot be read, the ultimate default is |
file does not exist or cannot be read, the ultimate default is |
@file{/etc/inputrc}. |
@file{/etc/inputrc}. |
|
@ifset BashFeatures |
|
The @w{@code{bind}} builtin command can also be used to set Readline |
|
keybindings and variables. |
|
@xref{Bash Builtins}. |
|
@end ifset |
|
|
When a program which uses the Readline library starts up, the |
When a program which uses the Readline library starts up, the |
init file is read, and the key bindings are set. |
init file is read, and the key bindings are set. |
Line 423 the terminal's bell.
|
Line 428 the terminal's bell.
|
|
|
@item bind-tty-special-chars |
@item bind-tty-special-chars |
@vindex bind-tty-special-chars |
@vindex bind-tty-special-chars |
If set to @samp{on}, Readline attempts to bind the control characters | If set to @samp{on} (the default), Readline attempts to bind the control |
treated specially by the kernel's terminal driver to their Readline | characters treated specially by the kernel's terminal driver to their |
equivalents. | Readline equivalents. |
|
|
|
@item blink-matching-paren |
|
@vindex blink-matching-paren |
|
If set to @samp{on}, Readline attempts to briefly move the cursor to an |
|
opening parenthesis when a closing parenthesis is inserted. The default |
|
is @samp{off}. |
|
|
|
@item colored-completion-prefix |
|
@vindex colored-completion-prefix |
|
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. |
|
The default is @samp{off}. |
|
|
@item colored-stats |
@item colored-stats |
@vindex colored-stats |
@vindex colored-stats |
If set to @samp{on}, Readline displays possible completions using different |
If set to @samp{on}, Readline displays possible completions using different |
Line 461 The default value is @samp{off}.
|
Line 480 The default value is @samp{off}.
|
If set to @samp{on}, and @var{completion-ignore-case} is enabled, Readline |
If set to @samp{on}, and @var{completion-ignore-case} is enabled, Readline |
treats hyphens (@samp{-}) and underscores (@samp{_}) as equivalent when |
treats hyphens (@samp{-}) and underscores (@samp{_}) as equivalent when |
performing case-insensitive filename matching and completion. |
performing case-insensitive filename matching and completion. |
|
The default value is @samp{off}. |
|
|
@item completion-prefix-display-length |
@item completion-prefix-display-length |
@vindex completion-prefix-display-length |
@vindex completion-prefix-display-length |
Line 473 replaced with an ellipsis when displaying possible com
|
Line 493 replaced with an ellipsis when displaying possible com
|
@vindex completion-query-items |
@vindex completion-query-items |
The number of possible completions that determines when the user is |
The number of possible completions that determines when the user is |
asked whether the list of possibilities should be displayed. |
asked whether the list of possibilities should be displayed. |
If the number of possible completions is greater than this value, | If the number of possible completions is greater than or equal to this value, |
Readline will ask the user whether or not he wishes to view | Readline will ask whether or not the user wishes to view them; |
them; otherwise, they are simply listed. | otherwise, they are simply listed. |
This variable must be set to an integer value greater than or equal to 0. |
This variable must be set to an integer value greater than or equal to 0. |
A negative value means Readline should never ask. |
A negative value means Readline should never ask. |
The default limit is @code{100}. |
The default limit is @code{100}. |
Line 485 The default limit is @code{100}.
|
Line 505 The default limit is @code{100}.
|
If set to @samp{on}, Readline will convert characters with the |
If set to @samp{on}, Readline will convert characters with the |
eighth bit set to an @sc{ascii} key sequence by stripping the eighth |
eighth bit set to an @sc{ascii} key sequence by stripping the eighth |
bit and prefixing an @key{ESC} character, converting them to a |
bit and prefixing an @key{ESC} character, converting them to a |
meta-prefixed key sequence. The default value is @samp{on}. | 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. |
|
|
@item disable-completion |
@item disable-completion |
@vindex disable-completion |
@vindex disable-completion |
Line 493 If set to @samp{On}, Readline will inhibit word comple
|
Line 515 If set to @samp{On}, Readline will inhibit word comple
|
Completion characters will be inserted into the line as if they had |
Completion characters will be inserted into the line as if they had |
been mapped to @code{self-insert}. The default is @samp{off}. |
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 |
|
keyboard. The default is @samp{on}. |
|
|
@item editing-mode |
@item editing-mode |
@vindex editing-mode |
@vindex editing-mode |
The @code{editing-mode} variable controls which default set of |
The @code{editing-mode} variable controls which default set of |
Line 500 key bindings is used. By default, Readline starts up
|
Line 528 key bindings is used. By default, Readline starts up
|
mode, where the keystrokes are most similar to Emacs. This variable can be |
mode, where the keystrokes are most similar to Emacs. This variable can be |
set to either @samp{emacs} or @samp{vi}. |
set to either @samp{emacs} or @samp{vi}. |
|
|
@item echo-control-characters | @item emacs-mode-string |
When set to @samp{on}, on operating systems that indicate they support it, | @vindex emacs-mode-string |
readline echoes a character corresponding to a signal generated from the | If the @var{show-mode-in-prompt} variable is enabled, |
keyboard. The default is @samp{on}. | this string is displayed immediately before the last line of the primary |
| prompt when emacs editing mode is active. The value is expanded like a |
| key binding, so the standard set of meta- and control prefixes and |
| backslash escape sequences is available. |
| Use the @samp{\1} and @samp{\2} escapes to begin and end sequences of |
| non-printing characters, which can be used to embed a terminal control |
| sequence into the mode string. |
| The default is @samp{@@}. |
|
|
|
@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}. |
|
|
@item enable-keypad |
@item enable-keypad |
@vindex enable-keypad |
@vindex enable-keypad |
When set to @samp{on}, Readline will try to enable the application |
When set to @samp{on}, Readline will try to enable the application |
Line 537 are saved.
|
Line 580 are saved.
|
If set to a value less than zero, the number of history entries is not |
If set to a value less than zero, the number of history entries is not |
limited. |
limited. |
By default, the number of history entries is not limited. |
By default, the number of history entries is not limited. |
|
If an attempt is made to set @var{history-size} to a non-numeric value, |
|
the maximum number of history entries will be set to 500. |
|
|
@item horizontal-scroll-mode |
@item horizontal-scroll-mode |
@vindex horizontal-scroll-mode |
@vindex horizontal-scroll-mode |
This variable can be set to either @samp{on} or @samp{off}. Setting it |
This variable can be set to either @samp{on} or @samp{off}. Setting it |
to @samp{on} means that the text of the lines being edited will scroll |
to @samp{on} means that the text of the lines being edited will scroll |
horizontally on a single screen line when they are longer than the width |
horizontally on a single screen line when they are longer than the width |
of the screen, instead of wrapping onto a new screen line. By default, | of the screen, instead of wrapping onto a new screen line. |
this variable is set to @samp{off}. | This variable is automatically set to @samp{on} for terminals of height 1. |
| By default, this variable is set to @samp{off}. |
|
|
@item input-meta |
@item input-meta |
@vindex input-meta |
@vindex input-meta |
Line 552 this variable is set to @samp{off}.
|
Line 598 this variable is set to @samp{off}.
|
If set to @samp{on}, Readline will enable eight-bit input (it |
If set to @samp{on}, Readline will enable eight-bit input (it |
will not clear the eighth bit in the characters it reads), |
will not clear the eighth bit in the characters it reads), |
regardless of what the terminal claims it can support. The |
regardless of what the terminal claims it can support. The |
default value is @samp{off}. The name @code{meta-flag} is a | default value is @samp{off}, but Readline will set it to @samp{on} if the |
synonym for this variable. | locale contains eight-bit characters. |
| The name @code{meta-flag} is a synonym for this variable. |
|
|
@item isearch-terminators |
@item isearch-terminators |
@vindex isearch-terminators |
@vindex isearch-terminators |
Line 565 If this variable has not been given a value, the chara
|
Line 612 If this variable has not been given a value, the chara
|
@item keymap |
@item keymap |
@vindex keymap |
@vindex keymap |
Sets Readline's idea of the current keymap for key binding commands. |
Sets Readline's idea of the current keymap for key binding commands. |
Acceptable @code{keymap} names are | Built-in @code{keymap} names are |
@code{emacs}, |
@code{emacs}, |
@code{emacs-standard}, |
@code{emacs-standard}, |
@code{emacs-meta}, |
@code{emacs-meta}, |
Line 574 Acceptable @code{keymap} names are
|
Line 621 Acceptable @code{keymap} names are
|
@code{vi-move}, |
@code{vi-move}, |
@code{vi-command}, and |
@code{vi-command}, and |
@code{vi-insert}. |
@code{vi-insert}. |
@code{vi} is equivalent to @code{vi-command}; @code{emacs} is | @code{vi} is equivalent to @code{vi-command} (@code{vi-move} is also a |
equivalent to @code{emacs-standard}. The default value is @code{emacs}. | synonym); @code{emacs} is equivalent to @code{emacs-standard}. |
| Applications may add additional names. |
| The default value is @code{emacs}. |
The value of the @code{editing-mode} variable also affects the |
The value of the @code{editing-mode} variable also affects the |
default keymap. |
default keymap. |
|
|
Line 631 the list. The default is @samp{off}.
|
Line 680 the list. The default is @samp{off}.
|
@vindex output-meta |
@vindex output-meta |
If set to @samp{on}, Readline will display characters with the |
If set to @samp{on}, Readline will display characters with the |
eighth bit set directly rather than as a meta-prefixed escape |
eighth bit set directly rather than as a meta-prefixed escape |
sequence. The default is @samp{off}. | sequence. |
| The default is @samp{off}, but Readline will set it to @samp{on} if the |
| locale contains eight-bit characters. |
|
|
@item page-completions |
@item page-completions |
@vindex page-completions |
@vindex page-completions |
Line 672 The default value is @samp{off}.
|
Line 723 The default value is @samp{off}.
|
|
|
@item show-mode-in-prompt |
@item show-mode-in-prompt |
@vindex show-mode-in-prompt |
@vindex show-mode-in-prompt |
If set to @samp{on}, add a character to the beginning of the prompt | If set to @samp{on}, add a string to the beginning of the prompt |
indicating the editing mode: emacs (@samp{@@}), vi command (@samp{:}), | indicating the editing mode: emacs, vi command, or vi insertion. |
or vi insertion (@samp{+}). | The mode strings are user-settable (e.g., @var{emacs-mode-string}). |
The default value is @samp{off}. |
The default value is @samp{off}. |
|
|
@item skip-completed-text |
@item skip-completed-text |
Line 691 rather than @samp{Makefilefile}, assuming there is a s
|
Line 742 rather than @samp{Makefilefile}, assuming there is a s
|
completion. |
completion. |
The default value is @samp{off}. |
The default value is @samp{off}. |
|
|
|
@item vi-cmd-mode-string |
|
@vindex vi-cmd-mode-string |
|
If the @var{show-mode-in-prompt} variable is enabled, |
|
this string is displayed immediately before the last line of the primary |
|
prompt when vi editing mode is active and in command mode. |
|
The value is expanded like a |
|
key binding, so the standard set of meta- and control prefixes and |
|
backslash escape sequences is available. |
|
Use the @samp{\1} and @samp{\2} escapes to begin and end sequences of |
|
non-printing characters, which can be used to embed a terminal control |
|
sequence into the mode string. |
|
The default is @samp{(cmd)}. |
|
|
|
@item vi-ins-mode-string |
|
@vindex vi-ins-mode-string |
|
If the @var{show-mode-in-prompt} variable is enabled, |
|
this string is displayed immediately before the last line of the primary |
|
prompt when vi editing mode is active and in insertion mode. |
|
The value is expanded like a |
|
key binding, so the standard set of meta- and control prefixes and |
|
backslash escape sequences is available. |
|
Use the @samp{\1} and @samp{\2} escapes to begin and end sequences of |
|
non-printing characters, which can be used to embed a terminal control |
|
sequence into the mode string. |
|
The default is @samp{(ins)}. |
|
|
@item visible-stats |
@item visible-stats |
@vindex visible-stats |
@vindex visible-stats |
If set to @samp{on}, a character denoting a file's type |
If set to @samp{on}, a character denoting a file's type |
Line 733 Meta-Rubout: backward-kill-word
|
Line 810 Meta-Rubout: backward-kill-word
|
Control-o: "> output" |
Control-o: "> output" |
@end example |
@end example |
|
|
In the above example, @kbd{C-u} is bound to the function | In the example above, @kbd{C-u} is bound to the function |
@code{universal-argument}, |
@code{universal-argument}, |
@kbd{M-DEL} is bound to the function @code{backward-kill-word}, and |
@kbd{M-DEL} is bound to the function @code{backward-kill-word}, and |
@kbd{C-o} is bound to run the macro |
@kbd{C-o} is bound to run the macro |
Line 848 of tests. There are four parser directives used.
|
Line 925 of tests. There are four parser directives used.
|
@item $if |
@item $if |
The @code{$if} construct allows bindings to be made based on the |
The @code{$if} construct allows bindings to be made based on the |
editing mode, the terminal being used, or the application using |
editing mode, the terminal being used, or the application using |
Readline. The text of the test extends to the end of the line; | Readline. The text of the test, after any comparison operator, |
no characters are required to isolate it. | extends to the end of the line; |
| unless otherwise noted, no characters are required to isolate it. |
|
|
@table @code |
@table @code |
@item mode |
@item mode |
Line 869 the portion of the terminal name before the first @sam
|
Line 947 the portion of the terminal name before the first @sam
|
allows @code{sun} to match both @code{sun} and @code{sun-cmd}, |
allows @code{sun} to match both @code{sun} and @code{sun-cmd}, |
for instance. |
for instance. |
|
|
|
@item version |
|
The @code{version} test may be used to perform comparisons against |
|
specific Readline versions. |
|
The @code{version} expands to the current Readline version. |
|
The set of comparison operators includes |
|
@samp{=} (and @samp{==}), @samp{!=}, @samp{<=}, @samp{>=}, @samp{<}, |
|
and @samp{>}. |
|
The version number supplied on the right side of the operator consists |
|
of a major version number, an optional decimal point, and an optional |
|
minor version (e.g., @samp{7.1}). If the minor version is omitted, it |
|
is assumed to be @samp{0}. |
|
The operator may be separated from the string @code{version} and |
|
from the version number argument by whitespace. |
|
The following example sets a variable if the Readline version being used |
|
is 7.0 or newer: |
|
@example |
|
$if version >= 7.0 |
|
set show-mode-in-prompt on |
|
$endif |
|
@end example |
|
|
@item application |
@item application |
The @var{application} construct is used to include |
The @var{application} construct is used to include |
application-specific settings. Each program using the Readline |
application-specific settings. Each program using the Readline |
Line 883 $if Bash
|
Line 982 $if Bash
|
"\C-xq": "\eb\"\ef\"" |
"\C-xq": "\eb\"\ef\"" |
$endif |
$endif |
@end example |
@end example |
|
|
|
@item variable |
|
The @var{variable} construct provides simple equality tests for Readline |
|
variables and values. |
|
The permitted comparison operators are @samp{=}, @samp{==}, and @samp{!=}. |
|
The variable name must be separated from the comparison operator by |
|
whitespace; the operator may be separated from the value on the right hand |
|
side by whitespace. |
|
Both string and boolean variables may be tested. Boolean variables must be |
|
tested against the values @var{on} and @var{off}. |
|
The following example is equivalent to the @code{mode=emacs} test described |
|
above: |
|
@example |
|
$if editing-mode == emacs |
|
set show-mode-in-prompt on |
|
$endif |
|
@end example |
@end table |
@end table |
|
|
@item $endif |
@item $endif |
Line 999 set convert-meta off
|
Line 1115 set convert-meta off
|
# rather than as meta-prefixed characters |
# rather than as meta-prefixed characters |
set output-meta on |
set output-meta on |
|
|
# if there are more than 150 possible completions for | # if there are 150 or more possible completions for a word, |
# a word, ask the user if he wants to see all of them | # ask whether or not the user wants to see all of them |
set completion-query-items 150 |
set completion-query-items 150 |
|
|
# For FTP |
# For FTP |
Line 1063 Move back to the start of the current or previous word
|
Line 1179 Move back to the start of the current or previous word
|
Words are composed of letters and digits. |
Words are composed of letters and digits. |
|
|
@ifset BashFeatures |
@ifset BashFeatures |
@item shell-forward-word () | @item shell-forward-word (M-C-f) |
Move forward to the end of the next word. |
Move forward to the end of the next word. |
Words are delimited by non-quoted shell metacharacters. |
Words are delimited by non-quoted shell metacharacters. |
|
|
@item shell-backward-word () | @item shell-backward-word (M-C-b) |
Move back to the start of the current or previous word. |
Move back to the start of the current or previous word. |
Words are delimited by non-quoted shell metacharacters. |
Words are delimited by non-quoted shell metacharacters. |
@end ifset |
@end ifset |
|
|
|
@item previous-screen-line () |
|
Attempt to move point to the same physical screen column on the previous |
|
physical screen line. This will not have the desired effect if the current |
|
Readline line does not take up more than one physical line or if point is not |
|
greater than the length of the prompt plus the screen width. |
|
|
|
@item next-screen-line () |
|
Attempt to move point to the same physical screen column on the next |
|
physical screen line. This will not have the desired effect if the current |
|
Readline line does not take up more than one physical line or if the length |
|
of the current Readline line is not greater than the length of the prompt |
|
plus the screen width. |
|
|
|
@item clear-display (M-C-l) |
|
Clear the screen and, if possible, the terminal's scrollback buffer, |
|
then redraw the current line, |
|
leaving the current line at the top of the screen. |
|
|
@item clear-screen (C-l) |
@item clear-screen (C-l) |
Clear the screen and redraw the current line, | Clear the screen, |
| then redraw the current line, |
leaving the current line at the top of the screen. |
leaving the current line at the top of the screen. |
|
|
@item redraw-current-line () |
@item redraw-current-line () |
Line 1119 being entered.
|
Line 1254 being entered.
|
@item reverse-search-history (C-r) |
@item reverse-search-history (C-r) |
Search backward starting at the current line and moving `up' through |
Search backward starting at the current line and moving `up' through |
the history as necessary. This is an incremental search. |
the history as necessary. This is an incremental search. |
|
This command sets the region to the matched text and activates the mark. |
|
|
@item forward-search-history (C-s) |
@item forward-search-history (C-s) |
Search forward starting at the current line and moving `down' through |
Search forward starting at the current line and moving `down' through |
the the history as necessary. This is an incremental search. | the history as necessary. This is an incremental search. |
| This command sets the region to the matched text and activates the mark. |
|
|
@item non-incremental-reverse-search-history (M-p) |
@item non-incremental-reverse-search-history (M-p) |
Search backward starting at the current line and moving `up' |
Search backward starting at the current line and moving `up' |
through the history as necessary using a non-incremental search |
through the history as necessary using a non-incremental search |
for a string supplied by the user. |
for a string supplied by the user. |
|
The search string may match anywhere in a history line. |
|
|
@item non-incremental-forward-search-history (M-n) |
@item non-incremental-forward-search-history (M-n) |
Search forward starting at the current line and moving `down' |
Search forward starting at the current line and moving `down' |
through the the history as necessary using a non-incremental search | through the history as necessary using a non-incremental search |
for a string supplied by the user. |
for a string supplied by the user. |
|
The search string may match anywhere in a history line. |
|
|
@item history-search-forward () |
@item history-search-forward () |
Search forward through the history for the string of characters |
Search forward through the history for the string of characters |
Line 1148 The search string must match at the beginning of a his
|
Line 1287 The search string must match at the beginning of a his
|
This is a non-incremental search. |
This is a non-incremental search. |
By default, this command is unbound. |
By default, this command is unbound. |
|
|
@item history-substr-search-forward () | @item history-substring-search-forward () |
Search forward through the history for the string of characters |
Search forward through the history for the string of characters |
between the start of the current line and the point. |
between the start of the current line and the point. |
The search string may match anywhere in a history line. |
The search string may match anywhere in a history line. |
This is a non-incremental search. |
This is a non-incremental search. |
By default, this command is unbound. |
By default, this command is unbound. |
|
|
@item history-substr-search-backward () | @item history-substring-search-backward () |
Search backward through the history for the string of characters |
Search backward through the history for the string of characters |
between the start of the current line and the point. |
between the start of the current line and the point. |
The search string may match anywhere in a history line. |
The search string may match anywhere in a history line. |
Line 1185 the direction through the history (back or forward).
|
Line 1324 the direction through the history (back or forward).
|
The history expansion facilities are used to extract the last argument, |
The history expansion facilities are used to extract the last argument, |
as if the @samp{!$} history expansion had been specified. |
as if the @samp{!$} history expansion had been specified. |
|
|
|
@item operate-and-get-next (C-o) |
|
Accept the current line for return to the calling application as if a |
|
newline had been entered, |
|
and fetch the next line relative to the current line from the history |
|
for editing. |
|
A numeric argument, if supplied, specifies the history entry to use instead |
|
of the current line. |
|
|
@end ftable |
@end ftable |
|
|
@node Commands For Text |
@node Commands For Text |
Line 1224 Insert a tab character.
|
Line 1371 Insert a tab character.
|
@item self-insert (a, b, A, 1, !, @dots{}) |
@item self-insert (a, b, A, 1, !, @dots{}) |
Insert yourself. |
Insert yourself. |
|
|
|
@item bracketed-paste-begin () |
|
This function is intended to be bound to the "bracketed paste" escape |
|
sequence sent by some terminals, and such a binding is assigned by default. |
|
It allows Readline to insert the pasted text as a single unit without treating |
|
each character as if it had been read from the keyboard. The characters |
|
are inserted as if each one was bound to @code{self-insert} instead of |
|
executing any editing commands. |
|
|
|
Bracketed paste sets the region (the characters between point and the mark) |
|
to the inserted text. It uses the concept of an @emph{active mark}: when the |
|
mark is active, Readline redisplay uses the terminal's standout mode to |
|
denote the region. |
|
|
@item transpose-chars (C-t) |
@item transpose-chars (C-t) |
Drag the character before the cursor forward over |
Drag the character before the cursor forward over |
the character at the cursor, moving the |
the character at the cursor, moving the |
Line 1273 By default, this command is unbound.
|
Line 1433 By default, this command is unbound.
|
|
|
@item kill-line (C-k) |
@item kill-line (C-k) |
Kill the text from point to the end of the line. |
Kill the text from point to the end of the line. |
|
With a negative numeric argument, kill backward from the cursor to the |
|
beginning of the current line. |
|
|
@item backward-kill-line (C-x Rubout) |
@item backward-kill-line (C-x Rubout) |
Kill backward to the beginning of the line. | Kill backward from the cursor to the beginning of the current line. |
| With a negative numeric argument, kill forward from the cursor to the |
| end of the current line. |
|
|
@item unix-line-discard (C-u) |
@item unix-line-discard (C-u) |
Kill backward from the cursor to the beginning of the current line. |
Kill backward from the cursor to the beginning of the current line. |
Line 1294 Kill the word behind point.
|
Line 1458 Kill the word behind point.
|
Word boundaries are the same as @code{backward-word}. |
Word boundaries are the same as @code{backward-word}. |
|
|
@ifset BashFeatures |
@ifset BashFeatures |
@item shell-kill-word () | @item shell-kill-word (M-C-d) |
Kill from point to the end of the current word, or if between |
Kill from point to the end of the current word, or if between |
words, to the end of the next word. |
words, to the end of the next word. |
Word boundaries are the same as @code{shell-forward-word}. |
Word boundaries are the same as @code{shell-forward-word}. |
Line 1304 Kill the word behind point.
|
Line 1468 Kill the word behind point.
|
Word boundaries are the same as @code{shell-backward-word}. |
Word boundaries are the same as @code{shell-backward-word}. |
@end ifset |
@end ifset |
|
|
|
@item shell-transpose-words (M-C-t) |
|
Drag the word before point past the word after point, |
|
moving point past that word as well. |
|
If the insertion point is at the end of the line, this transposes |
|
the last two words on the line. |
|
Word boundaries are the same as @code{shell-forward-word} and |
|
@code{shell-backward-word}. |
|
|
@item unix-word-rubout (C-w) |
@item unix-word-rubout (C-w) |
Kill the word behind point, using white space as a word boundary. |
Kill the word behind point, using white space as a word boundary. |
The killed text is saved on the kill-ring. |
The killed text is saved on the kill-ring. |
Line 1357 leading minus sign, those digits define the argument.
|
Line 1529 leading minus sign, those digits define the argument.
|
If the command is followed by digits, executing @code{universal-argument} |
If the command is followed by digits, executing @code{universal-argument} |
again ends the numeric argument, but is otherwise ignored. |
again ends the numeric argument, but is otherwise ignored. |
As a special case, if this command is immediately followed by a |
As a special case, if this command is immediately followed by a |
character that is neither a digit or minus sign, the argument count | character that is neither a digit nor minus sign, the argument count |
for the next command is multiplied by four. |
for the next command is multiplied by four. |
The argument count is initially one, so executing this function the |
The argument count is initially one, so executing this function the |
first time makes the argument count four, a second time makes the |
first time makes the argument count four, a second time makes the |
Line 1514 Abort the current editing command and
|
Line 1686 Abort the current editing command and
|
ring the terminal's bell (subject to the setting of |
ring the terminal's bell (subject to the setting of |
@code{bell-style}). |
@code{bell-style}). |
|
|
@item do-uppercase-version (M-a, M-b, M-@var{x}, @dots{}) | @item do-lowercase-version (M-A, M-B, M-@var{x}, @dots{}) |
If the metafied character @var{x} is lowercase, run the command | If the metafied character @var{x} is upper case, run the command |
that is bound to the corresponding uppercase character. | that is bound to the corresponding metafied lower case character. |
| The behavior is undefined if @var{x} is already lower case. |
|
|
@item prefix-meta (@key{ESC}) |
@item prefix-meta (@key{ESC}) |
Metafy the next character typed. This is for keyboards |
Metafy the next character typed. This is for keyboards |
Line 1640 Perform history and alias expansion on the current lin
|
Line 1813 Perform history and alias expansion on the current lin
|
@item insert-last-argument (M-. or M-_) |
@item insert-last-argument (M-. or M-_) |
A synonym for @code{yank-last-arg}. |
A synonym for @code{yank-last-arg}. |
|
|
@item operate-and-get-next (C-o) | @item edit-and-execute-command (C-x C-e) |
Accept the current line for execution and fetch the next line | |
relative to the current line from the history for editing. Any | |
argument is ignored. | |
| |
@item edit-and-execute-command (C-xC-e) | |
Invoke an editor on the current command line, and execute the result as shell |
Invoke an editor on the current command line, and execute the result as shell |
commands. |
commands. |
Bash attempts to invoke |
Bash attempts to invoke |
Line 1716 If no compspec is found for the full pathname, an atte
|
Line 1884 If no compspec is found for the full pathname, an atte
|
find a compspec for the portion following the final slash. |
find a compspec for the portion following the final slash. |
If those searches do not result in a compspec, any compspec defined with |
If those searches do not result in a compspec, any compspec defined with |
the @option{-D} option to @code{complete} is used as the default. |
the @option{-D} option to @code{complete} is used as the default. |
|
If there is no default compspec, Bash attempts alias expansion |
|
on the command word as a final resort, and attempts to find a compspec |
|
for the command word from any successful expansion |
|
|
Once a compspec has been found, it is used to generate the list of |
Once a compspec has been found, it is used to generate the list of |
matching words. |
matching words. |
Line 1740 Next, the string specified as the argument to the @opt
|
Line 1911 Next, the string specified as the argument to the @opt
|
is considered. |
is considered. |
The string is first split using the characters in the @env{IFS} |
The string is first split using the characters in the @env{IFS} |
special variable as delimiters. |
special variable as delimiters. |
Shell quoting is honored. | Shell quoting is honored within the string, in order to provide a |
| mechanism for the words to contain shell metacharacters or characters |
| in the value of @env{IFS}. |
Each word is then expanded using |
Each word is then expanded using |
brace expansion, tilde expansion, parameter and variable expansion, |
brace expansion, tilde expansion, parameter and variable expansion, |
command substitution, and arithmetic expansion, |
command substitution, and arithmetic expansion, |
Line 1788 is removed before attempting a match.
|
Line 1961 is removed before attempting a match.
|
Any completion that matches the pattern will be removed from the list. |
Any completion that matches the pattern will be removed from the list. |
A leading @samp{!} negates the pattern; in this case any completion |
A leading @samp{!} negates the pattern; in this case any completion |
not matching the pattern will be removed. |
not matching the pattern will be removed. |
|
If the @code{nocasematch} shell option |
|
(see the description of @code{shopt} in @ref{The Shopt Builtin}) |
|
is enabled, the match is performed without regard to the case |
|
of alphabetic characters. |
|
|
Finally, any prefix and suffix specified with the @option{-P} and @option{-S} |
Finally, any prefix and suffix specified with the @option{-P} and @option{-S} |
options are added to each member of the completion list, and the result is |
options are added to each member of the completion list, and the result is |
Line 1880 matches were generated.
|
Line 2057 matches were generated.
|
@item complete |
@item complete |
@btindex complete |
@btindex complete |
@example |
@example |
@code{complete [-abcdefgjksuv] [-o @var{comp-option}] [-DE] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}] | @code{complete [-abcdefgjksuv] [-o @var{comp-option}] [-DEI] [-A @var{action}] [-G @var{globpat}] |
[-F @var{function}] [-C @var{command}] [-X @var{filterpat}] | [-W @var{wordlist}] [-F @var{function}] [-C @var{command}] [-X @var{filterpat}] |
[-P @var{prefix}] [-S @var{suffix}] @var{name} [@var{name} @dots{}]} |
[-P @var{prefix}] [-S @var{suffix}] @var{name} [@var{name} @dots{}]} |
@code{complete -pr [-DE] [@var{name} @dots{}]} | @code{complete -pr [-DEI] [@var{name} @dots{}]} |
@end example |
@end example |
|
|
Specify how arguments to each @var{name} should be completed. |
Specify how arguments to each @var{name} should be completed. |
Line 1893 reused as input.
|
Line 2070 reused as input.
|
The @option{-r} option removes a completion specification for |
The @option{-r} option removes a completion specification for |
each @var{name}, or, if no @var{name}s are supplied, all |
each @var{name}, or, if no @var{name}s are supplied, all |
completion specifications. |
completion specifications. |
The @option{-D} option indicates that the remaining options and actions should | The @option{-D} option indicates that other supplied options and actions should |
apply to the ``default'' command completion; that is, completion attempted |
apply to the ``default'' command completion; that is, completion attempted |
on a command for which no completion has previously been defined. |
on a command for which no completion has previously been defined. |
The @option{-E} option indicates that the remaining options and actions should | The @option{-E} option indicates that other supplied options and actions should |
apply to ``empty'' command completion; that is, completion attempted on a |
apply to ``empty'' command completion; that is, completion attempted on a |
blank line. |
blank line. |
|
The @option{-I} option indicates that other supplied options and actions should |
|
apply to completion on the initial non-assignment word on the line, or after a |
|
command delimiter such as @samp{;} or @samp{|}, which is usually command |
|
name completion. |
|
If multiple options are supplied, the @option{-D} option takes precedence |
|
over @option{-E}, and both take precedence over @option{-I}. |
|
If any of @option{-D}, @option{-E}, or @option{-I} are supplied, any other |
|
@var{name} arguments are ignored; these completions only apply to the case |
|
specified by the option. |
|
|
The process of applying these completion specifications when word completion |
The process of applying these completion specifications when word completion |
is attempted is described above (@pxref{Programmable Completion}). The | is attempted is described above (@pxref{Programmable Completion}). |
@option{-D} option takes precedence over @option{-E}. | |
|
|
Other options, if specified, have the following meanings. |
Other options, if specified, have the following meanings. |
The arguments to the @option{-G}, @option{-W}, and @option{-X} options |
The arguments to the @option{-G}, @option{-W}, and @option{-X} options |
Line 1932 Perform directory name completion if the compspec gene
|
Line 2117 Perform directory name completion if the compspec gene
|
|
|
@item filenames |
@item filenames |
Tell Readline that the compspec generates filenames, so it can perform any |
Tell Readline that the compspec generates filenames, so it can perform any |
filename-specific processing (like adding a slash to directory names | filename-specific processing (like adding a slash to directory names, |
quoting special characters, or suppressing trailing spaces). |
quoting special characters, or suppressing trailing spaces). |
This option is intended to be used with shell functions specified |
This option is intended to be used with shell functions specified |
with @option{-F}. |
with @option{-F}. |
Line 1941 with @option{-F}.
|
Line 2126 with @option{-F}.
|
Tell Readline not to quote the completed words if they are filenames |
Tell Readline not to quote the completed words if they are filenames |
(quoting filenames is the default). |
(quoting filenames is the default). |
|
|
|
@item nosort |
|
Tell Readline not to sort the list of possible completions alphabetically. |
|
|
@item nospace |
@item nospace |
Tell Readline not to append a space (the default) to words completed at |
Tell Readline not to append a space (the default) to words completed at |
the end of the line. |
the end of the line. |
Line 2084 an error occurs adding a completion specification.
|
Line 2272 an error occurs adding a completion specification.
|
@item compopt |
@item compopt |
@btindex compopt |
@btindex compopt |
@example |
@example |
@code{compopt} [-o @var{option}] [-DE] [+o @var{option}] [@var{name}] | @code{compopt} [-o @var{option}] [-DEI] [+o @var{option}] [@var{name}] |
@end example |
@end example |
Modify completion options for each @var{name} according to the |
Modify completion options for each @var{name} according to the |
@var{option}s, or for the currently-executing completion if no @var{name}s |
@var{option}s, or for the currently-executing completion if no @var{name}s |
Line 2093 If no @var{option}s are given, display the completion
|
Line 2281 If no @var{option}s are given, display the completion
|
@var{name} or the current completion. |
@var{name} or the current completion. |
The possible values of @var{option} are those valid for the @code{complete} |
The possible values of @var{option} are those valid for the @code{complete} |
builtin described above. |
builtin described above. |
The @option{-D} option indicates that the remaining options should | The @option{-D} option indicates that other supplied options should |
apply to the ``default'' command completion; that is, completion attempted |
apply to the ``default'' command completion; that is, completion attempted |
on a command for which no completion has previously been defined. |
on a command for which no completion has previously been defined. |
The @option{-E} option indicates that the remaining options should | The @option{-E} option indicates that other supplied options should |
apply to ``empty'' command completion; that is, completion attempted on a |
apply to ``empty'' command completion; that is, completion attempted on a |
blank line. |
blank line. |
|
The @option{-I} option indicates that other supplied options should |
|
apply to completion on the initial non-assignment word on the line, or after a |
|
command delimiter such as @samp{;} or @samp{|}, which is usually command |
|
name completion. |
|
|
The @option{-D} option takes precedence over @option{-E}. | If multiple options are supplied, the @option{-D} option takes precedence |
| over @option{-E}, and both take precedence over @option{-I} |
|
|
The return value is true unless an invalid option is supplied, an attempt |
The return value is true unless an invalid option is supplied, an attempt |
is made to modify the options for a @var{name} for which no completion |
is made to modify the options for a @var{name} for which no completion |
Line 2117 a shell function and bind it to a particular command u
|
Line 2310 a shell function and bind it to a particular command u
|
|
|
The following function provides completions for the @code{cd} builtin. |
The following function provides completions for the @code{cd} builtin. |
It is a reasonably good example of what shell functions must do when |
It is a reasonably good example of what shell functions must do when |
used for completion. This function uses the word passsed as @code{$2} | used for completion. This function uses the word passed as @code{$2} |
to determine the directory name to complete. You can also use the |
to determine the directory name to complete. You can also use the |
@code{COMP_WORDS} array variable; the current word is indexed by the |
@code{COMP_WORDS} array variable; the current word is indexed by the |
@code{COMP_CWORD} variable. |
@code{COMP_CWORD} variable. |
Line 2147 _comp_cd()
|
Line 2340 _comp_cd()
|
local cur _skipdot _cdpath |
local cur _skipdot _cdpath |
local i j k |
local i j k |
|
|
# Tilde expansion, with side effect of expanding tilde to full pathname | # Tilde expansion, which also expands tilde to full pathname |
case "$2" in |
case "$2" in |
\~*) eval cur="$2" ;; |
\~*) eval cur="$2" ;; |
*) cur=$2 ;; |
*) cur=$2 ;; |
Line 2210 character to the directory name, in case we want to ap
|
Line 2403 character to the directory name, in case we want to ap
|
The @option{-o bashdefault} option brings in the rest of the "Bash default" |
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 completion that Bash adds to the default Readline |
set. These include things like command name completion, variable completion |
set. These include things like command name completion, variable completion |
for words beginning with @samp{@{}, completions containing pathname | for words beginning with @samp{$} or @samp{$@{}, completions containing pathname |
expansion patterns (@pxref{Filename Expansion}), and so on. |
expansion patterns (@pxref{Filename Expansion}), and so on. |
|
|
Once installed using @code{complete}, @code{_comp_cd} will be called every |
Once installed using @code{complete}, @code{_comp_cd} will be called every |
Line 2220 Many more examples -- an extensive collection of compl
|
Line 2413 Many more examples -- an extensive collection of compl
|
the common GNU, Unix, and Linux commands -- are available as part of the |
the common GNU, Unix, and Linux commands -- are available as part of the |
bash_completion project. This is installed by default on many GNU/Linux |
bash_completion project. This is installed by default on many GNU/Linux |
distributions. Originally written by Ian Macdonald, the project now lives |
distributions. Originally written by Ian Macdonald, the project now lives |
at @url{http://bash-completion.alioth.debian.org/}. There are ports for | at @url{https://github.com/scop/bash-completion/}. There are ports for |
other systems such as Solaris and Mac OS X. |
other systems such as Solaris and Mac OS X. |
|
|
An older version of the bash_completion package is distributed with bash |
An older version of the bash_completion package is distributed with bash |