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 initializes windows so that text scrolls;
34 the default is not to scroll.
40 names a font used to display text, both in
43 and as a default for any programs running in its windows; it also
51 uses the imported value of
53 if set; otherwise it uses the graphics system default.
56 runs the given command in the window, or
58 if no command is given.
60 Characters typed on the keyboard
61 collect in the window to form
62 a long, continuous document.
67 a contiguous string marked on the screen by reversing its color.
68 If the selected text is a null string, it is indicated by a hairline cursor
69 between two characters.
71 may be edited by mousing and typing.
72 Text is selected by pointing and clicking button 1
73 to make a null-string selection, or by pointing,
74 then sweeping with button 1 pressed.
75 Text may also be selected by double-clicking:
76 just inside a matched delimiter-pair
81 on the right, it selects all text within
82 the pair; at the beginning
83 or end of a line, it selects the line; within or at the edge of an alphanumeric word,
86 Characters typed on the keyboard replace the selected text;
87 if this text is not empty, it is placed in a
89 common to all windows but distinct from that of
92 Programs access the text in the window at a single point
93 maintained automatically by
97 is the location in the text where the next character written by
98 a program to the terminal
99 will appear; afterwards, the output point is the null string
100 beyond the new character.
101 The output point is also the location in the text of the next character
102 that will be read (directly from the text in the window,
103 not from an intervening buffer)
105 Since Unix does not make it possible to know when a program
106 is reading the terminal, lines are sent as they are completed
107 (when the user types a newline character).
109 In general there is text in the window after the output point,
110 usually placed there by typing but occasionally by the editing
111 operations described below.
112 A pending read of the terminal
113 will block until the text after the output point contains
114 a newline, whereupon the read may
115 acquire the text, up to and including the newline.
116 After the read, as described above, the output point will be at
117 the beginning of the next line of text.
118 In normal circumstances, therefore, typed text is delivered
119 to programs a line at a time.
120 Changes made by typing or editing before the text is read will not
121 be seen by the program reading it.
122 Because of the Unix issues mentioned above, a line of text is only editable
123 until it is completed with a newline character, or when hold mode
124 (see below) is enabled.
126 Even when there are newlines in the output text,
128 will not honor reads if the window is in
131 which is indicated by a white cursor and blue text and border.
132 The ESC character toggles hold mode.
134 automatically turn on hold mode to simplify the editing of multi-line text;
135 type ESC when done to allow
139 An EOT character (control-D) behaves exactly like newline except
140 that it is not delivered to a program when read.
141 Thus on an empty line an EOT serves to deliver an end-of-file indication:
142 the read will return zero characters.
143 .\" Like newlines, unread EOTs may be successfully edited out of the text.
144 The BS character (control-H) erases the character before the selected text.
145 The ETB character (control-W) erases any nonalphanumeric characters, then
146 the alphanumeric word just before the selected text.
147 `Alphanumeric' here means non-blanks and non-punctuation.
148 The NAK character (control-U) erases the text after the output point,
149 and not yet read by a program, but not more than one line.
150 All these characters are typed on the keyboard and hence replace
151 the selected text; for example, typing a BS with a word selected
152 places the word in the snarf buffer, removes it from the screen,
153 and erases the character before the word.
155 An ACK character (control-F) or Insert character triggers file name completion
156 for the preceding string (see
159 Text may be moved vertically within the window.
160 A scroll bar on the left of the window shows in its clear portion what fragment of the
161 total output text is visible on the screen, and in its gray part what
162 is above or below view;
163 it measures characters, not lines.
164 Mousing inside the scroll bar moves text:
165 clicking button 1 with the mouse pointing inside the scroll bar
166 brings the line at the top of the
167 window to the cursor's vertical location;
168 button 3 takes the line at the cursor to the top of the window;
169 button 2, treating the scroll bar as a ruler, jumps to the indicated portion
171 Holding a button pressed in the scroll bar will cause the text
172 to scroll continuously until the button is released.
174 Typing down-arrow scrolls forward
175 one third of a window, and up-arrow scrolls back.
176 Typing page-down scrolls forward
177 two thirds of a window, and page-up scrolls back.
178 Typing Home scrolls to the top of the window;
179 typing End scrolls to the end.
181 The DEL character sends an
183 note to all processes in the window's process group.
184 Unlike the other characters, the DEL and arrow
185 keys do not affect the selected text.
186 The left (right) arrow key moves the selection to one character
187 before (after) the current selection.
190 relies on the kernel's terminal processing to handle
191 EOT and DEL, so the terminal must be set up with EOT
192 as the ``eof'' character and DEL as the ``intr'' character.
196 to establish this when the terminal is created.
198 Normally, written output to a window blocks when
199 the text reaches the end of the screen and the terminal
201 a button 2 menu item toggles scrolling.
204 changes behavior according to
205 the terminal settings of the running programs.
206 Most programs run with echo enabled.
209 displays and allows editing of the input.
210 Some programs, typically those reading passwords,
211 run with echo disabled.
214 passes keystrokes through directly, without
215 echoing them or buffering until a newline character.
216 These heuristics work well in many cases, but there
217 are a few common ones where they fall short.
218 First, programs using the GNU readline library typically
219 disable terminal echo and perform echoing themselves.
220 The most common example is the shell
222 Disabling the use of readline with
223 .RB `` "set +o emacs" ''
225 usually restores the desired behavior.
226 Second, remote terminal programs such as
228 typically run with echo disabled, relying on the
229 remote system to echo characters as desired.
234 flag to disable this, leaving the terminal in ``cooked'' mode.
235 For similar situations on Unix,
237 button 2 menu has an entry to toggle the forced use of
238 cooked mode, despite the terminal settings.
239 In such cases, it is useful to run
240 .RB `` "stty -echo" ''
241 on the remote system to avoid seeing your input twice.
243 Editing operations are selected from a menu on button 2.
246 operation deletes the selected text
247 from the screen and puts it in the snarf buffer;
249 copies the selected text to the buffer without deleting it;
251 replaces the selected text with the contents of the buffer;
254 copies the snarf buffer to just after the output point, adding a final newline
259 will always place text after the output point; the text so placed
260 will behave exactly as described above. Therefore when pasting
261 text containing newlines after the output point, it may be prudent
262 to turn on hold mode first.
266 menu item sends the contents of the selection (not the snarf buffer) to the
270 If the selection is empty, it sends the white-space-delimited text
271 containing the selection (typing cursor).
272 A typical use of this feature is to tell the editor to find the source of an error
273 by plumbing the file and line information in a compiler's diagnostic.
277 listens for connections on a Unix socket.
278 When a client connects, the
280 writes the window contents to the client and then hangs up.
282 installs the name of this socket in the environment as
289 There should be a program to toggle the current window's hold mode.
297 .RB `` "set +o emacs" ''
298 mode, its handling of interrupts is broken.
301 processes the interrupt but then silently discards the next
304 Unix makes everything harder.