3 9term \- terminal windows
19 is a terminal window program for the X Window System,
20 providing an interface similar to that used on Plan 9.
24 command starts a new window.
28 flag causes button 2 to send the selection immediately, like acme.
29 Otherwise button 2 brings up a menu, described below.
33 option has no effect. It formerly set the scrolling mode,
34 and is recognized to avoid breaking scripts that create new windows.
35 See below for a description of scrolling behavior.
39 option starts the window in forced cooked mode,
46 names a font used to display text, both in
49 and as a default for any programs running in its windows; it also
57 uses the imported value of
59 if set; otherwise it uses the graphics system default.
62 for a full discussion of font syntaxes.)
65 runs the given command in the window, or
67 if no command is given.
69 Characters typed on the keyboard
70 collect in the window to form
71 a long, continuous document.
76 a contiguous string marked on the screen by reversing its color.
77 If the selected text is a null string, it is indicated by a hairline cursor
78 between two characters.
80 may be edited by mousing and typing.
81 Text is selected by pointing and clicking button 1
82 to make a null-string selection, or by pointing,
83 then sweeping with button 1 pressed.
84 Text may also be selected by double-clicking:
85 just inside a matched delimiter-pair
90 on the right, it selects all text within
91 the pair; at the beginning
92 or end of a line, it selects the line; within or at the edge of an alphanumeric word,
95 Characters typed on the keyboard replace the selected text;
96 if this text is not empty, it is placed in a
98 common to all windows but distinct from that of
101 Programs access the text in the window at a single point
102 maintained automatically by
106 is the location in the text where the next character written by
107 a program to the terminal
108 will appear; afterwards, the output point is the null string
109 beyond the new character.
110 The output point is also the location in the text of the next character
111 that will be read (directly from the text in the window,
112 not from an intervening buffer)
114 Since Unix does not make it possible to know when a program
115 is reading the terminal, lines are sent as they are completed
116 (when the user types a newline character).
118 In general there is text in the window after the output point,
119 usually placed there by typing but occasionally by the editing
120 operations described below.
121 A pending read of the terminal
122 will block until the text after the output point contains
123 a newline, whereupon the read may
124 acquire the text, up to and including the newline.
125 After the read, as described above, the output point will be at
126 the beginning of the next line of text.
127 In normal circumstances, therefore, typed text is delivered
128 to programs a line at a time.
129 Changes made by typing or editing before the text is read will not
130 be seen by the program reading it.
131 Because of the Unix issues mentioned above, a line of text is only editable
132 until it is completed with a newline character, or when hold mode
133 (see below) is enabled.
135 Even when there are newlines in the output text,
137 will not honor reads if the window is in
140 which is indicated by a white cursor and blue text and border.
141 The ESC character toggles hold mode.
143 automatically turn on hold mode to simplify the editing of multi-line text;
144 type ESC when done to allow
148 An EOT character (control-D) behaves exactly like newline except
149 that it is not delivered to a program when read.
150 Thus on an empty line an EOT serves to deliver an end-of-file indication:
151 the read will return zero characters.
152 .\" Like newlines, unread EOTs may be successfully edited out of the text.
153 The BS character (control-H) erases the character before the selected text.
154 The ETB character (control-W) erases any nonalphanumeric characters, then
155 the alphanumeric word just before the selected text.
156 `Alphanumeric' here means non-blanks and non-punctuation.
157 The NAK character (control-U) erases the text after the output point,
158 and not yet read by a program, but not more than one line.
159 All these characters are typed on the keyboard and hence replace
160 the selected text; for example, typing a BS with a word selected
161 places the word in the snarf buffer, removes it from the screen,
162 and erases the character before the word.
164 An ACK character (control-F) or Insert character triggers file name completion
165 for the preceding string (see
168 Text may be moved vertically within the window.
169 A scroll bar on the left of the window shows in its clear portion what fragment of the
170 total output text is visible on the screen, and in its grey part what
171 is above or below view;
172 it measures characters, not lines.
173 Mousing inside the scroll bar moves text:
174 clicking button 1 with the mouse pointing inside the scroll bar
175 brings the line at the top of the
176 window to the cursor's vertical location;
177 button 3 takes the line at the cursor to the top of the window;
178 button 2, treating the scroll bar as a ruler, jumps to the indicated portion
180 Holding a button pressed in the scroll bar will cause the text
181 to scroll continuously until the button is released.
183 Typing down-arrow scrolls forward
184 one third of a window, and up-arrow scrolls back.
185 Typing page-down scrolls forward
186 two thirds of a window, and page-up scrolls back.
187 Typing Home scrolls to the top of the window;
188 typing End scrolls to the end.
190 The DEL character sends an
192 note to all processes in the window's process group.
193 Unlike the other characters, the DEL and arrow
194 keys do not affect the selected text.
195 The left (right) arrow key moves the selection to one character
196 before (after) the current selection.
199 relies on the kernel's terminal processing to handle
200 EOT, so the terminal must be set up with EOT
201 as the ``eof'' character.
205 to establish this when the terminal is created.
208 always treats the DEL keystroke as an interrupt request.
209 In response it sends the terminal's current interrupt character
210 (which need not be DEL).
212 Written output to a window is appended to the end of the window.
213 The window scrolls to display the new output only if the
214 end of the window was visible before the write.
217 changes behavior according to
218 the terminal settings of the running programs.
219 Most programs run with echo enabled.
222 displays and allows editing of the input.
223 Some programs, typically those reading passwords,
224 run with echo disabled.
227 passes keystrokes through directly, without
228 echoing them or buffering until a newline character.
229 These heuristics work well in many cases, but there
230 are a few common ones where they fall short.
231 First, programs using the GNU readline library typically
232 disable terminal echo and perform echoing themselves.
233 The most common example is the shell
235 Disabling the use of readline with
236 .RB `` "set +o emacs" ''
238 usually restores the desired behavior.
239 Second, remote terminal programs such as
241 typically run with echo disabled, relying on the
242 remote system to echo characters as desired.
247 flag to disable this, leaving the terminal in ``cooked'' mode.
248 For similar situations on Unix,
250 button 2 menu has an entry to toggle the forced use of
251 cooked mode, despite the terminal settings.
252 In such cases, it is useful to run
253 .RB `` "stty -echo" ''
254 on the remote system to avoid seeing your input twice.
256 Editing operations are selected from a menu on button 2.
259 operation deletes the selected text
260 from the screen and puts it in the snarf buffer;
262 copies the selected text to the buffer without deleting it;
264 replaces the selected text with the contents of the buffer;
267 copies the snarf buffer to just after the output point, adding a final newline
272 will always place text after the output point; the text so placed
273 will behave exactly as described above. Therefore when pasting
274 text containing newlines after the output point, it may be prudent
275 to turn on hold mode first.
279 menu item sends the contents of the selection (not the snarf buffer) to the
283 If the selection is empty, it sends the white-space-delimited text
284 containing the selection (typing cursor).
285 A typical use of this feature is to tell the editor to find the source of an error
286 by plumbing the file and line information in a compiler's diagnostic.
290 menu item searches forward for the contents of the selection within
291 the window. If a match is found, it becomes the new selection and the
292 window scrolls to display it. The search wraps around to the beginning
293 of the windows if the end of the window is reached.
295 For systems without a three-button mouse, the keyboard modifier
296 keys can be used to modify the effect of the main mouse button.
297 On Unix systems, the Control key changes the main button to button 2,
298 and the Alt key changes it to button 3.
299 On Mac systems, the Option key changes the main button to button 2,
300 and the Command key changes it to button 3.
301 Also on Mac systems, the usual keyboard shortcuts
302 Command-C, -V, and -X invoke
303 copy, paste, and cut,
304 as in other programs.
308 listens for connections on a Unix socket.
309 When a client connects, the
311 writes the window contents to the client and then hangs up.
313 installs the name of this socket in the environment as
320 There should be a program to toggle the current window's hold mode.
328 .RB `` "set +o emacs" ''
329 mode, its handling of interrupts is broken.
332 processes the interrupt but then silently discards the next
335 Unix makes everything harder.