Penguin
Annotated edit history of readline(3) version 4, including all changes. View license author blame.
Rev Author # Line
2 JohnMcPherson 1 !!! NAME
1 AristotlePagaltzis 2
3 readline - get a line from a user with editing
4
5 !!! SYNOPSIS
6
7 __#include <stdio.h>__
8 __#include <readline/readline.h>__
9 __#include <readline/history.h>__
10
11 ''char *''
12 __readline__ (''const char *prompt'');
13
14 !!! COPYRIGHT
15
16 Readline is Copyright (C) 1989-2002 by the Free Software Foundation, Inc.
17
18 !!! DESCRIPTION
19
20 __readline__ will read a line from the terminal and return it, using __prompt__ as a prompt. If __prompt__ is __NULL__ or the empty string, no prompt is issued. The line returned is allocated with ''malloc''(3); the caller must free it when finished. The line returned has the final newline removed, so only the text of the line remains.
21
22 __readline__ offers editing capabilities while the user is entering the line. By default, the line editing commands are similar to those of emacs. A vi-style line editing interface is also available.
23
24 This manual page describes only the most basic use of __readline__. Much more functionality is available; see ''The'' ''GNU Readline Library'' and ''The GNU History Library'' for additional information.
25
26 !!! RETURN VALUE
27
28 __readline__ returns the text of the line read. A blank line returns the empty string. If __EOF__ is encountered while reading a line, and the line is empty, __NULL__ is returned. If an __EOF__ is read with a non-empty line, it is treated as a newline.
29
30 !!! NOTATION
31
32 An emacs-style notation is used to denote keystrokes. Control keys are denoted by C-''key'', e.g., C-n means Control-N. Similarly, ''meta'' keys are denoted by M-''key'', so M-x means Meta-X. (On keyboards without a ''meta'' key, M-''x'' means ESC ''x'', i.e., press the Escape key then the ''x'' key. This makes ESC the ''meta prefix''. The combination M-C-''x'' means ESC-Control-''x'', or press the Escape key then hold the Control key while pressing the ''x'' key.)
33
34 Readline commands may be given numeric ''arguments'', which normally act as a repeat count. Sometimes, however, it is the sign of the argument that is significant. Passing a negative argument to a command that acts in the forward direction (e.g., __kill-line__) causes that command to act in a backward direction. Commands whose behavior with arguments deviates from this are noted.
35
36 When a command is described as ''killing'' text, the text deleted is saved for possible future retrieval (''yanking''). The killed text is saved in a ''kill ring''. Consecutive kills cause the text to be accumulated into one unit, which can be yanked all at once. Commands which do not kill text separate the chunks of text on the kill ring.
37
38 !!! INITIALIZATION FILE
39
40 Readline is customized by putting commands in an initialization file (the ''inputrc'' file). The name of this file is taken from the value of the __INPUTRC__ environment variable. If that variable is unset, the default is ''~__/.inputrc__''. When a program which uses the readline library starts up, the init file is read, and the key bindings and variables are set. There are only a few basic constructs allowed in the readline init file. Blank lines are ignored. Lines beginning with a __#__ are comments. Lines beginning with a __$__ indicate conditional constructs. Other lines denote key bindings and variable settings. Each program using this library may add its own commands and bindings.
41
42 For example, placing
43 M-Control-u: universal-argument
44 or
45 C-Meta-u: universal-argument
46 into the ''inputrc'' would make M-C-u execute the readline command ''universal-argument''.
47
48 The following symbolic character names are recognized while processing key bindings: ''DEL'', ''ESC'', ''ESCAPE'', ''LFD'', ''NEWLINE'', ''RET'', ''RETURN'', ''RUBOUT'', ''SPACE'', ''SPC'', and ''TAB''.
49
50 In addition to command names, readline allows keys to be bound to a string that is inserted when the key is pressed (a ''macro'').
51
52 !! Key Bindings
53
54 The syntax for controlling key bindings in the ''inputrc'' file is simple. All that is required is the name of the command or the text of a macro and a key sequence to which it should be bound. The name may be specified in one of two ways: as a symbolic key name, possibly with ''Meta-'' or ''Control-'' prefixes, or as a key sequence.
55
56 When using the form __keyname__:''function-name'' or ''macro'', ''keyname'' is the name of a key spelled out in English. For example:
57
58 Control-u: universal-argument
59 Meta-Rubout: backward-kill-word
60 Control-o: "> output"
61
62 In the above example, ''C-u'' is bound to the function __universal-argument__, ''M-DEL'' is bound to the function __backward-kill-word__, and ''C-o'' is bound to run the macro expressed on the right hand side (that is, to insert the text ``> output'' into the line).
63
64 In the second form, __"keyseq"__:''function-name'' or ''macro'', __keyseq__ differs from __keyname__ above in that strings denoting an entire key sequence may be specified by placing the sequence within double quotes. Some GNU Emacs style key escapes can be used, as in the following example, but the symbolic character names are not recognized.
65
66 "\C-u": universal-argument
67 "\C-x\C-r": re-read-init-file
68 "\e[[11~": "Function Key 1"
69
70 In this example, ''C-u'' is again bound to the function __universal-argument__. ''C-x C-r'' is bound to the function __re-read-init-file__, and ''ESC [[ 1 1 ~'' is bound to insert the text ``Function Key 1''.
71
72 The full set of GNU Emacs style escape sequences available when specifying key sequences is
73 ; __\C-__ : control prefix
74 ; __\M-__ : meta prefix
75 ; __\e__ : an escape character
76 ; __\\__ : backslash
77 ; __\"__ : literal ", a double quote
78 ; __\'__ : literal ', a single quote
79
80 In addition to the GNU Emacs style escape sequences, a second set of backslash escapes is available:
81 ; __\a__ : alert (bell)
82 ; __\b__ : backspace
83 ; __\d__ : delete
84 ; __\f__ : form feed
85 ; __\n__ : newline
86 ; __\r__ : carriage return
87 ; __\t__ : horizontal tab
88 ; __\v__ : vertical tab
89 ; __\__''nnn'' : the eight-bit character whose value is the octal value ''nnn'' (one to three digits)
90 ; __\x__''HH'' : the eight-bit character whose value is the hexadecimal value ''HH'' (one or two hex digits)
91
92 When entering the text of a macro, single or double quotes should be used to indicate a macro definition. Unquoted text is assumed to be a function name. In the macro body, the backslash escapes described above are expanded. Backslash will quote any other character in the macro text, including " and '.
93
94 __Bash__ allows the current readline key bindings to be displayed or modified with the __bind__ builtin command. The editing mode may be switched during interactive use by using the __-o__ option to the __set__ builtin command. Other programs using this library provide similar mechanisms. The ''inputrc'' file may be edited and re-read if a program does not provide any other means to incorporate new bindings.
95
96 !! Variables
97
98 Readline has variables that can be used to further customize its behavior. A variable may be set in the ''inputrc'' file with a statement of the form
99
100 __set__ ''variable-name value''
101
102 Except where noted, readline variables can take the values __On__ or __Off__ (without regard to case). The variables and their default values are:
103
104 ; __bell-style (audible)__ : Controls what happens when readline wants to ring the terminal bell. If set to __none__, readline never rings the bell. If set to __visible__, readline uses a visible bell if one is available. If set to __audible__, readline attempts to ring the terminal's bell.
105 ; __comment-begin (``#'')__ : The string that is inserted in __vi__ mode when the __insert-comment__ command is executed. This command is bound to __M-#__ in emacs mode and to __#__ in vi command mode.
106 ; __completion-ignore-case (Off)__ : If set to __On__, readline performs filename matching and completion in a case-insensitive fashion.
107 ; __completion-query-items (100)__ : This determines when the user is queried about viewing the number of possible completions generated by the __possible-completions__ command. It may be set to any integer value greater than or equal to zero. If the number of possible completions is greater than or equal to the value of this variable, the user is asked whether or not he wishes to view them; otherwise they are simply listed on the terminal. __convert-meta (On)__ If set to __On__, readline will convert characters with the eighth bit set to an ASCII key sequence by stripping the eighth bit and prefixing it with an escape character (in effect, using escape as the ''meta prefix'').
108 ; __disable-completion (Off)__ : If set to __On__, readline will inhibit word completion. Completion characters will be inserted into the line as if they had been mapped to __self-insert__.
109 ; __editing-mode (emacs)__ : Controls whether readline begins with a set of key bindings similar to emacs or vi. __editing-mode__ can be set to either __emacs__ or __vi__.
110 ; __enable-keypad (Off)__ : When set to __On__, readline will try to enable the application keypad when it is called. Some systems need this to enable the arrow keys.
111 ; __expand-tilde (Off)__ : If set to __on__, tilde expansion is performed when readline attempts word completion.
112 ; __history-preserve-point__ : If set to __on__, the history code attempts to place point at the same location on each history line retrived with __previous-history__ or __next-history__.
113 ; __horizontal-scroll-mode (Off)__ : When set to __On__, makes readline use a single line for display, scrolling the input horizontally on a single screen line when it becomes longer than the screen width rather than wrapping to a new line.
114 ; __input-meta (Off)__ : If set to __On__, readline will enable eight-bit input (that is, it will not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. The name __meta-flag__ is a synonym for this variable.
115 ; __isearch-terminators (``C-[[ C-J'')__ : The string of characters that should terminate an incremental search without subsequently executing the character as a command. If this variable has not been given a value, the characters ''ESC'' and ''C-J'' will terminate an incremental search.
116 ; __keymap (emacs)__ : Set the current readline keymap. The set of legal keymap names is ''emacs, emacs-standard, emacs-meta,'' ''emacs-ctlx, vi, vi-move, vi-command'', and ''vi-insert''. ''vi'' is equivalent to ''vi-command''; ''emacs'' is equivalent to ''emacs-standard''. The default value is ''emacs''. The value of __editing-mode__ also affects the default keymap. __mark-directories (On)__ If set to __On__, completed directory names have a slash appended.
117 ; __mark-modified-lines (Off)__ : If set to __On__, history lines that have been modified are displayed with a preceding asterisk (__*__).
118 ; __mark-symlinked-directories (Off)__ : If set to __On__, completed names which are symbolic links to directories have a slash appended (subject to the value of __mark-directories__).
119 ; __match-hidden-files (On)__ : This variable, when set to __On__, causes readline to match files whose names begin with a `.' (hidden files) when performing filename completion, unless the leading `.' is supplied by the user in the filename to be completed.
120 ; __output-meta (Off)__ : If set to __On__, readline will display characters with the eighth bit set directly rather than as a metaprefixed escape sequence.
121 ; __page-completions (On)__ : If set to __On__, readline uses an internal ''more''-like pager to display a screenful of possible completions at a time.
122 ; __print-completions-horizontally (Off)__ : If set to __On__, readline will display completions with matches sorted horizontally in alphabetical order, rather than down the screen.
123 ; __show-all-if-ambiguous (Off)__ : This alters the default behavior of the completion functions. If set to __on__, words which have more than one possible completion cause the matches to be listed immediately instead of ringing the bell.
124 ; __visible-stats (Off)__ : If set to __On__, a character denoting a file's type as reported by ''stat''(2) is appended to the filename when listing possible completions.
125
126 !! Conditional Constructs
127
128 Readline implements a facility similar in spirit to the conditional compilation features of the C preprocessor which allows key bindings and variable settings to be performed as the result of tests. There are four parser directives used.
129
130 ; __$if__ : The __$if__ construct allows bindings to be made based on the editing mode, the terminal being used, or the application using readline. The text of the test extends to the end of the line; no characters are required to isolate it.
131 ;; __mode__ : The __mode=__ form of the __$if__ directive is used to test whether readline is in emacs or vi mode. This may be used in conjunction with the __set keymap__ command, for instance, to set bindings in the ''emacs-standard'' and ''emacsctlx'' keymaps only if readline is starting out in emacs mode.
132 ;; __term__ : The __term=__ form may be used to include terminal-specific key bindings, perhaps to bind the key sequences output by the terminal's function keys. The word on the right side of the __=__ is tested against the full name of the terminal and the portion of the terminal name before the first __-__. This allows ''sun'' to match both ''sun'' and ''sun-cmd'', for instance.
133 ;; __application__ : The __application__ construct is used to include application-specific settings. Each program using the readline library sets the ''application name'', and an initialization file can test for a particular value. This could be used to bind key sequences to functions useful for a specific program. For instance, the following command adds a key sequence that quotes the current or previous word in Bash:
134 __$if__ Bash # Quote the current or previous word
135 "\C-xq": "\eb\"\ef\""
136 __$endif__
137 ; __$endif__ : This command, as seen in the previous example, terminates an __$if__ command.
138 ; __$else__ : Commands in this branch of the __$if__ directive are executed if the test fails.
139 ; __$include__ : This directive takes a single filename as an argument and reads commands and bindings from that file. For example, the following directive would read ''__/etc/inputrc__'':
140 __$include__ ''__/etc/inputrc__''
141
142 !!! SEARCHING
143
144 Readline provides commands for searching through the command history for lines containing a specified string. There are two search modes: ''incremental'' and ''non-incremental''.
145
146 Incremental searches begin before the user has finished typing the search string. As each character of the search string is typed, readline displays the next entry from the history matching the string typed so far. An incremental search requires only as many characters as needed to find the desired history entry. To search backward in the history for a particular string, type __C-r__. Typing __C-s__ searches forward through the history. The characters present in the value of the __isearch-terminators__ variable are used to terminate an incremental search. If that variable has not been assigned a value the ''Escape'' and __C-J__ characters will terminate an incremental search. __C-G__ will abort an incremental search and restore the original line. When the search is terminated, the history entry containing the search string becomes the current line.
147
148 To find other matching entries in the history list, type __C-s__ or __C-r__ as appropriate. This will search backward or forward in the history for the next line matching the search string typed so far. Any other key sequence bound to a readline command will terminate the search and execute that command. For instance, a newline will terminate the search and accept the line, thereby executing the command from the history list. A movement command will terminate the search, make the last line found the current line, and begin editing.
149
150 Non-incremental searches read the entire search string before starting to search for matching history lines. The search string may be typed by the user or be part of the contents of the current line.
151
152 !!! EDITING COMMANDS
153
154 The following is a list of the names of the commands and the default key sequences to which they are bound. Command names without an accompanying key sequence are unbound by default.
155
156 In the following descriptions, ''point'' refers to the current cursor position, and ''mark'' refers to a cursor position saved by the __set-mark__ command. The text between the point and mark is referred to as the ''region''.
157
158 !! Commands for Moving
159
160 ; __beginning-of-line (C-a)__ : Move to the start of the current line.
161 ; __end-of-line (C-e)__ : Move to the end of the line.
162 ; __forward-char (C-f)__ : Move forward a character.
163 ; __backward-char (C-b)__ : Move back a character.
164 ; __forward-word (M-f)__ : Move forward to the end of the next word. Words are composed of alphanumeric characters (letters and digits).
165 ; __backward-word (M-b)__ : Move back to the start of the current or previous word. Words are composed of alphanumeric characters (letters and digits).
166 ; __clear-screen (C-l)__ : Clear the screen leaving the current line at the top of the screen. With an argument, refresh the current line without clearing the screen.
167 ; __redraw-current-line__ : Refresh the current line.
168
169 !! Commands for Manipulating the History
170
171 ; __accept-line (Newline, Return)__ : Accept the line regardless of where the cursor is. If this line is non-empty, it may be added to the history list for future recall with __add_history()__. If the line is a modified history line, the history line is restored to its original state.
172 ; __previous-history (C-p)__ : Fetch the previous command from the history list, moving back in the list.
173 ; __next-history (C-n)__ : Fetch the next command from the history list, moving forward in the list.
174 ; __beginning-of-history (M-<)__ : Move to the first line in the history.
175 ; __end-of-history (M->)__ : Move to the end of the input history, i.e., the line currently being entered.
176 ; __reverse-search-history (C-r)__ : Search backward starting at the current line and moving `up' through the history as necessary. This is an incremental search.
177 ; __forward-search-history (C-s)__ : Search forward starting at the current line and moving `down' through the history as necessary. This is an incremental search.
178 ; __non-incremental-reverse-search-history (M-p)__ : Search backward through the history starting at the current line using a non-incremental search for a string supplied by the user.
179 ; __non-incremental-forward-search-history (M-n)__ : Search forward through the history using a nonincremental search for a string supplied by the user.
180 ; __history-search-forward__ : Search forward through the history for the string of characters between the start of the current line and the current cursor position (the ''point''). This is a non-incremental search.
181 ; __history-search-backward__ : Search backward through the history for the string of characters between the start of the current line and the point. This is a non-incremental search.
182 ; __yank-nth-arg (M-C-y)__ : Insert the first argument to the previous command (usually the second word on the previous line) at point. With an argument ''n'', insert the ''n''th word from the previous command (the words in the previous command begin with word 0). A negative argument inserts the ''n''th word from the end of the previous command.
183 ; __yank-last-arg (M-., M-_)__ : Insert the last argument to the previous command (the last word of the previous history entry). With an argument, behave exactly like __yank-nth-arg__. Successive calls to __yank-last-arg__ : move back through the history list, inserting the last argument of each line in turn.
184
185 !! Commands for Changing Text
186
187 ; __delete-char (C-d)__ : Delete the character at point. If point is at the beginning of the line, there are no characters in the line, and the last character typed was not bound to __delete-char__, then return __EOF__.
188 ; __backward-delete-char (Rubout)__ : Delete the character behind the cursor. When given a numeric argument, save the deleted text on the kill ring.
189 ; __forward-backward-delete-char__ : Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cursor is deleted.
190 ; __quoted-insert (C-q, C-v)__ : Add the next character that you type to the line verbatim. This is how to insert characters like __C-q__, for example.
191 ; __tab-insert (M-TAB)__ : Insert a tab character.
192 ; __self-insert (a, b, A, 1, !, ...)__ : Insert the character typed.
193 ; __transpose-chars (C-t)__ : Drag the character before point forward over the character at point, moving point forward as well. If point is at the end of the line, then this transposes the two characters before point. Negative arguments have no effect.
194 ; __transpose-words (M-t)__ : Drag the word before point past the word after point, moving point over that word as well. If point is at the end of the line, this transposes the last two words on the line.
195 ; __upcase-word (M-u)__ : Uppercase the current (or following) word. With a negative argument, uppercase the previous word, but do not move point.
196 ; __downcase-word (M-l)__ : Lowercase the current (or following) word. With a negative argument, lowercase the previous word, but do not move point.
197 ; __capitalize-word (M-c)__ : Capitalize the current (or following) word. With a negative argument, capitalize the previous word, but do not move point.
198 ; __overwrite-mode__ : Toggle overwrite mode. With an explicit positive numeric argument, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects only __emacs__ mode; __vi__ mode does overwrite differently. Each call to ''readline()'' starts in insert mode. In overwrite mode, characters bound to __self-insert__ replace the text at point rather than pushing the text to the right. Characters bound to __backward-delete-char__ replace the character before point with a space. By default, this command is unbound.
199
200 !! Killing and Yanking
201
202 ; __kill-line (C-k)__ : Kill the text from point to the end of the line.
203 ; __backward-kill-line (C-x Rubout)__ : Kill backward to the beginning of the line.
204 ; __unix-line-discard (C-u)__ : Kill backward from point to the beginning of the line. The killed text is saved on the kill-ring.
205 ; __kill-whole-line__ : Kill all characters on the current line, no matter where point is.
206 ; __kill-word (M-d)__ : Kill from point the end of the current word, or if between words, to the end of the next word. Word boundaries are the same as those used by __forward-word__.
207 ; __backward-kill-word (M-Rubout)__ : Kill the word behind point. Word boundaries are the same as those used by __backward-word__.
208 ; __unix-word-rubout (C-w)__ : Kill the word behind point, using white space as a word boundary. The killed text is saved on the kill-ring.
209 ; __delete-horizontal-space (M-\)__ : Delete all spaces and tabs around point.
210 ; __kill-region__ : Kill the text between the point and ''mark'' (saved cursor position). This text is referred to as the ''region''.
211 ; __copy-region-as-kill__ : Copy the text in the region to the kill buffer.
212 ; __copy-backward-word__ : Copy the word before point to the kill buffer. The word boundaries are the same as __backward-word__.
213 ; __copy-forward-word__ : Copy the word following point to the kill buffer. The word boundaries are the same as __forward-word__.
214 ; __yank (C-y)__ : Yank the top of the kill ring into the buffer at point.
215 ; __yank-pop (M-y)__ : Rotate the kill ring, and yank the new top. Only works following __yank__ or __yank-pop__.
216
217 !! Numeric Arguments
218
219 ; __digit-argument (M-0, M-1, ..., M--)__ : Add this digit to the argument already accumulating, or start a new argument. M-- starts a negative argument.
220 ; __universal-argument__ : This is another way to specify an argument. If this command is followed by one or more digits, optionally with a leading minus sign, those digits define the argument. If the command is followed by digits, executing
221 ; __universal-argument__ : again ends the numeric argument, but is otherwise ignored. As a special case, if this command is immediately followed by a character that is neither a digit or minus sign, the argument count for the next command is multiplied by four. The argument count is initially one, so executing this function the first time makes the argument count four, a second time makes the argument count sixteen, and so on.
222
223 !! Completing
224
225 ; __complete (TAB)__ : Attempt to perform completion on the text before point. The actual completion performed is application-specific. __Bash__, for instance, attempts completion treating the text as a variable (if the text begins with __$__), username (if the text begins with __~__), hostname (if the text begins with __@__), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted. __Gdb__, on the other hand, allows completion of program functions and variables, and only attempts filename completion under certain circumstances.
226 ; __possible-completions (M-?)__ : List the possible completions of the text before point.
227 ; __insert-completions (M-*)__ : Insert all completions of the text before point that would have been generated by __possible-completions__.
228 ; __menu-complete__ : Similar to __complete__, but replaces the word to be completed with a single match from the list of possible completions. Repeated execution of __menu-complete__ steps through the list of possible completions, inserting each match in turn. At the end of the list of completions, the bell is rung (subject to the setting of __bell-style__) and the original text is restored. An argument of ''n'' moves ''n'' positions forward in the list of matches; a negative argument may be used to move backward through the list. This command is intended to be bound to TAB, but is unbound by default.
229 ; __delete-char-or-list__ : Deletes the character under the cursor if not at the beginning or end of the line (like __deletechar__). If at the end of the line, behaves identically to __possible-completions__.
230
231 !! Keyboard Macros
232
233 ; __start-kbd-macro (C-x ()__ : Begin saving the characters typed into the current keyboard macro.
234 ; __end-kbd-macro (C-x ))__ : Stop saving the characters typed into the current keyboard macro and store the definition.
235 ; __call-last-kbd-macro (C-x e)__ : Re-execute the last keyboard macro defined, by making the characters in the macro appear as if typed at the keyboard.
236
237 !! Miscellaneous
238
239 ; __re-read-init-file (C-x C-r)__ : Read in the contents of the ''inputrc'' file, and incorporate any bindings or variable assignments found there.
240 ; __abort (C-g)__ : Abort the current editing command and ring the terminal's bell (subject to the setting of __bell-style__).
241 ; __do-uppercase-version (M-a, M-b, M-__''x''__, ...)__ : If the metafied character ''x'' is lowercase, run the command that is bound to the corresponding uppercase character.
242 ; __prefix-meta (ESC)__ : Metafy the next character typed. __ESC f__ is equivalent to __Meta-f__.
243 ; __undo (C-_, C-x C-u)__ : Incremental undo, separately remembered for each line.
244 ; __revert-line (M-r)__ : Undo all changes made to this line. This is like executing the __undo__ command enough times to return the line to its initial state.
245 ; __tilde-expand (M-&)__ : Perform tilde expansion on the current word.
246 ; __set-mark (C-@, M-<space>)__ : Set the mark to the point. If a numeric argument is supplied, the mark is set to that position.
247 ; __exchange-point-and-mark (C-x C-x)__ : Swap the point with the mark. The current cursor position is set to the saved position, and the old cursor position is saved as the mark.
248 ; __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.
249 ; __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 occurrences.
250 ; __insert-comment (M-#)__ : Without a numeric argument, the value of the readline __comment-begin__ variable is inserted at the beginning of the current line. If a numeric argument is supplied, this command acts as a toggle: if the characters at the beginning of the line do not match the value of __comment-begin__, the value is inserted, otherwise the characters in __comment-begin__ are deleted from the beginning of the line. In either case, the line is accepted as if a newline had been typed. The default value of __comment-begin__ makes the current line a shell comment. If a numeric argument causes the comment character to be removed, the line will be executed by the shell.
251 ; __dump-functions__ : Print all of the functions and their key bindings to the readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an ''inputrc'' file.
252 ; __dump-variables__ : Print all of the settable variables and their values to the readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an ''inputrc'' file.
253 ; __dump-macros__ : Print all of the readline key sequences bound to macros and the strings they ouput. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an ''inputrc'' file.
254 ; __emacs-editing-mode (C-e)__ : When in __vi__ command mode, this causes a switch to __emacs__ editing mode.
255 ; __vi-editing-mode (M-C-j)__ : When in __emacs__ editing mode, this causes a switch to __vi__ editing mode.
256
257 !!! DEFAULT KEY BINDINGS
258
259 The following is a list of the default emacs and vi bindings. Characters with the eighth bit set are written as M-<character>, and are referred to as ''metafied'' characters. The printable ASCII characters not mentioned in the list of emacs standard bindings are bound to the __self-insert__ function, which just inserts the given character into the input line. In vi insertion mode, all characters not specifically mentioned are bound to __self-insert__. Characters assigned to signal generation by ''stty''(1) or the terminal driver, such as C-Z or C-C, retain that function. Upper and lower case metafied characters are bound to the same function in the emacs mode meta keymap. The remaining characters are unbound, which causes readline to ring the bell (subject to the setting of the __bell-style__ variable).
260
261 !! Emacs Mode
262
263 Emacs Standard bindings
264
265 ; "C-@" : set-mark
266 ; "C-A" : beginning-of-line
267 ; "C-B" : backward-char
268 ; "C-D" : delete-char
269 ; "C-E" : end-of-line
270 ; "C-F" : forward-char
271 ; "C-G" : abort
272 ; "C-H" : backward-delete-char
273 ; "C-I" : complete
274 ; "C-J" : accept-line
275 ; "C-K" : kill-line
276 ; "C-L" : clear-screen
277 ; "C-M" : accept-line
278 ; "C-N" : next-history
279 ; "C-P" : previous-history
280 ; "C-Q" : quoted-insert
281 ; "C-R" : reverse-search-history
282 ; "C-S" : forward-search-history
283 ; "C-T" : transpose-chars
284 ; "C-U" : unix-line-discard
285 ; "C-V" : quoted-insert
286 ; "C-W" : unix-word-rubout
287 ; "C-Y" : yank
288 ; "C-]" : character-search
289 ; "C-_" : undo
290 ; " " to "/" : self-insert
291 ; "0" to "9" : self-insert
292 ; ":" to "~" : self-insert
293 ; "C-?" : backward-delete-char
294
295 Emacs Meta bindings
296
297 ; "M-C-G" : abort
298 ; "M-C-H" : backward-kill-word
299 ; "M-C-I" : tab-insert
300 ; "M-C-J" : vi-editing-mode
301 ; "M-C-M" : vi-editing-mode
302 ; "M-C-R" : revert-line
303 ; "M-C-Y" : yank-nth-arg
304 ; "M-C-[[" : complete
305 ; "M-C-]" : character-search-backward
306 ; "M-space" : set-mark
307 ; "M-#" : Insert-comment
308 ; "M-&" : Tilde-expand
309 ; "M-*" : Insert-completions
310 ; "M--" : Digit-argument
311 ; "M-." : Yank-last-arg
312 ; "M-0" : Digit-argument
313 ; "M-1" : Digit-argument
314 ; "M-2" : Digit-argument
315 ; "M-3" : Digit-argument
316 ; "M-4" : Digit-argument
317 ; "M-5" : Digit-argument
318 ; "M-6" : Digit-argument
319 ; "M-7" : Digit-argument
320 ; "M-8" : Digit-argument
321 ; "M-9" : Digit-argument
322 ; "M-<" : Beginning-of-history
323 ; "M-=" : Possible-completions
324 ; "M->" : End-of-history
325 ; "M-?" : Possible-completions
326 ; "M-B" : Backward-word
327 ; "M-C" : Capitalize-word
328 ; "M-D" : Kill-word
329 ; "M-F" : Forward-word
330 ; "M-L" : Downcase-word
331 ; "M-N" : Non-incremental-forward-search-history
332 ; "M-P" : Non-incremental-reverse-search-history
333 ; "M-R" : Revert-line
334 ; "M-T" : Transpose-words
335 ; "M-U" : Upcase-word
336 ; "M-Y" : Yank-pop
337 ; "M-\" : Delete-horizontal-space
338 ; "M-~" : Tilde-expand
339 ; "M-C-?" : backward-kill-word
340 ; "M-_" : Yank-last-arg
341
342 Emacs Control-X bindings
343
344 ; "C-XC-G" : abort
345 ; "C-XC-R" : re-read-init-file
346 ; "C-XC-U" : undo
347 ; "C-XC-X" : exchange-point-and-mark
348 ; "C-X(" : start-kbd-macro
349 ; "C-X)" : end-kbd-macro
350 ; "C-XE" : call-last-kbd-macro
351 ; "C-XC-?" : backward-kill-line
352
353 !! VI Mode bindings
354
355 VI Insert Mode functions
356
357 ; "C-D" : vi-eof-maybe
358 ; "C-H" : backward-delete-char
359 ; "C-I" : complete
360 ; "C-J" : accept-line
361 ; "C-M" : accept-line
362 ; "C-R" : reverse-search-history
363 ; "C-S" : forward-search-history
364 ; "C-T" : transpose-chars
365 ; "C-U" : unix-line-discard
366 ; "C-V" : quoted-insert
367 ; "C-W" : unix-word-rubout
368 ; "C-Y" : yank
369 ; "C-[[" vi-movement-mode
370 ; "C-_" undo
371 ; " " to "~" : self-insert
372 ; "C-?" : backward-delete-char
373
374 VI Command Mode functions
375
376 ; "C-D" : vi-eof-maybe
377 ; "C-E" : emacs-editing-mode
378 ; "C-G" : abort
379 ; "C-H" : backward-char
380 ; "C-J" : accept-line
381 ; "C-K" : kill-line
382 ; "C-L" : clear-screen
383 ; "C-M" : accept-line
384 ; "C-N" : next-history
385 ; "C-P" : previous-history
386 ; "C-Q" : quoted-insert
387 ; "C-R" : reverse-search-history
388 ; "C-S" : forward-search-history
389 ; "C-T" : transpose-chars
390 ; "C-U" : unix-line-discard
391 ; "C-V" : quoted-insert
392 ; "C-W" : unix-word-rubout
393 ; "C-Y" : yank
394 ; "C-_" : vi-undo
395 ; " " : forward-char
396 ; "#" : insert-comment
397 ; "$" : end-of-line
398 ; "%" : vi-match
399 ; "&" : vi-tilde-expand
400 ; "*" : vi-complete
401 ; "+" : next-history
402 ; "," : vi-char-search
403 ; "-" : previous-history
404 ; "." : vi-redo
405 ; "/" : vi-search
406 ; "0" : beginning-of-line
407 ; "1" to "9" : vi-arg-digit
408 ; ";" : vi-char-search
409 ; "=" : vi-complete
410 ; "?" : vi-search
411 ; "A" : vi-append-eol
412 ; "B" : vi-prev-word
413 ; "C" : vi-change-to
414 ; "D" : vi-delete-to
415 ; "E" : vi-end-word
416 ; "F" : vi-char-search
417 ; "G" : vi-fetch-history
418 ; "I" : vi-insert-beg
419 ; "N" : vi-search-again
420 ; "P" : vi-put
421 ; "R" : vi-replace
422 ; "S" : vi-subst
423 ; "T" : vi-char-search
424 ; "U" : revert-line
425 ; "W" : vi-next-word
426 ; "X" : backward-delete-char
427 ; "Y" : vi-yank-to
428 ; "\" : vi-complete
429 ; "^" : vi-first-print
430 ; "_" : vi-yank-arg
431 ; "`" : vi-goto-mark
432 ; "a" : vi-append-mode
433 ; "b" : vi-prev-word
434 ; "c" : vi-change-to
435 ; "d" : vi-delete-to
436 ; "e" : vi-end-word
437 ; "f" : vi-char-search
438 ; "h" : backward-char
439 ; "i" : vi-insertion-mode
440 ; "j" : next-history
441 ; "k" : prev-history
442 ; "l" : forward-char
443 ; "m" : vi-set-mark
444 ; "n" : vi-search-again
445 ; "p" : vi-put
446 ; "r" : vi-change-char
447 ; "s" : vi-subst
448 ; "t" : vi-char-search
449 ; "u" : vi-undo
450 ; "w" : vi-next-word
451 ; "x" : vi-delete
452 ; "y" : vi-yank-to
453 ; "|" : vi-column
454 ; "~" : vi-change-case
455
456 !!! SEE ALSO
457
458 * ''The Gnu Readline Library'', Brian Fox and Chet Ramey
459 * ''The Gnu History Library'', Brian Fox and Chet Ramey
460 * ''bash''(1)
461
462 !!! FILES
463
464 ; ''~__/.inputrc__'' : Individual __readline__ initialization file
465
466 !!! AUTHORS
467
468 Brian Fox, Free Software Foundation
469 [mailto:bfox@gnu.org]
470
471 Chet Ramey, Case Western Reserve University
472 [mailto:chet@ins.CWRU.Edu]
473
474 !!! BUG REPORTS
475
476 If you find a bug in __readline,__ you should report it. But first, you should make sure that it really is a bug, and that it appears in the latest version of the __readline__ library that you have.
477
478 Once you have determined that a bug actually exists, mail a bug report to ''bug-readline''@''gnu.org''. If you have a fix, you are welcome to mail that as well! Suggestions and `philosophical' bug reports may be mailed to ''bug-readline''@''gnu.org'' or posted to the Usenet newsgroup __gnu.bash.bug__.
479
480 Comments and bug reports concerning this manual page should be directed to ''chet@ins.CWRU.Edu''.
481
482 !!! BUGS
483
484 It's too big and too slow.
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()