CloseOnExit now defaults to COE_ALWAYS for pterm, bringing it back
[u/mdw/putty] / unix / pterm.1
CommitLineData
d08e9679 1.TH pterm 1
2.UC
3.SH NAME
4pterm \- yet another X terminal emulator
5.SH SYNOPSIS
6\fBpterm\fP [ \fIoptions\fP ]
7.SH DESCRIPTION
8\fIpterm\fP is a terminal emulator for X. It is based on a port of
9the terminal emulation engine in the Windows SSH client PuTTY.
10.SH OPTIONS
11The command-line options supported by \fIpterm\fP are:
12.IP "\fB-e\fP \fIcommand\fP [ \fIarguments\fP ]"
13Specify a command to be executed in the new terminal. Everything on
14the command line after this option will be passed straight to the
15\fIexecvp\fP system call; so if you need the command to redirect its
16input or output, you will have to use \fIsh\fP:
17
18pterm -e sh -c 'mycommand < inputfile'
19.IP "\fB--display\fP \fIdisplay-name\fP"
20Specify the X display on which to open \fIpterm\fP. (Note this
21option has a double minus sign, even though none of the others do.
22This is because this option is supplied automatically by GTK.
23Sorry.)
24.IP "\fB-name\fP \fIfont-name\fP"
25Specify the name under which \fIpterm\fP looks up X resources.
26Normally it will look them up as (for example) \fBpterm.Font\fP. If
27you specify "-name xyz", it will look them up as \fBxyz.Font\fP
28instead. This allows you to set up several different sets of
29defaults and choose between them.
30.IP "\fB-fn\fP \fIfont-name\fP"
31Specify the font to use for normal text displayed in the terminal.
32.IP "\fB-fb\fP \fIfont-name\fP"
33Specify the font to use for bold text displayed in the terminal. If
34the \fIBoldAsColour\fP resource is set to 1 (the default), bold text
35will be displayed in different colours instead of a different font,
36so this option will be ignored. If \fIBoldAsColour\fP is set to 0
37and you do not specify a bold font, \fIpterm\fP will overprint the
38normal font to make it look bolder.
39.IP "\fB-geometry\fP \fIwidth\fPx\fIheight\fP"
40Specify the size of the terminal, in rows and columns of text.
41Unfortunately \fIpterm\fP does not currently support specifying the
42initial position of the window.
43.IP "\fB-sl\fP \fIlines\fP"
44Specify the number of lines of scrollback to save off the top of the
45terminal.
46.IP "\fB-fg\fP \fIcolour\fP"
47Specify the foreground colour to use for normal text.
48.IP "\fB-bg\fP \fIcolour\fP"
49Specify the background colour to use for normal text.
50.IP "\fB-bfg\fP \fIcolour\fP"
51Specify the foreground colour to use for bold text, if the
52\fIBoldAsColour\fP resource is set to 1 (the default).
53.IP "\fB-bbg\fP \fIcolour\fP"
54Specify the foreground colour to use for bold reverse-video text, if
55the \fIBoldAsColour\fP resource is set to 1 (the default). (This
56colour is best thought of as the bold version of the background
57colour; so it only appears when text is displayed \fIin\fP the
58background colour.)
59.IP "\fB-cfg\fP \fIcolour\fP"
60Specify the foreground colour to use for text covered by the cursor.
61.IP "\fB-cbg\fP \fIcolour\fP"
62Specify the background colour to use for text covered by the cursor.
63In other words, this is the main colour of the cursor.
64.IP "\fB-T\fP \fItitle\fP"
65Specify the initial title of the terminal window. (This can be
66changed under control of the server.)
67.IP "\fB-ut-\fP or \fB+ut\fP"
68Tells \fIpterm\fP not to record your login in the \fIutmp\fP,
69\fIwtmp\fP and \fIlastlog\fP system log files; so you will not show
70up on \fIfinger\fP or \fIwho\fP listings, for example.
71.IP "\fB-ut\fP"
72Tells \fIpterm\fP to record your login in \fIutmp\fP, \fIwtmp\fP and
73\fIlastlog\fP: this is the opposite of \fI-ut-\fP. This is the
74default option: you will probably only need to specify it explicitly
75if you have changed the default using the \fIStampUtmp\fP resource.
76.IP "\fB-ls-\fP or \fB+ls\fP"
77Tells \fIpterm\fP not to execute your shell as a login shell.
78.IP "\fB-ls\fP"
79Tells \fIpterm\fP to execute your shell as a login shell: this is
80the opposite of \fI-ls-\fP. This is the default option: you will
81probably only need to specify it explicitly if you have changed the
82default using the \fILoginShell\fP resource.
83.IP "\fB-sb-\fP or \fB+sb\fP"
84Tells \fIpterm\fP not to display a scroll bar.
85.IP "\fB-sb\fP"
86Tells \fIpterm\fP to display a scroll bar: this is the opposite of
86f2f4f8 87\fI-sb-\fP. This is the default option: you will probably only need
d08e9679 88to specify it explicitly if you have changed the default using the
89\fIScrollBar\fP resource.
90.IP "\fB-log\fP \fIfilename\fP"
91This option makes \fIpterm\fP log all the terminal output to a file
92as well as displaying it in the terminal.
93.IP "\fB-nethack\fP"
94Tells \fIpterm\fP to enable NetHack keypad mode, in which the
95numeric keypad generates the NetHack "hjklyubn" direction keys. This
96enables you to play NetHack with the numeric keypad without having
97to use the NetHack "number_pad" option (which requires you to press
98"n" before any repeat count). So you can move with the numeric
99keypad, and enter repeat counts with the normal number keys.
0ac15bdc 100.IP "\fB-xrm\fP \fIresource-string\fP"
101This option specifies an X resource string. Useful for setting
102resources which do not have their own command-line options. For
103example:
104
105pterm -xrm 'ScrollbarOnLeft: 1'
d08e9679 106.SH X RESOURCES
107\fIpterm\fP can be more completely configured by means of X
108resources. All of these resources are of the form \fIpterm.FOO\fP
109for some FOO; you can make \fIpterm\fP look them up under another
110name, such as \fIxyz.FOO\fP, by specifying the command-line option
111"-name xyz".
90cfd8f4 112.IP "\fBpterm.CloseOnExit\fP"
461b078e 113This option should be set to 0, 1 or 2; the default is 2. It
90cfd8f4 114controls what \fIpterm\fP does when the process running inside it
461b078e 115terminates. When set to 2 (the default), \fIpterm\fP will close its
116window as soon as the process inside it terminates. When set to 0,
117\fIpterm\fP will print the process's exit status, and the window
118will remain present until a key is pressed (allowing you to inspect
119the scrollback, and copy and paste text out of it).
90cfd8f4 120
461b078e 121When this setting is set to 1, \fIpterm\fP will close
90cfd8f4 122immediately if the process exits cleanly (with an exit status of
123zero), but the window will stay around if the process exits with a
124non-zero code or on a signal. This enables you to see what went
125wrong if the process suffers an error, but not to have to bother
126closing the window in normal circumstances.
d08e9679 127.IP "\fBpterm.TerminalType\fP"
128This controls the value set in the TERM environment variable inside
129the new terminal. The default is "xterm".
130.IP "\fBpterm.BackspaceIsDelete\fP"
131This option should be set to either 0 or 1; the default is 1. When
132set to 0, the ordinary Backspace key generates the Backspace
133character (^H); when set to 1, it generates the Delete character
134(^?). Whichever one you set, the terminal device inside \fIpterm\fP
135will be set up to expect it.
136.IP "\fBpterm.RXVTHomeEnd\fP"
137This option should be set to either 0 or 1; the default is 0. When
138it is set to 1, the Home and End keys generate the control sequences
139they would generate in the \fIrxvt\fP terminal emulator, instead of
140the more usual ones generated by other emulators.
141.IP "\fBpterm.LinuxFunctionKeys\fP"
142This option can be set to any number between 0 and 5 inclusive; the
143default is 0. The modes vary the control sequences sent by the
144function keys; for more complete documentation, it is probably
145simplest to try each option in "pterm -e cat", and press the keys to
146see what they generate.
147.IP "\fBpterm.NoApplicationKeys\fP"
148This option should be set to either 0 or 1; the default is 0. When
149set to 1, it stops the server from ever switching the numeric keypad
150into application mode (where the keys send function-key-like
151sequences instead of numbers or arrow keys). You probably only need
152this if some application is making a nuisance of itself.
153.IP "\fBpterm.NoApplicationCursors\fP"
154This option should be set to either 0 or 1; the default is 0. When
155set to 1, it stops the server from ever switching the cursor keys
156into application mode (where the keys send slightly different
157sequences). You probably only need this if some application is
158making a nuisance of itself.
159.IP "\fBpterm.NoMouseReporting\fP"
160This option should be set to either 0 or 1; the default is 0. When
161set to 1, it stops the server from ever enabling mouse reporting
162mode (where mouse clicks are sent to the application instead of
163controlling cut and paste).
164.IP "\fBpterm.NoRemoteResize\fP"
165This option should be set to either 0 or 1; the default is 0. When
166set to 1, it stops the server from being able to remotely control
167the size of the \fIpterm\fP window.
168.IP "\fBpterm.NoAltScreen\fP"
169This option should be set to either 0 or 1; the default is 0. When
170set to 1, it stops the server from using the "alternate screen"
171terminal feature, which lets full-screen applications leave the
172screen exactly the way they found it.
173.IP "\fBpterm.NoRemoteWinTitle\fP"
174This option should be set to either 0 or 1; the default is 0. When
175set to 1, it stops the server from remotely controlling the title of
176the \fIpterm\fP window.
177.IP "\fBpterm.NoDBackspace\fP"
178This option should be set to either 0 or 1; the default is 0. When
179set to 1, it disables the normal action of the Delete (^?) character
180when sent from the server to the terminal, which is to move the
181cursor left by one space and erase the character now under it.
182.IP "\fBpterm.ApplicationCursorKeys\fP"
183This option should be set to either 0 or 1; the default is 0. When
184set to 1, the default initial state of the cursor keys are
185application mode (where the keys send function-key-like sequences
186instead of numbers or arrow keys). When set to 0, the default state
187is the normal one.
188.IP "\fBpterm.ApplicationKeypad\fP"
189This option should be set to either 0 or 1; the default is 0. When
190set to 1, the default initial state of the numeric keypad is
191application mode (where the keys send function-key-like sequences
192instead of numbers or arrow keys). When set to 0, the default state
193is the normal one.
194.IP "\fBpterm.NetHackKeypad\fP"
195This option should be set to either 0 or 1; the default is 0. When
196set to 1, the numeric keypad operates in NetHack mode. This is
197equivalent to the \fI-nethack\fP command-line option.
198.IP "\fBpterm.Answerback\fP"
199This option controls the string which the terminal sends in response
200to receiving the ^E character ("tell me about yourself"). By default
201this string is "PuTTY".
202.IP "\fBpterm.HideMousePtr\fP"
203This option should be set to either 0 or 1; the default is 0. When
204it is set to 1, the mouse pointer will disappear if it is over the
205\fIpterm\fP window and you press a key. It will reappear as soon as
206you move it.
207.IP "\fBpterm.WindowBorder\fP"
208This option controls the number of pixels of space between the text
209in the \fIpterm\fP window and the window frame. The default is 1.
210You can increase this value, but decreasing it to 0 is not
211recommended because it can cause the window manager's size hints to
212work incorrectly.
213.IP "\fBpterm.CurType\fP"
214This option should be set to either 0, 1 or 2; the default is 0.
215When set to 0, the text cursor displayed in the window is a
216rectangular block. When set to 1, the cursor is an underline; when
217set to 2, it is a vertical line.
218.IP "\fBpterm.BlinkCur\fP"
219This option should be set to either 0 or 1; the default is 0. When
220it is set to 1, the text cursor will blink when the window is active.
221.IP "\fBpterm.Beep\fP"
222This option should be set to either 0 or 2 (yes, 2); the default is
2230. When it is set to 2, \fIpterm\fP will respond to a bell character
224(^G) by flashing the window instead of beeping.
225.IP "\fBpterm.BellOverload\fP"
226This option should be set to either 0 or 1; the default is 0. When
227it is set to 1, \fIpterm\fP will watch out for large numbers of
228bells arriving in a short time and will temporarily disable the bell
229until they stop. The idea is that if you \fIcat\fP a binary file,
230the frantic beeping will mostly be silenced by this feature and will
231not drive you crazy.
232
233The bell overload mode is activated by receiving N bells in time T;
234after a further time S without any bells, overload mode will turn
235itself off again.
2cb50250 236
237Bell overload mode is always deactivated by any keypress in the
238terminal. This means it can respond to large unexpected streams of
239data, but does not interfere with ordinary command-line activities
240that generate beeps (such as filename completion).
d08e9679 241.IP "\fBpterm.BellOverloadN\fP"
242This option counts the number of bell characters which will activate
243bell overload if they are received within a length of time T. The
244default is 5.
245.IP "\fBpterm.BellOverloadT\fP"
246This option specifies the time period in which receiving N or more
247bells will activate bell overload mode. It is measured in
248microseconds, so (for example) set it to 1000000 for one second. The
249default is 2000000 (two seconds).
250.IP "\fBpterm.BellOverloadS\fP"
251This option specifies the time period of silence required to turn
252off bell overload mode. It is measured in microseconds, so (for
253example) set it to 1000000 for one second. The default is 5000000
254(five seconds of silence).
255.IP "\fBpterm.ScrollbackLines\fP"
256This option specifies how many lines of scrollback to save above the
257visible terminal screen. The default is 200. This resource is
258equivalent to the \fI-sl\fP command-line option.
259.IP "\fBpterm.DECOriginMode\fP"
260This option should be set to either 0 or 1; the default is 0. It
261specifies the default state of DEC Origin Mode. (If you don't know
262what that means, you probably don't need to mess with it.)
263.IP "\fBpterm.AutoWrapMode\fP"
264This option should be set to either 0 or 1; the default is 1. It
265specifies the default state of auto wrap mode. When set to 1, very
266long lines will wrap over to the next line on the terminal; when set
267to 0, long lines will be squashed against the right-hand edge of the
268screen.
269.IP "\fBpterm.LFImpliesCR\fP"
270This option should be set to either 0 or 1; the default is 0. When
271set to 1, the terminal will return the cursor to the left side of
272the screen when it receives a line feed character.
273.IP "\fBpterm.WinTitle\fP"
274This resource is the same as the \fI-T\fP command-line option: it
275controls the initial title of the window. The default is "pterm".
276.IP "\fBpterm.TermWidth\fP"
277This resource is the same as the width part of the \fI-geometry\fP
278command-line option: it controls the number of columns of text in
279the window. The default is 80.
280.IP "\fBpterm.TermHeight\fP"
281This resource is the same as the width part of the \fI-geometry\fP
282command-line option: it controls the number of columns of text in
283the window. The defaults is 24.
284.IP "\fBpterm.Font\fP"
285This resource is the same as the \fI-fn\fP command-line option: it
286controls the font used to display normal text. The default is
287"fixed".
288.IP "\fBpterm.BoldFont\fP"
289This resource is the same as the \fI-fb\fP command-line option: it
290controls the font used to display bold text when \fIBoldAsColour\fP
291is turned off. The default is unset (the font will be bolded by
292printing it twice at a one-pixel offset).
12994a99 293.IP "\fBpterm.ShadowBoldOffset\fP"
294This resource can be set to an integer; the default is -1. It
295specifies the offset at which text is overprinted when using "shadow
296bold" mode. The default (-1) means that the text will be printed in
297the normal place, and also one character to the left; this seems to
298work well for most X bitmap fonts, which have a blank line of pixels
299down the left-hand side. For some fonts, you may need to set this to
300+1, so that the text is overprinted one pixel to the right; for
301really large fonts, you may want to set it even higher.
d08e9679 302.IP "\fBpterm.BoldAsColour\fP"
303This option should be set to either 0 or 1; the default is 1. It
304specifies the default state of auto wrap mode. When set to 1, bold
305text is shown by displaying it in a brighter colour; when set to 0,
306bold text is shown by displaying it in a heavier font.
307.IP "\fBpterm.Colour0\fP, \fBpterm.Colour1\fP, ..., \fBpterm.Colour21\fP"
308These options control the various colours used to display text in
309the \fIpterm\fP window. Each one should be specified as a triple of
310decimal numbers giving red, green and blue values: so that black is
311"0,0,0", white is "255,255,255", red is "255,0,0" and so on.
312
313Colours 0 and 1 specify the foreground colour and its bold
314equivalent (the \fI-fg\fP and \fI-bfg\fP command-line options).
315Colours 2 and 3 specify the background colour and its bold
316equivalent (the \fI-bg\fP and \fI-bbg\fP command-line options).
317Colours 4 and 5 specify the text and block colours used for the
318cursor (the \fI-cfg\fP and \fI-cbg\fP command-line options). Each
319even number from 6 to 20 inclusive specifies the colour to be used
320for one of the ANSI primary colour specifications (black, red,
321green, yellow, blue, magenta, cyan, white, in that order); the odd
322numbers from 7 to 21 inclusive specify the bold version of each
323colour, in the same order. The defaults are:
324
325.nf
326pterm.Colour0: 187,187,187
327pterm.Colour1: 255,255,255
328pterm.Colour2: 0,0,0
329pterm.Colour3: 85,85,85
330pterm.Colour4: 0,0,0
331pterm.Colour5: 0,255,0
332pterm.Colour6: 0,0,0
333pterm.Colour7: 85,85,85
334pterm.Colour8: 187,0,0
335pterm.Colour9: 255,85,85
336pterm.Colour10: 0,187,0
337pterm.Colour11: 85,255,85
338pterm.Colour12: 187,187,0
339pterm.Colour13: 255,255,85
340pterm.Colour14: 0,0,187
341pterm.Colour15: 85,85,255
342pterm.Colour16: 187,0,187
343pterm.Colour17: 255,85,255
344pterm.Colour18: 0,187,187
345pterm.Colour19: 85,255,255
346pterm.Colour20: 187,187,187
347pterm.Colour21: 255,255,255
348.fi
349.IP "\fBpterm.RectSelect\fP"
350This option should be set to either 0 or 1; the default is 0. When
351set to 0, dragging the mouse over several lines selects to the end
352of each line and from the beginning of the next; when set to 1,
353dragging the mouse over several lines selects a rectangular region.
354In each case, holding down Alt while dragging gives the other
355behaviour.
356.IP "\fBpterm.MouseOverride\fP"
357This option should be set to either 0 or 1; the default is 1. When
358set to 1, if the application requests mouse tracking (so that mouse
359clicks are sent to it instead of doing selection), holding down
360Shift will revert the mouse to normal selection. When set to 0,
361mouse tracking completely disables selection.
362.IP "\fBpterm.Printer\fP"
363This option is unset by default. If you set it, then
364server-controlled printing is enabled: the server can send control
365sequences to request data to be sent to a printer. That data will be
366piped into the command you specify here; so you might want to set it
367to "lpr", for example, or "lpr -Pmyprinter".
368.IP "\fBpterm.ScrollBar\fP"
369This option should be set to either 0 or 1; the default is 1. When
370set to 0, the scrollbar is hidden (although Shift-PageUp and
371Shift-PageDown still work). This is the same as the \fI-sb\fP
372command-line option.
373.IP "\fBpterm.ScrollbarOnLeft\fP"
374This option should be set to either 0 or 1; the default is 0. When
375set to 1, the scrollbar will be displayed on the left of the
376terminal instead of on the right.
377.IP "\fBpterm.ScrollOnKey\fP"
378This option should be set to either 0 or 1; the default is 0. When
379set to 1, any keypress causes the position of the scrollback to be
380reset to the very bottom.
381.IP "\fBpterm.ScrollOnDisp\fP"
382This option should be set to either 0 or 1; the default is 1. When
383set to 1, any activity in the display causes the position of the
384scrollback to be reset to the very bottom.
385.IP "\fBpterm.BCE\fP"
386This option should be set to either 0 or 1; the default is 1. When
387set to 1, the various control sequences that erase parts of the
388terminal display will erase in whatever the current background
389colour is; when set to 0, they will erase in black always.
390.IP "\fBpterm.BlinkText\fP"
391This option should be set to either 0 or 1; the default is 0. When
392set to 1, text specified as blinking by the server will actually
393blink on and off; when set to 0, \fIpterm\fP will use the less
394distracting approach of making the text's background colour bold.
395.IP "\fBpterm.StampUtmp\fP"
396This option should be set to either 0 or 1; the default is 1. When
397set to 1, \fIpterm\fP will log the login in the various system log
398files. This resource is equivalent to the \fI-ut\fP command-line
399option.
400.IP "\fBpterm.LoginShell\fP"
401This option should be set to either 0 or 1; the default is 1. When
402set to 1, \fIpterm\fP will execute your shell as a login shell. This
403resource is equivalent to the \fI-ls\fP command-line option.
404.SH BUGS
405Most of the X resources have silly names. (Historical reasons from
406PuTTY, mostly.)
407
408Character-set switching and Unicode are not yet supported.