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 runs the given command in the window, or
64 if no command is given.
66 Characters typed on the keyboard
67 collect in the window to form
68 a long, continuous document.
73 a contiguous string marked on the screen by reversing its color.
74 If the selected text is a null string, it is indicated by a hairline cursor
75 between two characters.
77 may be edited by mousing and typing.
78 Text is selected by pointing and clicking button 1
79 to make a null-string selection, or by pointing,
80 then sweeping with button 1 pressed.
81 Text may also be selected by double-clicking:
82 just inside a matched delimiter-pair
87 on the right, it selects all text within
88 the pair; at the beginning
89 or end of a line, it selects the line; within or at the edge of an alphanumeric word,
92 Characters typed on the keyboard replace the selected text;
93 if this text is not empty, it is placed in a
95 common to all windows but distinct from that of
98 Programs access the text in the window at a single point
99 maintained automatically by
103 is the location in the text where the next character written by
104 a program to the terminal
105 will appear; afterwards, the output point is the null string
106 beyond the new character.
107 The output point is also the location in the text of the next character
108 that will be read (directly from the text in the window,
109 not from an intervening buffer)
111 Since Unix does not make it possible to know when a program
112 is reading the terminal, lines are sent as they are completed
113 (when the user types a newline character).
115 In general there is text in the window after the output point,
116 usually placed there by typing but occasionally by the editing
117 operations described below.
118 A pending read of the terminal
119 will block until the text after the output point contains
120 a newline, whereupon the read may
121 acquire the text, up to and including the newline.
122 After the read, as described above, the output point will be at
123 the beginning of the next line of text.
124 In normal circumstances, therefore, typed text is delivered
125 to programs a line at a time.
126 Changes made by typing or editing before the text is read will not
127 be seen by the program reading it.
128 Because of the Unix issues mentioned above, a line of text is only editable
129 until it is completed with a newline character, or when hold mode
130 (see below) is enabled.
132 Even when there are newlines in the output text,
134 will not honor reads if the window is in
137 which is indicated by a white cursor and blue text and border.
138 The ESC character toggles hold mode.
140 automatically turn on hold mode to simplify the editing of multi-line text;
141 type ESC when done to allow
145 An EOT character (control-D) behaves exactly like newline except
146 that it is not delivered to a program when read.
147 Thus on an empty line an EOT serves to deliver an end-of-file indication:
148 the read will return zero characters.
149 .\" Like newlines, unread EOTs may be successfully edited out of the text.
150 The BS character (control-H) erases the character before the selected text.
151 The ETB character (control-W) erases any nonalphanumeric characters, then
152 the alphanumeric word just before the selected text.
153 `Alphanumeric' here means non-blanks and non-punctuation.
154 The NAK character (control-U) erases the text after the output point,
155 and not yet read by a program, but not more than one line.
156 All these characters are typed on the keyboard and hence replace
157 the selected text; for example, typing a BS with a word selected
158 places the word in the snarf buffer, removes it from the screen,
159 and erases the character before the word.
161 An ACK character (control-F) or Insert character triggers file name completion
162 for the preceding string (see
165 Text may be moved vertically within the window.
166 A scroll bar on the left of the window shows in its clear portion what fragment of the
167 total output text is visible on the screen, and in its grey part what
168 is above or below view;
169 it measures characters, not lines.
170 Mousing inside the scroll bar moves text:
171 clicking button 1 with the mouse pointing inside the scroll bar
172 brings the line at the top of the
173 window to the cursor's vertical location;
174 button 3 takes the line at the cursor to the top of the window;
175 button 2, treating the scroll bar as a ruler, jumps to the indicated portion
177 Holding a button pressed in the scroll bar will cause the text
178 to scroll continuously until the button is released.
180 Typing down-arrow scrolls forward
181 one third of a window, and up-arrow scrolls back.
182 Typing page-down scrolls forward
183 two thirds of a window, and page-up scrolls back.
184 Typing Home scrolls to the top of the window;
185 typing End scrolls to the end.
187 The DEL character sends an
189 note to all processes in the window's process group.
190 Unlike the other characters, the DEL and arrow
191 keys do not affect the selected text.
192 The left (right) arrow key moves the selection to one character
193 before (after) the current selection.
196 relies on the kernel's terminal processing to handle
197 EOT, so the terminal must be set up with EOT
198 as the ``eof'' character.
202 to establish this when the terminal is created.
205 always treats the DEL keystroke as an interrupt request.
206 In response it sends the terminal's current interrupt character
207 (which need not be DEL).
209 Written output to a window is appended to the end of the window.
210 The window scrolls to display the new output only if the
211 end of the window was visible before the write.
214 changes behavior according to
215 the terminal settings of the running programs.
216 Most programs run with echo enabled.
219 displays and allows editing of the input.
220 Some programs, typically those reading passwords,
221 run with echo disabled.
224 passes keystrokes through directly, without
225 echoing them or buffering until a newline character.
226 These heuristics work well in many cases, but there
227 are a few common ones where they fall short.
228 First, programs using the GNU readline library typically
229 disable terminal echo and perform echoing themselves.
230 The most common example is the shell
232 Disabling the use of readline with
233 .RB `` "set +o emacs" ''
235 usually restores the desired behavior.
236 Second, remote terminal programs such as
238 typically run with echo disabled, relying on the
239 remote system to echo characters as desired.
244 flag to disable this, leaving the terminal in ``cooked'' mode.
245 For similar situations on Unix,
247 button 2 menu has an entry to toggle the forced use of
248 cooked mode, despite the terminal settings.
249 In such cases, it is useful to run
250 .RB `` "stty -echo" ''
251 on the remote system to avoid seeing your input twice.
253 Editing operations are selected from a menu on button 2.
256 operation deletes the selected text
257 from the screen and puts it in the snarf buffer;
259 copies the selected text to the buffer without deleting it;
261 replaces the selected text with the contents of the buffer;
264 copies the snarf buffer to just after the output point, adding a final newline
269 will always place text after the output point; the text so placed
270 will behave exactly as described above. Therefore when pasting
271 text containing newlines after the output point, it may be prudent
272 to turn on hold mode first.
276 menu item sends the contents of the selection (not the snarf buffer) to the
280 If the selection is empty, it sends the white-space-delimited text
281 containing the selection (typing cursor).
282 A typical use of this feature is to tell the editor to find the source of an error
283 by plumbing the file and line information in a compiler's diagnostic.
287 listens for connections on a Unix socket.
288 When a client connects, the
290 writes the window contents to the client and then hangs up.
292 installs the name of this socket in the environment as
299 There should be a program to toggle the current window's hold mode.
307 .RB `` "set +o emacs" ''
308 mode, its handling of interrupts is broken.
311 processes the interrupt but then silently discards the next
314 Unix makes everything harder.