source: trunk/minix/man/man3/editline.3@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 5.2 KB
Line 
1.\" $Revision: 1.1 $
2.TH EDITLINE 3
3.SH NAME
4editline \- command-line editing library with history
5.SH SYNOPSIS
6.ft B
7char *readline(char *\fIprompt\fP)
8.ft P
9.SH DESCRIPTION
10.I Editline
11is a library that provides an line-editing interface with text recall.
12It is intended to be compatible with the
13.I readline
14library provided by the Free Software Foundation, but much smaller.
15The bulk of this manual page describes the user interface.
16.PP
17The
18.I readline
19routine returns a line of text with the trailing newline removed.
20The data is returned in a buffer allocated with
21.IR malloc (3),
22so the space should be released with
23.IR free (3)
24when the calling program is done with it.
25Before accepting input from the user, the specified
26.I prompt
27is displayed on the terminal.
28.PP
29Each line returned is copied to the internal history list, unless it happens
30to be equal to the previous line.
31.SS "User Interface"
32A program that uses this library provides a simple emacs-like editing
33interface to its users.
34A line may be edited before it is sent to the calling program by typing either
35control characters or escape sequences.
36A control character, shown as a caret followed by a letter, is typed by
37holding down the ``control'' key while the letter is typed.
38For example, ``^A'' is a control-A.
39An escape sequence is entered by typing the ``escape'' key followed by one or
40more characters.
41The escape key is abbreviated as ``ESC.''
42Note that unlike control keys, case matters in escape sequences; ``ESC\ F''
43is not the same as ``ESC\ f''.
44.PP
45An editing command may be typed anywhere on the line, not just at the
46beginning.
47In addition, a return may also be typed anywhere on the line, not just at
48the end.
49.PP
50Most editing commands may be given a repeat count,
51.IR n ,
52where
53.I n
54is a number.
55To enter a repeat count, type the escape key, the number, and then
56the command to execute.
57For example, ``ESC\ 4\ ^f'' moves forward four characters.
58If a command may be given a repeat count then the text ``[n]'' is given at the
59end of its description.
60.PP
61The following control characters are accepted:
62.RS
63.nf
64.ta \w'ESC DEL 'u
65^A Move to the beginning of the line
66^B Move left (backwards) [n]
67^D Delete character [n]
68^E Move to end of line
69^F Move right (forwards) [n]
70^G Ring the bell
71^H Delete character before cursor (backspace key) [n]
72^I Complete filename (tab key); see below
73^J Done with line (return key)
74^K Kill to end of line (or column [n])
75^L Redisplay line
76^M Done with line (alternate return key)
77^N Get next line from history [n]
78^P Get previous line from history [n]
79^R Search backward (forward if [n]) through history for text;
80\& must start line if text begins with an uparrow
81^T Transpose characters
82^V Insert next character, even if it is an edit command
83^W Wipe to the mark
84^X^X Exchange current location and mark
85^Y Yank back last killed text
86^[ Start an escape sequence (escape key)
87^]c Move forward to next character ``c''
88^? Delete character before cursor (delete key) [n]
89.fi
90.RE
91.PP
92The following escape sequences are provided.
93.RS
94.nf
95.ta \w'ESC DEL 'u
96ESC\ ^H Delete previous word (backspace key) [n]
97ESC\ DEL Delete previous word (delete key) [n]
98ESC\ SP Set the mark (space key); see ^X^X and ^Y above
99ESC\ \. Get the last (or [n]'th) word from previous line
100ESC\ \? Show possible completions; see below
101ESC\ < Move to start of history
102ESC\ > Move to end of history
103ESC\ b Move backward a word [n]
104ESC\ d Delete word under cursor [n]
105ESC\ f Move forward a word [n]
106ESC\ l Make word lowercase [n]
107ESC\ m Toggle if 8bit chars display normally or with ``M\-'' prefix
108ESC\ u Make word uppercase [n]
109ESC\ y Yank back last killed text
110ESC\ v Show library version
111ESC\ w Make area up to mark yankable
112ESC\ nn Set repeat count to the number nn
113ESC\ C Read from environment variable ``_C_'', where C is
114\& an uppercase letter
115.fi
116.RE
117.PP
118The
119.I editline
120library has a small macro facility.
121If you type the escape key followed by an uppercase letter,
122.IR C ,
123then the contents of the environment variable
124.I _C_
125are read in as if you had typed them at the keyboard.
126For example, if the variable
127.I _L_
128contains the following:
129.RS
130^A^Kecho '^V^[[H^V^[[2J'^M
131.RE
132Then typing ``ESC L'' will move to the beginning of the line, kill the
133entire line, enter the echo command needed to clear the terminal (if your
134terminal is like a VT-100), and send the line back to the shell.
135.PP
136The
137.I editline
138library also does filename completion.
139Suppose the root directory has the following files in it:
140.RS
141.nf
142.ta \w'core 'u
143bin vmunix
144core vmunix.old
145.fi
146.RE
147If you type ``rm\ /v'' and then the tab key.
148.I Editline
149will then finish off as much of the name as possible by adding ``munix''.
150Because the name is not unique, it will then beep.
151If you type the escape key and a question mark, it will display the
152two choices.
153If you then type a period and a tab, the library will finish off the filename
154for you:
155.RS
156.nf
157.RI "rm /v[TAB]" munix .TAB old
158.fi
159.RE
160The tab key is shown by ``[TAB]'' and the automatically-entered text
161is shown in italics.
162.SH "BUGS AND LIMITATIONS"
163Doesn't know how to handle multiple lines.
164.SH AUTHORS
165Simmule R. Turner <uunet.uu.net!capitol!sysgo!simmy>
166and Rich $alz <rsalz@osf.org>.
167Original manual page by DaviD W. Sanderson <dws@ssec.wisc.edu>.
168
169.\" $PchId: editline.3,v 1.3 1996/02/22 21:18:51 philip Exp $
Note: See TracBrowser for help on using the repository browser.