summaryrefslogtreecommitdiff
path: root/doc/readline.0
diff options
context:
space:
mode:
Diffstat (limited to 'doc/readline.0')
-rw-r--r--doc/readline.0212
1 files changed, 113 insertions, 99 deletions
diff --git a/doc/readline.0 b/doc/readline.0
index 5d9f609..4a5a4e9 100644
--- a/doc/readline.0
+++ b/doc/readline.0
@@ -14,64 +14,63 @@ SSYYNNOOPPSSIISS
rreeaaddlliinnee (_c_o_n_s_t _c_h_a_r _*_p_r_o_m_p_t);
CCOOPPYYRRIIGGHHTT
- Readline is Copyright (C) 1989-2004 by the Free Software Foundation,
- Inc.
+ Readline is Copyright (C) 1989-2009 Free Software Foundation, Inc.
DDEESSCCRRIIPPTTIIOONN
rreeaaddlliinnee will read a line from the terminal and return it, using pprroommpptt
- as a prompt. If pprroommpptt is NNUULLLL or the empty string, no prompt is
+ as a prompt. If pprroommpptt is NNUULLLL or the empty string, no prompt is
issued. The line returned is allocated with _m_a_l_l_o_c(3); the caller must
- free it when finished. The line returned has the final newline
+ free it when finished. The line returned has the final newline
removed, so only the text of the line remains.
- rreeaaddlliinnee offers editing capabilities while the user is entering the
- line. By default, the line editing commands are similar to those of
+ rreeaaddlliinnee 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.
- This manual page describes only the most basic use of rreeaaddlliinnee. Much
- more functionality is available; see _T_h_e _G_N_U _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y and _T_h_e
+ This manual page describes only the most basic use of rreeaaddlliinnee. Much
+ more functionality is available; see _T_h_e _G_N_U _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y and _T_h_e
_G_N_U _H_i_s_t_o_r_y _L_i_b_r_a_r_y for additional information.
RREETTUURRNN VVAALLUUEE
- rreeaaddlliinnee returns the text of the line read. A blank line returns the
+ rreeaaddlliinnee returns the text of the line read. A blank line returns the
empty string. If EEOOFF is encountered while reading a line, and the line
- is empty, NNUULLLL is returned. If an EEOOFF is read with a non-empty line,
+ is empty, NNUULLLL is returned. If an EEOOFF is read with a non-empty line,
it is treated as a newline.
NNOOTTAATTIIOONN
An emacs-style notation is used to denote keystrokes. Control keys are
- denoted by C-_k_e_y, e.g., C-n means Control-N. Similarly, _m_e_t_a keys are
- denoted by M-_k_e_y, so M-x means Meta-X. (On keyboards without a _m_e_t_a
- key, M-_x means ESC _x, i.e., press the Escape key then the _x key. This
- makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x means ESC-Control-_x,
- or press the Escape key then hold the Control key while pressing the _x
+ denoted by C-_k_e_y, e.g., C-n means Control-N. Similarly, _m_e_t_a keys are
+ denoted by M-_k_e_y, so M-x means Meta-X. (On keyboards without a _m_e_t_a
+ key, M-_x means ESC _x, i.e., press the Escape key then the _x key. This
+ makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x means ESC-Control-_x,
+ or press the Escape key then hold the Control key while pressing the _x
key.)
Readline commands may be given numeric _a_r_g_u_m_e_n_t_s, 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., kkiillll--lliinnee) causes that command to
- act in a backward direction. Commands whose behavior with arguments
+ 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., kkiillll--lliinnee) causes that command to
+ act in a backward direction. Commands whose behavior with arguments
deviates from this are noted.
- When a command is described as _k_i_l_l_i_n_g text, the text deleted is saved
+ When a command is described as _k_i_l_l_i_n_g text, the text deleted is saved
for possible future retrieval (_y_a_n_k_i_n_g). The killed text is saved in a
_k_i_l_l _r_i_n_g. 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.
IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
- Readline is customized by putting commands in an initialization file
- (the _i_n_p_u_t_r_c file). The name of this file is taken from the value of
- the IINNPPUUTTRRCC environment variable. If that variable is unset, the
+ Readline is customized by putting commands in an initialization file
+ (the _i_n_p_u_t_r_c file). The name of this file is taken from the value of
+ the IINNPPUUTTRRCC environment variable. If that variable is unset, the
default is _~_/_._i_n_p_u_t_r_c. If that file does not exist or cannot be read,
- the ultimate default is _/_e_t_c_/_i_n_p_u_t_r_c. When a program which uses the
+ the ultimate default is _/_e_t_c_/_i_n_p_u_t_r_c. 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.
+ 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.
For example, placing
@@ -79,24 +78,24 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
or
C-Meta-u: universal-argument
- into the _i_n_p_u_t_r_c would make M-C-u execute the readline command _u_n_i_v_e_r_-
+ into the _i_n_p_u_t_r_c would make M-C-u execute the readline command _u_n_i_v_e_r_-
_s_a_l_-_a_r_g_u_m_e_n_t.
- The following symbolic character names are recognized while processing
- key bindings: _D_E_L, _E_S_C, _E_S_C_A_P_E, _L_F_D, _N_E_W_L_I_N_E, _R_E_T, _R_E_T_U_R_N, _R_U_B_O_U_T,
+ The following symbolic character names are recognized while processing
+ key bindings: _D_E_L, _E_S_C, _E_S_C_A_P_E, _L_F_D, _N_E_W_L_I_N_E, _R_E_T, _R_E_T_U_R_N, _R_U_B_O_U_T,
_S_P_A_C_E, _S_P_C, and _T_A_B.
- In addition to command names, readline allows keys to be bound to a
+ In addition to command names, readline allows keys to be bound to a
string that is inserted when the key is pressed (a _m_a_c_r_o).
KKeeyy BBiinnddiinnggss
- The syntax for controlling key bindings in the _i_n_p_u_t_r_c 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 speci-
+ The syntax for controlling key bindings in the _i_n_p_u_t_r_c 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 speci-
fied in one of two ways: as a symbolic key name, possibly with _M_e_t_a_- or
_C_o_n_t_r_o_l_- prefixes, or as a key sequence. The name and key sequence are
- separated by a colon. There can be no whitespace between the name and
+ separated by a colon. There can be no whitespace between the name and
the colon.
When using the form kkeeyynnaammee:_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, _k_e_y_n_a_m_e is the name
@@ -106,15 +105,15 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
Meta-Rubout: backward-kill-word
Control-o: "> output"
- In the above example, _C_-_u is bound to the function uunniivveerrssaall--aarrgguummeenntt,
- _M_-_D_E_L is bound to the function bbaacckkwwaarrdd--kkiillll--wwoorrdd, and _C_-_o is bound to
- run the macro expressed on the right hand side (that is, to insert the
+ In the above example, _C_-_u is bound to the function uunniivveerrssaall--aarrgguummeenntt,
+ _M_-_D_E_L is bound to the function bbaacckkwwaarrdd--kkiillll--wwoorrdd, 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).
- In the second form, ""kkeeyysseeqq"":_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, kkeeyysseeqq differs
- from kkeeyynnaammee 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
+ In the second form, ""kkeeyysseeqq"":_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, kkeeyysseeqq differs
+ from kkeeyynnaammee 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.
"\C-u": universal-argument
@@ -122,10 +121,10 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
"\e[11~": "Function Key 1"
In this example, _C_-_u is again bound to the function uunniivveerrssaall--aarrgguummeenntt.
- _C_-_x _C_-_r is bound to the function rree--rreeaadd--iinniitt--ffiillee, and _E_S_C _[ _1 _1 _~ is
+ _C_-_x _C_-_r is bound to the function rree--rreeaadd--iinniitt--ffiillee, and _E_S_C _[ _1 _1 _~ is
bound to insert the text ``Function Key 1''.
- The full set of GNU Emacs style escape sequences available when speci-
+ The full set of GNU Emacs style escape sequences available when speci-
fying key sequences is
\\CC-- control prefix
\\MM-- meta prefix
@@ -134,7 +133,7 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
\\"" literal ", a double quote
\\'' literal ', a single quote
- In addition to the GNU Emacs style escape sequences, a second set of
+ In addition to the GNU Emacs style escape sequences, a second set of
backslash escapes is available:
\\aa alert (bell)
\\bb backspace
@@ -144,22 +143,22 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
\\rr carriage return
\\tt horizontal tab
\\vv vertical tab
- \\_n_n_n the eight-bit character whose value is the octal value
+ \\_n_n_n the eight-bit character whose value is the octal value
_n_n_n (one to three digits)
- \\xx_H_H the eight-bit character whose value is the hexadecimal
+ \\xx_H_H the eight-bit character whose value is the hexadecimal
value _H_H (one or two hex digits)
- 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
+ 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 '.
- BBaasshh allows the current readline key bindings to be displayed or modi-
- fied with the bbiinndd builtin command. The editing mode may be switched
- during interactive use by using the --oo option to the sseett builtin com-
- mand. Other programs using this library provide similar mechanisms.
- The _i_n_p_u_t_r_c file may be edited and re-read if a program does not pro-
+ BBaasshh allows the current readline key bindings to be displayed or modi-
+ fied with the bbiinndd builtin command. The editing mode may be switched
+ during interactive use by using the --oo option to the sseett builtin com-
+ mand. Other programs using this library provide similar mechanisms.
+ The _i_n_p_u_t_r_c file may be edited and re-read if a program does not pro-
vide any other means to incorporate new bindings.
VVaarriiaabblleess
@@ -169,45 +168,51 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
sseett _v_a_r_i_a_b_l_e_-_n_a_m_e _v_a_l_u_e
- Except where noted, readline variables can take the values OOnn or OOffff
- (without regard to case). Unrecognized variable names are ignored.
- When a variable value is read, empty or null values, "on" (case-insen-
+ Except where noted, readline variables can take the values OOnn or OOffff
+ (without regard to case). Unrecognized variable names are ignored.
+ When a variable value is read, empty or null values, "on" (case-insen-
sitive), and "1" are equivalent to OOnn. All other values are equivalent
to OOffff. The variables and their default values are:
bbeellll--ssttyyllee ((aauuddiibbllee))
- Controls what happens when readline wants to ring the terminal
+ Controls what happens when readline wants to ring the terminal
bell. If set to nnoonnee, readline never rings the bell. If set to
- vviissiibbllee, readline uses a visible bell if one is available. If
+ vviissiibbllee, readline uses a visible bell if one is available. If
set to aauuddiibbllee, readline attempts to ring the terminal's bell.
bbiinndd--ttttyy--ssppeecciiaall--cchhaarrss ((OOnn))
- If set to OOnn, readline attempts to bind the control characters
+ If set to OOnn, readline attempts to bind the control characters
treated specially by the kernel's terminal driver to their read-
line equivalents.
ccoommmmeenntt--bbeeggiinn ((````##''''))
- The string that is inserted in vvii mode when the iinnsseerrtt--ccoommmmeenntt
+ The string that is inserted in vvii mode when the iinnsseerrtt--ccoommmmeenntt
command is executed. This command is bound to MM--## in emacs mode
and to ## in vi command mode.
ccoommpplleettiioonn--iiggnnoorree--ccaassee ((OOffff))
If set to OOnn, readline performs filename matching and completion
in a case-insensitive fashion.
+ ccoommpplleettiioonn--pprreeffiixx--ddiissppllaayy--lleennggtthh ((00))
+ The length in characters of the common prefix of a list of pos-
+ sible completions that is displayed without modification. When
+ set to a value greater than zero, common prefixes longer than
+ this value are replaced with an ellipsis when displaying possi-
+ ble completions.
ccoommpplleettiioonn--qquueerryy--iitteemmss ((110000))
- This determines when the user is queried about viewing the num-
- ber of possible completions generated by the ppoossssiibbllee--ccoommppllee--
- ttiioonnss command. It may be set to any integer value greater than
- or equal to zero. If the number of possible completions is
+ This determines when the user is queried about viewing the num-
+ ber of possible completions generated by the ppoossssiibbllee--ccoommppllee--
+ ttiioonnss 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
+ asked whether or not he wishes to view them; otherwise they are
simply listed on the terminal. A negative value causes readline
to never ask.
ccoonnvveerrtt--mmeettaa ((OOnn))
- If set to OOnn, readline will convert characters with the eighth
+ If set to OOnn, 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
+ prefixing it with an escape character (in effect, using escape
as the _m_e_t_a _p_r_e_f_i_x).
ddiissaabbllee--ccoommpplleettiioonn ((OOffff))
If set to OOnn, readline will inhibit word completion. Completion
- characters will be inserted into the line as if they had been
+ characters will be inserted into the line as if they had been
mapped to sseellff--iinnsseerrtt.
eeddiittiinngg--mmooddee ((eemmaaccss))
Controls whether readline begins with a set of key bindings sim-
@@ -215,61 +220,70 @@ IINNIITTIIAALLIIZZAATTIIOONN FFIILLEE
vvii.
eennaabbllee--kkeeyyppaadd ((OOffff))
When set to OOnn, readline will try to enable the application key-
- pad when it is called. Some systems need this to enable the
+ pad when it is called. Some systems need this to enable the
arrow keys.
eexxppaanndd--ttiillddee ((OOffff))
- If set to oonn, tilde expansion is performed when readline
+ If set to oonn, tilde expansion is performed when readline
attempts word completion.
hhiissttoorryy--pprreesseerrvvee--ppooiinntt ((OOffff))
- If set to oonn, the history code attempts to place point at the
- same location on each history line retrieved with pprreevviioouuss--hhiiss--
+ If set to oonn, the history code attempts to place point at the
+ same location on each history line retrieved with pprreevviioouuss--hhiiss--
ttoorryy or nneexxtt--hhiissttoorryy.
+ hhiissttoorryy--ssiizzee ((00))
+ Set the maximum number of history entries saved in the history
+ list. If set to zero, the number of entries in the history list
+ is not limited.
hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff))
- When set to OOnn, makes readline use a single line for display,
+ When set to OOnn, 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
+ becomes longer than the screen width rather than wrapping to a
new line.
iinnppuutt--mmeettaa ((OOffff))
- If set to OOnn, readline will enable eight-bit input (that is, it
- will not clear the eighth bit in the characters it reads),
+ If set to OOnn, 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
mmeettaa--ffllaagg is a synonym for this variable.
iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[ CC--JJ''''))
- The string of characters that should terminate an incremental
- search without subsequently executing the character as a com-
- mand. If this variable has not been given a value, the charac-
+ The string of characters that should terminate an incremental
+ search without subsequently executing the character as a com-
+ mand. If this variable has not been given a value, the charac-
ters _E_S_C and _C_-_J will terminate an incremental search.
kkeeyymmaapp ((eemmaaccss))
- Set the current readline keymap. The set of legal keymap names
- is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_,
- _v_i_-_c_o_m_m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d;
- _e_m_a_c_s is equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is
- _e_m_a_c_s. The value of eeddiittiinngg--mmooddee also affects the default
+ Set the current readline keymap. The set of legal keymap names
+ is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_,
+ _v_i_-_c_o_m_m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d;
+ _e_m_a_c_s is equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is
+ _e_m_a_c_s. The value of eeddiittiinngg--mmooddee also affects the default
keymap.
mmaarrkk--ddiirreeccttoorriieess ((OOnn))
If set to OOnn, completed directory names have a slash appended.
mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff))
- If set to OOnn, history lines that have been modified are dis-
+ If set to OOnn, history lines that have been modified are dis-
played with a preceding asterisk (**).
mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess ((OOffff))
If set to OOnn, completed names which are symbolic links to direc-
- tories have a slash appended (subject to the value of
+ tories have a slash appended (subject to the value of
mmaarrkk--ddiirreeccttoorriieess).
mmaattcchh--hhiiddddeenn--ffiilleess ((OOnn))
- This variable, when set to OOnn, causes readline to match files
- whose names begin with a `.' (hidden files) when performing
- filename completion, unless the leading `.' is supplied by the
+ This variable, when set to OOnn, 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.
oouuttppuutt--mmeettaa ((OOffff))
- If set to OOnn, readline will display characters with the eighth
+ If set to OOnn, readline will display characters with the eighth
bit set directly rather than as a meta-prefixed escape sequence.
ppaaggee--ccoommpplleettiioonnss ((OOnn))
- If set to OOnn, readline uses an internal _m_o_r_e-like pager to dis-
+ If set to OOnn, readline uses an internal _m_o_r_e-like pager to dis-
play a screenful of possible completions at a time.
pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff))
- If set to OOnn, readline will display completions with matches
- sorted horizontally in alphabetical order, rather than down the
+ If set to OOnn, readline will display completions with matches
+ sorted horizontally in alphabetical order, rather than down the
screen.
+ rreevveerrtt--aallll--aatt--nneewwlliinnee ((OOffff))
+ If set to oonn, readline will undo all changes to history lines
+ before returning when aacccceepptt--lliinnee is executed. By default, his-
+ tory lines may be modified and retain individual undo lists
+ across calls to rreeaaddlliinnee.
sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff))
This alters the default behavior of the completion functions.
If set to oonn, words which have more than one possible completion
@@ -926,4 +940,4 @@ BBUUGGSS
-GNU Readline 5.2 2006 Apr 26 READLINE(3)
+GNU Readline 6.0 2008 May 8 READLINE(3)