4 editline \- command-line editing library with history
12 .B "add_history(line)"
17 is a library that provides an line-editing interface with text recall.
18 It is intended to be compatible with the
20 library provided by the Free Software Foundation, but much smaller.
21 The bulk of this manual page describes the user interface.
25 routine returns a line of text with the trailing newline removed.
26 The data is returned in a buffer allocated with
28 so the space should be released with
30 when the calling program is done with it.
31 Before accepting input from the user, the specified
33 is displayed on the terminal.
37 routine makes a copy of the specified
39 and adds it to the internal history list.
41 A program that uses this library provides a simple emacs-like editing
42 interface to its users.
43 A line may be edited before it is sent to the calling program by typing either
44 control characters or escape sequences.
45 A control character, shown as a caret followed by a letter, is typed by
46 holding down the ``control'' key while the letter is typed.
47 For example, ``^A'' is a control-A.
48 An escape sequence is entered by typing the ``escape'' key followed by one or
50 The escape key is abbreviated as ``ESC.''
51 Note that unlike control keys, case matters in escape sequences; ``ESC\ F''
52 is not the same as ``ESC\ f''.
54 An editing command may be typed anywhere on the line, not just at the
56 In addition, a return may also be typed anywhere on the line, not just at
59 Most editing commands may be given a repeat count,
64 To enter a repeat count, type the escape key, the number, and then
65 the command to execute.
66 For example, ``ESC\ 4\ ^f'' moves forward four characters.
67 If a command may be given a repeat count then the text ``[n]'' is given at the
68 end of its description.
70 The following control characters are accepted:
74 ^A Move to the beginning of the line
75 ^B Move left (backwards) [n]
76 ^D Delete character [n]
77 ^E Move to end of line
78 ^F Move right (forwards) [n]
80 ^H Delete character before cursor (backspace key) [n]
81 ^I Complete filename (tab key); see below
82 ^J Done with line (return key)
83 ^K Kill to end of line (or column [n])
85 ^M Done with line (alternate return key)
86 ^N Get next line from history [n]
87 ^P Get previous line from history [n]
88 ^R Search backward (forward if [n]) through history for text;
89 \& must start line if text begins with an uparrow
90 ^T Transpose characters
91 ^V Insert next character, even if it is an edit command
93 ^X^X Exchange current location and mark
94 ^Y Yank back last killed text
95 ^[ Start an escape sequence (escape key)
96 ^]c Move forward to next character ``c''
97 ^? Delete character before cursor (delete key) [n]
101 The following escape sequences are provided.
105 ESC\ ^H Delete previous word (backspace key) [n]
106 ESC\ DEL Delete previous word (delete key) [n]
107 ESC\ SP Set the mark (space key); see ^X^X and ^Y above
108 ESC\ \. Get the last (or [n]'th) word from previous line
109 ESC\ ? Show possible completions; see below
110 ESC\ < Move to start of history
111 ESC\ > Move to end of history
112 ESC\ b Move backward a word [n]
113 ESC\ d Delete word under cursor [n]
114 ESC\ f Move forward a word [n]
115 ESC\ l Make word lowercase [n]
116 ESC\ u Make word uppercase [n]
117 ESC\ y Yank back last killed text
118 ESC\ v Show library version
119 ESC\ w Make area up to mark yankable
120 ESC\ nn Set repeat count to the number nn
121 ESC\ C Read from environment variable ``_C_'', where C is
122 \& an uppercase letter
128 library has a small macro facility.
129 If you type the escape key followed by an uppercase letter,
131 then the contents of the environment variable
133 are read in as if you had typed them at the keyboard.
134 For example, if the variable
136 contains the following:
138 ^A^Kecho '^V^[[H^V^[[2J'^M
140 Then typing ``ESC L'' will move to the beginning of the line, kill the
141 entire line, enter the echo command needed to clear the terminal (if your
142 terminal is like a VT-100), and send the line back to the shell.
146 library also does filename completion.
147 Suppose the root directory has the following files in it:
155 If you type ``rm\ /v'' and then the tab key.
157 will then finish off as much of the name as possible by adding ``munix''.
158 Because the name is not unique, it will then beep.
159 If you type the escape key and a question mark, it will display the
161 If you then type a period and a tab, the library will finish off the filename
165 .RI "rm /v[TAB]" munix .TAB old
168 The tab key is shown by ``[TAB]'' and the automatically-entered text
170 .SH "BUGS AND LIMITATIONS"
171 Cannot handle lines more than 80 columns.
173 Simmule R. Turner <uunet.uu.net!capitol!sysgo!simmy>
174 and Rich $alz <rsalz@osf.org>.
175 Original manual page by DaviD W. Sanderson <dws@ssec.wisc.edu>.