2 .\" MAN PAGE COMMENTS to
5 .\" Information Network Services
6 .\" Case Western Reserve University
9 .\" Last Change: Thu Apr 22 18:59:21 EDT 2010
11 .TH READLINE 3 "2010 April 22" "GNU Readline 6.2"
13 .\" File Name macro. This used to be `.PN', for Path Name,
14 .\" but Sun doesn't seem to like that very much.
20 readline \- get a line from a user with editing
26 #include <readline/readline.h>
27 #include <readline/history.h>
34 \fBreadline\fP (\fIconst char *prompt\fP);
37 .if n Readline is Copyright (C) 1989\-2010 Free Software Foundation, Inc.
38 .if t Readline is Copyright \(co 1989\-2010 Free Software Foundation, Inc.
42 will read a line from the terminal
47 is \fBNULL\fP or the empty string, no prompt is issued.
48 The line returned is allocated with
50 the caller must free it when finished. The line returned
51 has the final newline removed, so only the text of the line
55 offers editing capabilities while the user is entering the
57 By default, the line editing commands
58 are similar to those of emacs.
59 A vi\-style line editing interface is also available.
61 This manual page describes only the most basic use of \fBreadline\fP.
62 Much more functionality is available; see
63 \fIThe GNU Readline Library\fP and \fIThe GNU History Library\fP
64 for additional information.
68 returns the text of the line read. A blank line
69 returns the empty string. If
71 is encountered while reading a line, and the line is empty,
75 is read with a non\-empty line, it is
79 An emacs-style notation is used to denote
80 keystrokes. Control keys are denoted by C\-\fIkey\fR, e.g., C\-n
81 means Control\-N. Similarly,
83 keys are denoted by M\-\fIkey\fR, so M\-x means Meta\-X. (On keyboards
86 key, M\-\fIx\fP means ESC \fIx\fP, i.e., press the Escape key
89 key. This makes ESC the \fImeta prefix\fP.
90 The combination M\-C\-\fIx\fP means ESC\-Control\-\fIx\fP,
91 or press the Escape key
92 then hold the Control key while pressing the
96 Readline commands may be given numeric
98 which normally act as a repeat count. Sometimes, however, it is the
99 sign of the argument that is significant. Passing a negative argument
100 to a command that acts in the forward direction (e.g., \fBkill\-line\fP)
101 causes that command to act in a backward direction. Commands whose
102 behavior with arguments deviates from this are noted.
104 When a command is described as \fIkilling\fP text, the text
105 deleted is saved for possible future retrieval
106 (\fIyanking\fP). The killed text is saved in a
107 \fIkill ring\fP. Consecutive kills cause the text to be
108 accumulated into one unit, which can be yanked all at once.
109 Commands which do not kill text separate the chunks of text
111 .SH INITIALIZATION FILE
113 Readline is customized by putting commands in an initialization
114 file (the \fIinputrc\fP file).
115 The name of this file is taken from the value of the
117 environment variable. If that variable is unset, the default is
119 If that file does not exist or cannot be read, the ultimate default is
121 When a program which uses the readline library starts up, the
122 init file is read, and the key bindings and variables are set.
123 There are only a few basic constructs allowed in the
124 readline init file. Blank lines are ignored.
125 Lines beginning with a \fB#\fP are comments.
126 Lines beginning with a \fB$\fP indicate conditional constructs.
127 Other lines denote key bindings and variable settings.
128 Each program using this library may add its own commands
134 M\-Control\-u: universal\-argument
138 C\-Meta\-u: universal\-argument
143 would make M\-C\-u execute the readline command
144 .IR universal\-argument .
146 The following symbolic character names are recognized while
147 processing key bindings:
161 In addition to command names, readline allows keys to be bound
162 to a string that is inserted when the key is pressed (a \fImacro\fP).
166 The syntax for controlling key bindings in the
168 file is simple. All that is required is the name of the
169 command or the text of a macro and a key sequence to which
170 it should be bound. The name may be specified in one of two ways:
171 as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP
172 prefixes, or as a key sequence.
173 The name and key sequence are separated by a colon. There can be no
174 whitespace between the name and the colon.
176 When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP,
178 is the name of a key spelled out in English. For example:
181 Control\-u: universal\-argument
183 Meta\-Rubout: backward\-kill\-word
185 Control\-o: "> output"
188 In the above example,
190 is bound to the function
191 .BR universal\-argument ,
193 is bound to the function
194 .BR backward\-kill\-word ,
197 is bound to run the macro
198 expressed on the right hand side (that is, to insert the text
199 .if t \f(CW> output\fP
203 In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP,
207 above in that strings denoting
208 an entire key sequence may be specified by placing the sequence
209 within double quotes. Some GNU Emacs style key escapes can be
210 used, as in the following example, but the symbolic character names
214 "\eC\-u": universal\-argument
216 "\eC\-x\eC\-r": re\-read\-init\-file
218 "\ee[11~": "Function Key 1"
223 is again bound to the function
224 .BR universal\-argument .
226 is bound to the function
227 .BR re\-read\-init\-file ,
230 is bound to insert the text
231 .if t \f(CWFunction Key 1\fP.
232 .if n ``Function Key 1''.
234 The full set of GNU Emacs style escape sequences available when specifying
252 literal ", a double quote
255 literal ', a single quote
259 In addition to the GNU Emacs style escape sequences, a second
260 set of backslash escapes is available:
289 the eight-bit character whose value is the octal value \fInnn\fP
290 (one to three digits)
293 the eight-bit character whose value is the hexadecimal value \fIHH\fP
294 (one or two hex digits)
298 When entering the text of a macro, single or double quotes should
299 be used to indicate a macro definition. Unquoted text
300 is assumed to be a function name.
301 In the macro body, the backslash escapes described above are expanded.
302 Backslash will quote any other character in the macro text,
306 allows the current readline key bindings to be displayed or modified
309 builtin command. The editing mode may be switched during interactive
314 builtin command. Other programs using this library provide
315 similar mechanisms. The
317 file may be edited and re-read if a program does not provide
318 any other means to incorporate new bindings.
321 Readline has variables that can be used to further customize its
322 behavior. A variable may be set in the
324 file with a statement of the form
327 \fBset\fP \fIvariable\-name\fP \fIvalue\fP
330 Except where noted, readline variables can take the values
334 (without regard to case).
335 Unrecognized variable names are ignored.
336 When a variable value is read, empty or null values, "on" (case-insensitive),
337 and "1" are equivalent to \fBOn\fP. All other values are equivalent to
339 The variables and their default values are:
343 .B bell\-style (audible)
344 Controls what happens when readline wants to ring the terminal bell.
345 If set to \fBnone\fP, readline never rings the bell. If set to
346 \fBvisible\fP, readline uses a visible bell if one is available.
347 If set to \fBaudible\fP, readline attempts to ring the terminal's bell.
349 .B bind\-tty\-special\-chars (On)
350 If set to \fBOn\fP, readline attempts to bind the control characters
351 treated specially by the kernel's terminal driver to their readline
354 .B comment\-begin (``#'')
355 The string that is inserted in \fBvi\fP mode when the
358 This command is bound to
364 .B completion\-display\-width (-1)
365 The number of screen columns used to display possible matches
366 when performing completion.
367 The value is ignored if it is less than 0 or greater than the terminal
369 A value of 0 will cause matches to be displayed one per line.
370 The default value is -1.
372 .B completion\-ignore\-case (Off)
373 If set to \fBOn\fP, readline performs filename matching and completion
374 in a case\-insensitive fashion.
376 .B completion\-map\-case (Off)
377 If set to \fBOn\fP, and \fBcompletion\-ignore\-case\fP is enabled, readline
378 treats hyphens (\fI\-\fP) and underscores (\fI_\fP) as equivalent when
379 performing case\-insensitive filename matching and completion.
381 .B completion\-prefix\-display\-length (0)
382 The length in characters of the common prefix of a list of possible
383 completions that is displayed without modification. When set to a
384 value greater than zero, common prefixes longer than this value are
385 replaced with an ellipsis when displaying possible completions.
387 .B completion\-query\-items (100)
388 This determines when the user is queried about viewing
389 the number of possible completions
390 generated by the \fBpossible\-completions\fP command.
391 It may be set to any integer value greater than or equal to
392 zero. If the number of possible completions is greater than
393 or equal to the value of this variable, the user is asked whether
394 or not he wishes to view them; otherwise they are simply listed
395 on the terminal. A negative value causes readline to never ask.
397 .B convert\-meta (On)
398 If set to \fBOn\fP, readline will convert characters with the
399 eighth bit set to an ASCII key sequence
400 by stripping the eighth bit and prefixing it with an
401 escape character (in effect, using escape as the \fImeta prefix\fP).
403 .B disable\-completion (Off)
404 If set to \fBOn\fP, readline will inhibit word completion. Completion
405 characters will be inserted into the line as if they had been
406 mapped to \fBself-insert\fP.
408 .B editing\-mode (emacs)
409 Controls whether readline begins with a set of key bindings similar
417 .B echo\-control\-characters (On)
418 When set to \fBOn\fP, on operating systems that indicate they support it,
419 readline echoes a character corresponding to a signal generated from the
422 .B enable\-keypad (Off)
423 When set to \fBOn\fP, readline will try to enable the application
424 keypad when it is called. Some systems need this to enable the
427 .B enable\-meta\-key (On)
428 When set to \fBOn\fP, readline will try to enable any meta modifier
429 key the terminal claims to support when it is called. On many terminals,
430 the meta key is used to send eight-bit characters.
432 .B expand\-tilde (Off)
433 If set to \fBon\fP, tilde expansion is performed when readline
434 attempts word completion.
436 .B history\-preserve\-point (Off)
437 If set to \fBon\fP, the history code attempts to place point at the
438 same location on each history line retrieved with \fBprevious-history\fP
439 or \fBnext-history\fP.
442 Set the maximum number of history entries saved in the history list. If
443 set to zero, the number of entries in the history list is not limited.
445 .B horizontal\-scroll\-mode (Off)
446 When set to \fBOn\fP, makes readline use a single line for display,
447 scrolling the input horizontally on a single screen line when it
448 becomes longer than the screen width rather than wrapping to a new line.
451 If set to \fBOn\fP, readline will enable eight-bit input (that is,
452 it will not clear the eighth bit in the characters it reads),
453 regardless of what the terminal claims it can support. The name
455 is a synonym for this variable.
457 .B isearch\-terminators (``C\-[ C\-J'')
458 The string of characters that should terminate an incremental
459 search without subsequently executing the character as a command.
460 If this variable has not been given a value, the characters
461 \fIESC\fP and \fIC\-J\fP will terminate an incremental search.
464 Set the current readline keymap. The set of legal keymap names is
465 \fIemacs, emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,
468 \fIvi\fP is equivalent to \fIvi-command\fP; \fIemacs\fP is
469 equivalent to \fIemacs-standard\fP. The default value is
473 also affects the default keymap.
475 .B mark\-directories (On)
476 If set to \fBOn\fP, completed directory names have a slash
479 .B mark\-modified\-lines (Off)
480 If set to \fBOn\fP, history lines that have been modified are displayed
481 with a preceding asterisk (\fB*\fP).
483 .B mark\-symlinked\-directories (Off)
484 If set to \fBOn\fP, completed names which are symbolic links to directories
485 have a slash appended (subject to the value of
486 \fBmark\-directories\fP).
488 .B match\-hidden\-files (On)
489 This variable, when set to \fBOn\fP, causes readline to match files whose
490 names begin with a `.' (hidden files) when performing filename
492 If set to \fBOff\fP, the leading `.' must be
493 supplied by the user in the filename to be completed.
495 .B output\-meta (Off)
496 If set to \fBOn\fP, readline will display characters with the
497 eighth bit set directly rather than as a meta-prefixed escape
500 .B page\-completions (On)
501 If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager
502 to display a screenful of possible completions at a time.
504 .B print\-completions\-horizontally (Off)
505 If set to \fBOn\fP, readline will display completions with matches
506 sorted horizontally in alphabetical order, rather than down the screen.
508 .B revert\-all\-at\-newline (Off)
509 If set to \fBon\fP, readline will undo all changes to history lines
510 before returning when \fBaccept\-line\fP is executed. By default,
511 history lines may be modified and retain individual undo lists across
512 calls to \fBreadline\fP.
514 .B show\-all\-if\-ambiguous (Off)
515 This alters the default behavior of the completion functions. If
518 words which have more than one possible completion cause the
519 matches to be listed immediately instead of ringing the bell.
521 .B show\-all\-if\-unmodified (Off)
522 This alters the default behavior of the completion functions in
523 a fashion similar to \fBshow\-all\-if\-ambiguous\fP.
526 words which have more than one possible completion without any
527 possible partial completion (the possible completions don't share
528 a common prefix) cause the matches to be listed immediately instead
531 .B skip\-completed\-text (Off)
532 If set to \fBOn\fP, this alters the default completion behavior when
533 inserting a single match into the line. It's only active when
534 performing completion in the middle of a word. If enabled, readline
535 does not insert characters from the completion that match characters
536 after point in the word being completed, so portions of the word
537 following the cursor are not duplicated.
539 .B visible\-stats (Off)
540 If set to \fBOn\fP, a character denoting a file's type as reported
541 by \fIstat\fP(2) is appended to the filename when listing possible
544 .SS Conditional Constructs
546 Readline implements a facility similar in spirit to the conditional
547 compilation features of the C preprocessor which allows key
548 bindings and variable settings to be performed as the result
549 of tests. There are four parser directives used.
553 construct allows bindings to be made based on the
554 editing mode, the terminal being used, or the application using
555 readline. The text of the test extends to the end of the line;
556 no characters are required to isolate it.
559 The \fBmode=\fP form of the \fB$if\fP directive is used to test
560 whether readline is in emacs or vi mode.
561 This may be used in conjunction
562 with the \fBset keymap\fP command, for instance, to set bindings in
563 the \fIemacs-standard\fP and \fIemacs-ctlx\fP keymaps only if
564 readline is starting out in emacs mode.
566 The \fBterm=\fP form may be used to include terminal-specific
567 key bindings, perhaps to bind the key sequences output by the
568 terminal's function keys. The word on the right side of the
570 is tested against the full name of the terminal and the portion
571 of the terminal name before the first \fB\-\fP. This allows
578 .IP \fBapplication\fP
579 The \fBapplication\fP construct is used to include
580 application-specific settings. Each program using the readline
581 library sets the \fIapplication name\fP, and an initialization
582 file can test for a particular value.
583 This could be used to bind key sequences to functions useful for
584 a specific program. For instance, the following command adds a
585 key sequence that quotes the current or previous word in Bash:
590 # Quote the current or previous word
591 "\eC-xq": "\eeb\e"\eef\e""
597 This command, as seen in the previous example, terminates an
600 Commands in this branch of the \fB$if\fP directive are executed if
603 This directive takes a single filename as an argument and reads commands
604 and bindings from that file. For example, the following directive
605 would read \fI/etc/inputrc\fP:
609 \fB$include\fP \^ \fI/etc/inputrc\fP
614 Readline provides commands for searching through the command history
615 for lines containing a specified string.
616 There are two search modes:
619 .IR non-incremental .
621 Incremental searches begin before the user has finished typing the
623 As each character of the search string is typed, readline displays
624 the next entry from the history matching the string typed so far.
625 An incremental search requires only as many characters as needed to
626 find the desired history entry.
627 To search backward in the history for a particular string, type
628 \fBC\-r\fP. Typing \fBC\-s\fP searches forward through the history.
629 The characters present in the value of the \fBisearch-terminators\fP
630 variable are used to terminate an incremental search.
631 If that variable has not been assigned a value the \fIEscape\fP and
632 \fBC\-J\fP characters will terminate an incremental search.
633 \fBC\-G\fP will abort an incremental search and restore the original
635 When the search is terminated, the history entry containing the
636 search string becomes the current line.
638 To find other matching entries in the history list, type \fBC\-s\fP or
639 \fBC\-r\fP as appropriate.
640 This will search backward or forward in the history for the next
641 line matching the search string typed so far.
642 Any other key sequence bound to a readline command will terminate
643 the search and execute that command.
644 For instance, a newline will terminate the search and accept
645 the line, thereby executing the command from the history list.
646 A movement command will terminate the search, make the last line found
647 the current line, and begin editing.
649 Non-incremental searches read the entire search string before starting
650 to search for matching history lines. The search string may be
651 typed by the user or be part of the contents of the current line.
654 The following is a list of the names of the commands and the default
655 key sequences to which they are bound.
656 Command names without an accompanying key sequence are unbound by default.
658 In the following descriptions, \fIpoint\fP refers to the current cursor
659 position, and \fImark\fP refers to a cursor position saved by the
660 \fBset\-mark\fP command.
661 The text between the point and mark is referred to as the \fIregion\fP.
662 .SS Commands for Moving
666 .B beginning\-of\-line (C\-a)
667 Move to the start of the current line.
669 .B end\-of\-line (C\-e)
670 Move to the end of the line.
672 .B forward\-char (C\-f)
673 Move forward a character.
675 .B backward\-char (C\-b)
676 Move back a character.
678 .B forward\-word (M\-f)
679 Move forward to the end of the next word. Words are composed of
680 alphanumeric characters (letters and digits).
682 .B backward\-word (M\-b)
683 Move back to the start of the current or previous word. Words are
684 composed of alphanumeric characters (letters and digits).
686 .B clear\-screen (C\-l)
687 Clear the screen leaving the current line at the top of the screen.
688 With an argument, refresh the current line without clearing the
691 .B redraw\-current\-line
692 Refresh the current line.
694 .SS Commands for Manipulating the History
698 .B accept\-line (Newline, Return)
699 Accept the line regardless of where the cursor is.
701 non-empty, it may be added to the history list for future recall with
703 If the line is a modified history line, the history line is restored to its original state.
705 .B previous\-history (C\-p)
706 Fetch the previous command from the history list, moving back in
709 .B next\-history (C\-n)
710 Fetch the next command from the history list, moving forward in the
713 .B beginning\-of\-history (M\-<)
714 Move to the first line in the history.
716 .B end\-of\-history (M\->)
717 Move to the end of the input history, i.e., the line currently being
720 .B reverse\-search\-history (C\-r)
721 Search backward starting at the current line and moving `up' through
722 the history as necessary. This is an incremental search.
724 .B forward\-search\-history (C\-s)
725 Search forward starting at the current line and moving `down' through
726 the history as necessary. This is an incremental search.
728 .B non\-incremental\-reverse\-search\-history (M\-p)
729 Search backward through the history starting at the current line
730 using a non-incremental search for a string supplied by the user.
732 .B non\-incremental\-forward\-search\-history (M\-n)
733 Search forward through the history using a non-incremental search
734 for a string supplied by the user.
736 .B history\-search\-forward
737 Search forward through the history for the string of characters
738 between the start of the current line and the current cursor
739 position (the \fIpoint\fP).
740 This is a non-incremental search.
742 .B history\-search\-backward
743 Search backward through the history for the string of characters
744 between the start of the current line and the point.
745 This is a non-incremental search.
747 .B yank\-nth\-arg (M\-C\-y)
748 Insert the first argument to the previous command (usually
749 the second word on the previous line) at point.
752 insert the \fIn\fPth word from the previous command (the words
753 in the previous command begin with word 0). A negative argument
754 inserts the \fIn\fPth word from the end of the previous command.
755 Once the argument \fIn\fP is computed, the argument is extracted
756 as if the "!\fIn\fP" history expansion had been specified.
759 yank\-last\-arg (M\-.\^, M\-_\^)
760 Insert the last argument to the previous command (the last word of
761 the previous history entry). With an argument,
762 behave exactly like \fByank\-nth\-arg\fP.
763 Successive calls to \fByank\-last\-arg\fP move back through the history
764 list, inserting the last argument of each line in turn.
765 The history expansion facilities are used to extract the last argument,
766 as if the "!$" history expansion had been specified.
768 .SS Commands for Changing Text
772 .B delete\-char (C\-d)
773 Delete the character at point. If point is at the
774 beginning of the line, there are no characters in the line, and
775 the last character typed was not bound to \fBdelete\-char\fP, then return
779 .B backward\-delete\-char (Rubout)
780 Delete the character behind the cursor. When given a numeric argument,
781 save the deleted text on the kill ring.
783 .B forward\-backward\-delete\-char
784 Delete the character under the cursor, unless the cursor is at the
785 end of the line, in which case the character behind the cursor is
788 .B quoted\-insert (C\-q, C\-v)
789 Add the next character that you type to the line verbatim. This is
790 how to insert characters like \fBC\-q\fP, for example.
792 .B tab\-insert (M-TAB)
793 Insert a tab character.
795 .B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...)
796 Insert the character typed.
798 .B transpose\-chars (C\-t)
799 Drag the character before point forward over the character at point,
800 moving point forward as well.
801 If point is at the end of the line, then this transposes
802 the two characters before point.
803 Negative arguments have no effect.
805 .B transpose\-words (M\-t)
806 Drag the word before point past the word after point,
807 moving point over that word as well.
808 If point is at the end of the line, this transposes
809 the last two words on the line.
811 .B upcase\-word (M\-u)
812 Uppercase the current (or following) word. With a negative argument,
813 uppercase the previous word, but do not move point.
815 .B downcase\-word (M\-l)
816 Lowercase the current (or following) word. With a negative argument,
817 lowercase the previous word, but do not move point.
819 .B capitalize\-word (M\-c)
820 Capitalize the current (or following) word. With a negative argument,
821 capitalize the previous word, but do not move point.
824 Toggle overwrite mode. With an explicit positive numeric argument,
825 switches to overwrite mode. With an explicit non-positive numeric
826 argument, switches to insert mode. This command affects only
827 \fBemacs\fP mode; \fBvi\fP mode does overwrite differently.
828 Each call to \fIreadline()\fP starts in insert mode.
829 In overwrite mode, characters bound to \fBself\-insert\fP replace
830 the text at point rather than pushing the text to the right.
831 Characters bound to \fBbackward\-delete\-char\fP replace the character
832 before point with a space. By default, this command is unbound.
834 .SS Killing and Yanking
839 Kill the text from point to the end of the line.
841 .B backward\-kill\-line (C\-x Rubout)
842 Kill backward to the beginning of the line.
844 .B unix\-line\-discard (C\-u)
845 Kill backward from point to the beginning of the line.
846 The killed text is saved on the kill-ring.
847 .\" There is no real difference between this and backward-kill-line
850 Kill all characters on the current line, no matter where point is.
853 Kill from point the end of the current word, or if between
854 words, to the end of the next word. Word boundaries are the same as
855 those used by \fBforward\-word\fP.
857 .B backward\-kill\-word (M\-Rubout)
858 Kill the word behind point.
859 Word boundaries are the same as those used by \fBbackward\-word\fP.
861 .B unix\-word\-rubout (C\-w)
862 Kill the word behind point, using white space as a word boundary.
863 The killed text is saved on the kill-ring.
865 .B unix\-filename\-rubout
866 Kill the word behind point, using white space and the slash character
867 as the word boundaries.
868 The killed text is saved on the kill-ring.
870 .B delete\-horizontal\-space (M\-\e)
871 Delete all spaces and tabs around point.
874 Kill the text between the point and \fImark\fP (saved cursor position).
875 This text is referred to as the \fIregion\fP.
877 .B copy\-region\-as\-kill
878 Copy the text in the region to the kill buffer.
880 .B copy\-backward\-word
881 Copy the word before point to the kill buffer.
882 The word boundaries are the same as \fBbackward\-word\fP.
884 .B copy\-forward\-word
885 Copy the word following point to the kill buffer.
886 The word boundaries are the same as \fBforward\-word\fP.
889 Yank the top of the kill ring into the buffer at point.
892 Rotate the kill ring, and yank the new top. Only works following
897 .SS Numeric Arguments
901 .B digit\-argument (M\-0, M\-1, ..., M\-\-)
902 Add this digit to the argument already accumulating, or start a new
903 argument. M\-\- starts a negative argument.
905 .B universal\-argument
906 This is another way to specify an argument.
907 If this command is followed by one or more digits, optionally with a
908 leading minus sign, those digits define the argument.
909 If the command is followed by digits, executing
910 .B universal\-argument
911 again ends the numeric argument, but is otherwise ignored.
912 As a special case, if this command is immediately followed by a
913 character that is neither a digit or minus sign, the argument count
914 for the next command is multiplied by four.
915 The argument count is initially one, so executing this function the
916 first time makes the argument count four, a second time makes the
917 argument count sixteen, and so on.
924 Attempt to perform completion on the text before point.
925 The actual completion performed is application-specific.
927 for instance, attempts completion treating the text as a variable
928 (if the text begins with \fB$\fP), username (if the text begins with
929 \fB~\fP), hostname (if the text begins with \fB@\fP), or
930 command (including aliases and functions) in turn. If none
931 of these produces a match, filename completion is attempted.
934 allows completion of program functions and variables, and
935 only attempts filename completion under certain circumstances.
937 .B possible\-completions (M\-?)
938 List the possible completions of the text before point.
939 When displaying completions, readline sets the number of columns used
940 for display to the value of \fBcompletion-display-width\fP, the value of
941 the environment variable
944 or the screen width, in that order.
946 .B insert\-completions (M\-*)
947 Insert all completions of the text before point
948 that would have been generated by
949 \fBpossible\-completions\fP.
952 Similar to \fBcomplete\fP, but replaces the word to be completed
953 with a single match from the list of possible completions.
954 Repeated execution of \fBmenu\-complete\fP steps through the list
955 of possible completions, inserting each match in turn.
956 At the end of the list of completions, the bell is rung
957 (subject to the setting of \fBbell\-style\fP)
958 and the original text is restored.
959 An argument of \fIn\fP moves \fIn\fP positions forward in the list
960 of matches; a negative argument may be used to move backward
962 This command is intended to be bound to \fBTAB\fP, but is unbound
965 .B menu\-complete-\backward
966 Identical to \fBmenu\-complete\fP, but moves backward through the list
967 of possible completions, as if \fBmenu\-complete\fP had been given a
968 negative argument. This command is unbound by default.
970 .B delete\-char\-or\-list
971 Deletes the character under the cursor if not at the beginning or
972 end of the line (like \fBdelete-char\fP).
973 If at the end of the line, behaves identically to
974 \fBpossible-completions\fP.
980 .B start\-kbd\-macro (C\-x (\^)
981 Begin saving the characters typed into the current keyboard macro.
983 .B end\-kbd\-macro (C\-x )\^)
984 Stop saving the characters typed into the current keyboard macro
985 and store the definition.
987 .B call\-last\-kbd\-macro (C\-x e)
988 Re-execute the last keyboard macro defined, by making the characters
989 in the macro appear as if typed at the keyboard.
995 .B re\-read\-init\-file (C\-x C\-r)
996 Read in the contents of the \fIinputrc\fP file, and incorporate
997 any bindings or variable assignments found there.
1000 Abort the current editing command and
1001 ring the terminal's bell (subject to the setting of
1004 .B do\-uppercase\-version (M\-a, M\-b, M\-\fIx\fP, ...)
1005 If the metafied character \fIx\fP is lowercase, run the command
1006 that is bound to the corresponding uppercase character.
1008 .B prefix\-meta (ESC)
1009 Metafy the next character typed.
1016 .B undo (C\-_, C\-x C\-u)
1017 Incremental undo, separately remembered for each line.
1019 .B revert\-line (M\-r)
1020 Undo all changes made to this line. This is like executing the
1022 command enough times to return the line to its initial state.
1024 .B tilde\-expand (M\-&)
1025 Perform tilde expansion on the current word.
1027 .B set\-mark (C\-@, M\-<space>)
1028 Set the mark to the point. If a
1029 numeric argument is supplied, the mark is set to that position.
1031 .B exchange\-point\-and\-mark (C\-x C\-x)
1032 Swap the point with the mark. The current cursor position is set to
1033 the saved position, and the old cursor position is saved as the mark.
1035 .B character\-search (C\-])
1036 A character is read and point is moved to the next occurrence of that
1037 character. A negative count searches for previous occurrences.
1039 .B character\-search\-backward (M\-C\-])
1040 A character is read and point is moved to the previous occurrence of that
1041 character. A negative count searches for subsequent occurrences.
1043 .B skip\-csi\-sequence ()
1044 Read enough characters to consume a multi-key sequence such as those
1045 defined for keys like Home and End. Such sequences begin with a
1046 Control Sequence Indicator (CSI), usually ESC\-[. If this sequence is
1047 bound to "\e[", keys producing such sequences will have no effect
1048 unless explicitly bound to a readline command, instead of inserting
1049 stray characters into the editing buffer. This is unbound by default,
1050 but usually bound to ESC\-[.
1052 .B insert\-comment (M\-#)
1053 Without a numeric argument, the value of the readline
1055 variable is inserted at the beginning of the current line.
1056 If a numeric argument is supplied, this command acts as a toggle: if
1057 the characters at the beginning of the line do not match the value
1058 of \fBcomment\-begin\fP, the value is inserted, otherwise
1059 the characters in \fBcomment-begin\fP are deleted from the beginning of
1061 In either case, the line is accepted as if a newline had been typed.
1062 The default value of
1064 makes the current line a shell comment.
1065 If a numeric argument causes the comment character to be removed, the line
1066 will be executed by the shell.
1069 Print all of the functions and their key bindings to the
1070 readline output stream. If a numeric argument is supplied,
1071 the output is formatted in such a way that it can be made part
1072 of an \fIinputrc\fP file.
1075 Print all of the settable variables and their values to the
1076 readline output stream. If a numeric argument is supplied,
1077 the output is formatted in such a way that it can be made part
1078 of an \fIinputrc\fP file.
1081 Print all of the readline key sequences bound to macros and the
1082 strings they output. If a numeric argument is supplied,
1083 the output is formatted in such a way that it can be made part
1084 of an \fIinputrc\fP file.
1086 .B emacs\-editing\-mode (C\-e)
1089 command mode, this causes a switch to
1093 .B vi\-editing\-mode (M\-C\-j)
1096 editing mode, this causes a switch to
1100 .SH DEFAULT KEY BINDINGS
1102 The following is a list of the default emacs and vi bindings.
1103 Characters with the eighth bit set are written as M\-<character>, and
1107 The printable ASCII characters not mentioned in the list of emacs
1108 standard bindings are bound to the
1110 function, which just inserts the given character into the input line.
1111 In vi insertion mode, all characters not specifically mentioned are
1114 Characters assigned to signal generation by
1116 or the terminal driver, such as C-Z or C-C,
1117 retain that function.
1118 Upper and lower case metafied characters are bound to the same function in
1119 the emacs mode meta keymap.
1120 The remaining characters are unbound, which causes readline
1121 to ring the bell (subject to the setting of the
1129 Emacs Standard bindings
1132 "C-A" beginning-of-line
1138 "C-H" backward-delete-char
1145 "C-P" previous-history
1147 "C-R" reverse-search-history
1148 "C-S" forward-search-history
1149 "C-T" transpose-chars
1150 "C-U" unix-line-discard
1152 "C-W" unix-word-rubout
1154 "C-]" character-search
1156 "\^ " to "/" self-insert
1157 "0" to "9" self-insert
1158 ":" to "~" self-insert
1159 "C-?" backward-delete-char
1164 "M-C-H" backward-kill-word
1166 "M-C-J" vi-editing-mode
1167 "M-C-M" vi-editing-mode
1169 "M-C-Y" yank-nth-arg
1171 "M-C-]" character-search-backward
1173 "M-#" insert-comment
1175 "M-*" insert-completions
1176 "M--" digit-argument
1178 "M-0" digit-argument
1179 "M-1" digit-argument
1180 "M-2" digit-argument
1181 "M-3" digit-argument
1182 "M-4" digit-argument
1183 "M-5" digit-argument
1184 "M-6" digit-argument
1185 "M-7" digit-argument
1186 "M-8" digit-argument
1187 "M-9" digit-argument
1188 "M-<" beginning-of-history
1189 "M-=" possible-completions
1190 "M->" end-of-history
1191 "M-?" possible-completions
1193 "M-C" capitalize-word
1197 "M-N" non-incremental-forward-search-history
1198 "M-P" non-incremental-reverse-search-history
1200 "M-T" transpose-words
1203 "M-\e" delete-horizontal-space
1205 "M-C-?" backward-kill-word
1208 Emacs Control-X bindings
1211 "C-XC-R" re-read-init-file
1213 "C-XC-X" exchange-point-and-mark
1214 "C-X(" start-kbd-macro
1215 "C-X)" end-kbd-macro
1216 "C-XE" call-last-kbd-macro
1217 "C-XC-?" backward-kill-line
1220 .SS VI Mode bindings
1226 VI Insert Mode functions
1229 "C-H" backward-delete-char
1233 "C-R" reverse-search-history
1234 "C-S" forward-search-history
1235 "C-T" transpose-chars
1236 "C-U" unix-line-discard
1238 "C-W" unix-word-rubout
1240 "C-[" vi-movement-mode
1242 "\^ " to "~" self-insert
1243 "C-?" backward-delete-char
1245 VI Command Mode functions
1248 "C-E" emacs-editing-mode
1256 "C-P" previous-history
1258 "C-R" reverse-search-history
1259 "C-S" forward-search-history
1260 "C-T" transpose-chars
1261 "C-U" unix-line-discard
1263 "C-W" unix-word-rubout
1274 "-" previous-history
1277 "0" beginning-of-line
1278 "1" to "9" vi-arg-digit
1288 "G" vi-fetch-history
1297 "X" backward-delete-char
1310 "i" vi-insertion-mode
1330 \fIThe Gnu Readline Library\fP, Brian Fox and Chet Ramey
1332 \fIThe Gnu History Library\fP, Brian Fox and Chet Ramey
1340 Individual \fBreadline\fP initialization file
1343 Brian Fox, Free Software Foundation
1347 Chet Ramey, Case Western Reserve University
1351 If you find a bug in
1353 you should report it. But first, you should
1354 make sure that it really is a bug, and that it appears in the latest
1357 library that you have.
1359 Once you have determined that a bug actually exists, mail a
1360 bug report to \fIbug\-readline\fP@\fIgnu.org\fP.
1361 If you have a fix, you are welcome to mail that
1362 as well! Suggestions and `philosophical' bug reports may be mailed
1363 to \fPbug-readline\fP@\fIgnu.org\fP or posted to the Usenet
1367 Comments and bug reports concerning
1368 this manual page should be directed to
1369 .IR chet@ins.CWRU.Edu .
1372 It's too big and too slow.