Fix segfault if the server maliciously sends the wrong type of key
[u/mdw/putty] / doc / config.but
CommitLineData
e5b0d077 1\C{config} Configuring PuTTY
2
55ba634a 3This chapter describes all the configuration options in PuTTY.
4
5PuTTY is configured using the control panel that comes up before you
6start a session. Some options can also be changed in the middle of a
7session, by selecting \e{Change Settings} from the window menu.
8
9\H{config-session} The Session panel
10
11The Session configuration panel contains the basic options you need
12to specify in order to open a session at all, and also allows you to
13save your settings to be reloaded later.
14
15\S{config-hostname} The host name section
16
17The top box on the Session panel, labelled \q{Specify your
18connection by host name}, contains the details that need to be
19filled in before PuTTY can open a session at all.
20
21\b The \e{Host Name} box is where you type the name, or the IP
22address, of the server you want to connect to.
23
24\b The \e{Protocol} radio buttons let you choose what type of
350ee898 25connection you want to make: a raw connection, a Telnet connection, an
26rlogin connection or an SSH connection. \#{ FIXME: link to sections on
27these? }
55ba634a 28
29\b The \e{Port} box lets you specify which port number on the server
350ee898 30to connect to. If you select Telnet, Rlogin, or SSH, this box will be
31filled in automatically to the usual value, and you will only need to
55ba634a 32change it if you have an unusual server. If you select Raw mode, you
33will almost certainly need to fill in the \e{Port} box.
34
35\S{config-saving} Loading and storing saved sessions
36
37The next part of the Session configuration panel allows you to save
38your preferred PuTTY options so they will appear automatically the
39next time you start PuTTY. It also allows you to create \e{saved
40sessions}, which contain a full set of configuration options plus a
41host name and protocol. A saved session contains all the information
42PuTTY needs to start exactly the session you want.
43
44\b To save your default settings: first set up the settings the way
45you want them saved. Then come back to the Session panel. Select the
46\q{Default Settings} entry in the saved sessions list, with a single
47click. Then press the \e{Save} button.
48
49\b To save a session: first go through the rest of the configuration
50box setting up all the options you want. Then come back to the
51Session panel. Enter a name for the saved session in the \e{Saved
52Sessions} input box. (The server name is often a good choice for a
53saved session name.) Then press the \e{Save} button. Your saved
54session name should now appear in the list box.
55
56\b To reload a saved session: single-click to select the session
57name in the list box, and then press the \e{Load} button. Your saved
58settings should all appear in the configuration panel.
59
60\b To modify a saved session: first load it as described above. Then
61make the changes you want. Come back to the Session panel,
62single-click to select the session name in the list box, and press
63the \e{Save} button. The new settings will be saved over the top of
64the old ones.
65
66\b To start a saved session immediately: double-click on the session
67name in the list box.
68
69\b To delete a saved session: single-click to select the session
70name in the list box, and then press the \e{Delete} button.
71
72Each saved session is independent of the Default Settings
73configuration. If you change your preferences and update Default
74Settings, you must also update every saved session separately.
75
76\S{config-closeonexit} \q{Close Window on Exit}
77
78Finally in the Session panel, there is a check box labelled \q{Close
79Window on Exit}. If this is turned on, the PuTTY session window will
80disappear as soon as the session inside it terminates. Otherwise,
81the window will remain on the desktop until you close it yourself,
82so you can still read and copy text out of it.
83
84\H{config-terminal} The Terminal panel
85
86The Terminal configuration panel allows you to control the behaviour
87of PuTTY's terminal emulation.
88
89\S{config-autowrap} \q{Auto wrap mode initially on}
90
91Auto wrap mode controls what happens when text printed in a PuTTY
92window reaches the right-hand edge of the window.
93
94With auto wrap mode on, if a long line of text reaches the
95right-hand edge, it will wrap over on to the next line so you can
96still see all the text. With auto wrap mode off, the cursor will
97stay at the right-hand edge of the screen, and all the characters in
98the line will be printed on top of each other.
99
100If you are running a full-screen application and you occasionally
101find the screen scrolling up when it looks as if it shouldn't, you
102could try turning this option off.
103
104Auto wrap mode can be turned on and off by control sequences sent by
105the server. This configuration option only controls the \e{default}
106state. If you modify this option in mid-session using \e{Change
107Settings}, you will need to reset the terminal \#{ FIXME } before
108the change takes effect.
109
110\S{config-decom} \q{DEC Origin Mode initially on}
111
112DEC Origin Mode is a minor option which controls how PuTTY
113interprets cursor-position control sequences sent by the server.
114
115The server can send a control sequence that restricts the scrolling
116region of the display. For example, in an editor, the server might
117reserve a line at the top of the screen and a line at the bottom,
118and might send a control sequence that causes scrolling operations
119to affect only the remaining lines.
120
121With DEC Origin Mode on, cursor coordinates are counted from the top
122of the scrolling region. With it turned off, cursor coordinates are
123counted from the top of the whole screen regardless of the scrolling
124region.
125
126It is unlikely you would need to change this option, but if you find
127a full-screen application is displaying pieces of text in what looks
128like the wrong part of the screen, you could try turning DEC Origin
129Mode on to see whether that helps.
130
131DEC Origin Mode can be turned on and off by control sequences sent by
132the server. This configuration option only controls the \e{default}
133state. If you modify this option in mid-session using \e{Change
134Settings}, you will need to reset the terminal \#{ FIXME } before
135the change takes effect.
136
137\S{config-crlf} \q{Implicit CR in every LF}
138
139Most servers send two control characters, CR and LF, to start a new
140line of the screen. The CR character makes the cursor return to the
141left-hand side of the screen. The LF character makes the cursor move
142one line down (and might make the screen scroll).
143
144Some servers only send LF, and expect the terminal to move the
145cursor over to the left automatically. If you come across a server
146that does this, you will see a stepped effect on the screen, like
147this:
148
149\c First line of text
150\c Second line
151\c Third line
152
153If this happens to you, try enabling the \q{Implicit CR in every LF}
154option, and things might go back to normal:
155
156\c First line of text
157\c Second line
158\c Third line
159
160\S{config-beep} \q{Beep enabled}
161
162This option lets you turn off beeps in PuTTY. If your server is
163beeping too much or attracting unwelcome attention, you can turn the
164beeps off.
165
166\S{config-erase} \q{Use background colour to erase screen}
167
168Not all terminals agree on what colour to turn the screen when the
169server sends a \q{clear screen} sequence. Some terminals believe the
170screen should always be cleared to the \e{default} background
171colour. Others believe the screen should be cleared to whatever the
172server has selected as a background colour.
173
174There exist applications that expect both kinds of behaviour.
175Therefore, PuTTY can be configured to do either.
176
177With this option disabled, screen clearing is always done in the
178default background colour. With this option enabled, it is done in
179the \e{current} background colour.
180
181\S{config-blink} \q{Enable blinking text}
182
183The server can ask PuTTY to display text that blinks on and off.
184This is very distracting, so PuTTY allows you to turn blinking text
185off completely.
186
187\S{config-localterm} \q{Use local terminal line discipline}
188
189Normally, every character you type into the PuTTY window is sent
190straight to the server.
191
192If you enable local terminal line discipline, this changes. PuTTY
193will let you edit a whole line at a time locally, and the line will
194only be sent to the server when you press Return. If you make a
195mistake, you can use the Backspace key to correct it before you
196press Return, and the server will never see the mistake.
197
198Since it would be hard to edit a line locally without being able to
199see it, local terminal line discipline also makes PuTTY echo what
200you type. This makes it ideal for use in raw mode \#{ FIXME } or
201when connecting to MUDs or talkers.
202
203\S{config-logging} Controlling session logging
204
205PuTTY has the ability to log the output from your session into a
206file. You might want this if you were saving a particular piece of
207output to mail to somebody, for example in a bug report.
208
209You can choose between:
210
211\b not logging anything (the default)
212
213\b logging only the printable characters in a session (ignoring
214control sequences to change colours or clear the screen)
215
216\b logging everything sent to the terminal by the server.
217
218You can turn logging on and off in mid-session using \e{Change
219Settings}.
220
221\H{config-keyboard} The Keyboard panel
222
1630bb61 223The Keyboard configuration panel allows you to control the behaviour
224of the keyboard in PuTTY.
225
55ba634a 226\S{config-backspace} Changing the action of the Backspace key
227
1630bb61 228Some terminals believe that the Backspace key should send the same
229thing to the server as Control-H (ASCII code 8). Other terminals
230believe that the Backspace key should send ASCII code 127 (usually
231known as Control-?) so that it can be distinguished from Control-H.
232This option allows you to choose which code PuTTY generates when you
233press Backspace.
234
235If you are connecting to a Unix system, you will probably find that
236the Unix \c{stty} command lets you configure which the server
237expects to see, so you might not need to change which one PuTTY
238generates. On other systems, the server's expectation might be fixed
239and you might have no choice but to configure PuTTY.
240
241If you do have the choice, we recommend configuring PuTTY to
242generate Control-? and configuring the server to expect it, because
243that allows applications such as \c{emacs} to use Control-H for
244help.
245
55ba634a 246\S{config-homeend} Changing the action of the Home and End keys
247
1630bb61 248The Unix terminal emulator \c{rxvt} disagrees with the rest of the
249world about what character sequences should be sent to the server by
250the Home and End keys.
251
252\c{xterm}, and other terminals, send \c{ESC [1~} for the Home key,
253and \c{ESC [4~} for the End key. \c{rxvt} sends \c{ESC [H} for the
254Home key and \c{ESC [Ow} for the End key.
255
256If you find an application on which the Home and End keys aren't
257working, you could try switching this option to see if it helps.
258
55ba634a 259\S{config-funkeys} Changing the action of the function keys and keypad
260
1630bb61 261This option affects the function keys (F1 to F12) and the top row of
262the numeric keypad.
263
264\b In the default mode, labelled \c{ESC [n~}, the function keys
265generate sequences like \c{ESC [11~}, \c{ESC [12~} and so on. This
266matches the general behaviour of Digital's terminals.
267
268\b In Linux mode, F6 to F12 behave just like the default mode, but
269F1 to F5 generate \c{ESC [[A} through to \c{ESC [[E}. This mimics the
270Linux virtual console.
271
272\b In Xterm R6 mode, F5 to F12 behave like the default mode, but F1
273to F4 generate \c{ESC OP} through to \c{ESC OS}, which are the
274sequences produced by the top row of the \e{keypad} on Digital's
275terminals.
276
277\b In VT400 mode, all the function keys behave like the default
278mode, but the actual top row of the numeric keypad generates \c{ESC
279OP} through to \c{ESC OS}.
280
350ee898 281\b In VT100+ mode, the function keys generate \c{ESC OP} through to
282\c{ESC O[}
283
284\b In SCO mode, the function keys F1 to F12 generate \c{ESC [M}
285through to \c{ESC [X}. Together with shift, they generate \c{ESC [Y}
286through to \c{ESC [j}. With control they generate \c{ESC [k} through
287to \c{ESC [v}, and with shift and control together they generate
288\c{ESC [w} through to \c{ESC [\{}.
289
1630bb61 290If you don't know what any of this means, you probably don't need to
291fiddle with it.
292
55ba634a 293\S{config-appcursor} Controlling Application Cursor Keys mode
294
1630bb61 295Application Cursor Keys mode is a way for the server to change the
296control sequences sent by the arrow keys. In normal mode, the arrow
297keys send \c{ESC [A} through to \c{ESC [D}. In application mode,
298they send \c{ESC OA} through to \c{ESC OD}.
299
300Application Cursor Keys mode can be turned on and off by the server,
301depending on the application. PuTTY allows you to configure the
302initial state, and also allows you to disable application mode
303completely.
304
55ba634a 305\S{config-appkeypad} Controlling Application Keypad mode
306
1630bb61 307Application Keypad mode is a way for the server to change the
308behaviour of the numeric keypad.
309
310In normal mode, the keypad behaves like a normal Windows keypad:
311with NumLock on, the number keys generate numbers, and with NumLock
312off they act like the arrow keys and Home, End etc.
313
314In application mode, all the keypad keys send special control
315sequences, \e{including} Num Lock. Num Lock stops behaving like Num
316Lock and becomes another function key.
317
318Depending on which version of Windows you run, you may find the Num
319Lock light still flashes on and off every time you press Num Lock,
320even when application mode is active and Num Lock is acting like a
321function key. This is unavoidable.
322
323Application keypad mode can be turned on and off by the server,
324depending on the application. PuTTY allows you to configure the
325initial state, and also allows you to disable application mode
326completely.
327
55ba634a 328\S{config-nethack} Using NetHack keypad mode
329
1630bb61 330PuTTY has a special mode for playing NetHack. You can enable it by
331selecting \q{NetHack} in the \q{Initial state of numeric keypad}
332control.
333
334In this mode, the numeric keypad keys 1-9 generate the NetHack
335movement commands (\cw{hjklyubn}). The 5 key generates the \c{.}
336command (do nothing).
337
338Better still, pressing Shift with the keypad keys generates the
339capital forms of the commands (\cw{HJKLYUBN}), which tells NetHack
340to keep moving you in the same direction until you encounter
341something interesting.
342
343For some reason, this feature only works properly when Num Lock is
344on. We don't know why.
345
55ba634a 346\S{config-compose} Enabling a DEC-like Compose key
347
1630bb61 348DEC terminals have a Compose key, which provides an easy-to-remember
349way of typing accented characters. You press Compose and then type
350two more characters. The two characters are \q{combined} to produce
351an accented character. The choices of character are designed to be
352easy to remember; for example, composing \q{e} and \q{`} produces
353the \q{\u00e8{e-grave}} character.
354
355If you enable the \q{Application and AltGr act as Compose key}
356option, the Windows Application key and the AltGr key will both have
357this behaviour.
358
b5752f1b 359\H{config-bell} The Bell panel
360
361The Bell configuration panel allows you to control how PuTTY should
362respond to a terminal bell.
363
364\S{config-bellstyle} Set the style of bell
365
366When a terminal bell occurs, PuTTY can do one of the following things:
367
368\b Nothing. The bell is disabled. Taskbar bell indication still
369works, however.
370
371\b Play Windows Default Sound. The Windows Default Sound (which can
372be configured from the Sounds control panel) will be played.
373
374\b Play a custom sound file. Select a \c{.wav} sound file using the
375\e{Custom sound file to play as a bell} text box, or browse for the
376file to play using the \e{Browse...} button.
377
378\b Flash the terminal window as a visual bell. No sound will be
379played.
380
381In addition, the PuTTY window's title bar and its entry in the taskbar
382can be configured to flash or invert to indicate that a terminal bell
383has occurred.
384
385\S{config-belloverload} Control the bell overload behaviour
386
387Sometimes mistakes, for example trying to \c{cat} a binary file on a
388Unix machine, can lead to a large number of terminal bells being
389received by PuTTY. It might take a long time for PuTTY to catch up
390with reacting to these bells, and the noise or flashing could be very
391irritating for the user.
392
393PuTTY's bell overload handling is designed to avoid this problem. If
394turned on using the \e{Bell is temporarily disabled when over-used}
395tick box, the bell will be disabled if it occurs more than a specified
396number of times in a specified number of seconds. When no bells have
397occurred for a number of seconds, PuTTY re-enables the bell.
398
55ba634a 399\H{config-window} The Window panel
400
1630bb61 401The Window configuration panel allows you to control aspects of the
402PuTTY window and its behaviour.
403
55ba634a 404\S{config-winsize} Setting the size of the PuTTY window
405
1630bb61 406The \e{Rows} and \e{Columns} boxes let you set the PuTTY window to a
407precise size. Of course you can also drag the window to a new size
408while a session is running.
409
410If you are running an application which is unable to deal with
411changes in window size, you might want to enable the \q{Lock window
412size against resizing} option, which prevents the user from
413accidentally changing the size of the window.
414
55ba634a 415\S{config-scrollback} Controlling scrollback
416
1630bb61 417Text that scrolls off the top of the PuTTY terminal window is kept
418for reference. The scrollbar on the right of the window lets you
419view the scrolled-off text. You can also page through the scrollback
420using the keyboard, by pressing Shift-PgUp and Shift-PgDn.
421
422The \q{Lines of scrollback} box lets you configure how many lines of
423text PuTTY keeps. The \q{Display scrollbar} option allows you to
424hide the scrollbar (although you can still view the scrollback using
425Shift-PgUp and Shift-PgDn).
426
427If you are viewing part of the scrollback when the server sends more
428text to PuTTY, the screen will revert to showing the current
429terminal contents. You can disable this behaviour by turning off
430\q{Reset scrollback on display activity}. You can also make the
431screen revert when you press a key, by turning on \q{Reset
432scrollback on keypress}.
433
55ba634a 434\S{config-warnonclose} \q{Warn before closing window}
435
1630bb61 436If you press the Close button in a PuTTY window that contains a
437running session, PuTTY will put up a warning window asking if you
438really meant to close the window. A window whose session has already
439terminated can always be closed without a warning.
440
441If you want to be able to close a window quickly, you can disable
442the \q{Warn before closing window} option.
443
55ba634a 444\S{config-altf4} \q{Window closes on ALT-F4}
445
1630bb61 446By default, pressing ALT-F4 causes the window to close (or a warning
447box to appear; see \k{config-warnonclose}). If you disable the
448\q{Window closes on ALT-F4} option, then pressing ALT-F4 will simply
449send a key sequence to the server.
450
55ba634a 451\S{config-altspace} \q{System menu appears on ALT-Space}
452
1630bb61 453If this option is enabled, then pressing ALT-Space will bring up the
454PuTTY window's menu, like clicking on the top left corner. If it is
455disabled, then pressing ALT-Space will just send \c{ESC SPACE} to
456the server.
457
55ba634a 458\S{config-altonly} \q{System menu appears on Alt alone}
459
1630bb61 460If this option is enabled, then pressing and releasing ALT will
461bring up the PuTTY window's menu, like clicking on the top left
462corner. If it is disabled, then pressing and releasing ALT will have
463no effect.
464
55ba634a 465\S{config-alwaysontop} \q{Ensure window is always on top}
466
1630bb61 467If this option is enabled, the PuTTY window will stay on top of all
468other windows.
469
55ba634a 470\H{config-appearance} The Appearance panel
471
1630bb61 472The Appearance configuration panel allows you to control aspects of
473PuTTY's appearance.
474
55ba634a 475\S{config-cursor} Controlling the appearance of the cursor
476
26c8f51a 477The \q{Cursor appearance} option lets you configure the cursor to be
478a block, an underline, or a vertical line. A block cursor becomes an
479empty box when the window loses focus; an underline or a vertical
480line becomes dotted.
481
482The \q{Cursor blinks} option makes the cursor blink on and off. This
483works in any of the cursor modes.
55ba634a 484
485\S{config-font} Controlling the font used in the terminal window
486
26c8f51a 487
488
55ba634a 489\S{config-title} Controlling the window title
490
491\H{config-translation} The Translation panel
492
1630bb61 493The Translation configuration panel allows you to control the
494translation between the character set understood by the server and
495the character set understood by PuTTY.
496
55ba634a 497\S{config-linedraw} Line drawing characters
498
499\S{config-outputtrans} Character set translation of output data
500
501\S{config-inputtrans} Character set translation of input data
502
503\H{config-selection} The Selection panel
504
1630bb61 505The Selection panel allows you to control the way copy and paste
506work in the PuTTY window.
507
55ba634a 508\S{config-mouse} Changing the actions of the mouse buttons
509
510\S{config-charclasses} Configuring word-by-word selection
511
512\H{config-colours} The Colours panel
513
1630bb61 514The Colours panel allows you to control PuTTY's use of colour.
515
55ba634a 516\S{config-boldcolour} \q{Bolded text is a different colour}
517
518\S{config-logpalette} \q{Attempt to use logical palettes}
519
520\S{config-colourcfg} Adjusting the colours in the terminal window
521
522\H{config-connection} The Connection panel
523
1630bb61 524The Connection panel allows you to configure options that apply to
525more than one type of connection.
526
55ba634a 527\S{config-termtype} \q{Terminal-type string}
528
529\S{config-username} \q{Auto-login username}
530
531\S{config-keepalive} Using keepalives to prevent disconnection
532
533\H{config-telnet} The Telnet panel
534
1630bb61 535The Telnet panel allows you to configure options that only apply to
536Telnet sessions.
537
55ba634a 538\S{config-termspeed} \q{Terminal-speed string}
539
540\S{config-environ} Setting environment variables on the server
541
542\S{config-oldenviron} \q{Handling of OLD_ENVIRON ambiguity}
543
544\H{config-ssh} The SSH panel
545
1630bb61 546The SSH panel allows you to configure options that only apply to
547SSH sessions.
548
55ba634a 549\S{config-command} Executing a specific command on the server
550
551\S{config-auth} SSH authentication options
552
553\S{config-protocol} SSH protocol options
37c6fce1 554
555\H{config-file} Storing configuration in a file
556
557PuTTY does not currently support storing its configuration in a file
558instead of the Registry. However, you can work around this with a
559couple of batch files.
560
561You will need a file called (say) \c{PUTTY.BAT} which imports the
562contents of a file into the Registry, then runs PuTTY, exports the
563contents of the Registry back into the file, and deletes the
564Registry entries. This can all be done using the Regedit command
565line options, so it's all automatic. Here is what you need in
566\c{PUTTY.BAT}:
567
568\c @ECHO OFF
569\c regedit /s putty.reg
570\c regedit /s puttyrnd.reg
571\c start /w putty.exe
572\c regedit /e puttynew.reg HKEY_CURRENT_USER\Software\SimonTatham\PuTTY
573\c copy puttynew.reg putty.reg
574\c del puttynew.reg
575\c regedit /s puttydel.reg
576
577This batch file needs two auxiliary files: \c{PUTTYRND.REG} which
578sets up an initial safe location for the \c{PUTTY.RND} random seed
579file, and \c{PUTTYDEL.REG} which destroys everything in the Registry
580once it's been successfully saved back to the file.
581
582Here is \c{PUTTYDEL.REG}:
583
584\c REGEDIT4
585\c
586\c [-HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]
587
588Here is an example \c{PUTTYRND.REG} file:
589
590\c REGEDIT4
591\c
592\c [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]
593\c "RandSeedFile"="a:\putty.rnd"
594
595You should replace \c{a:\\putty.rnd} with the location where you
596want to store your random number data. If the aim is to carry around
597PuTTY and its settings on one floppy, you probably want to store it
598on the floppy.