config.but

来自「远程登陆工具软件源码 用于远程登陆unix」· BUT 代码 · 共 1,542 行 · 第 1/5 页

BUT
1,542
字号
\versionid $Id: config.but,v 1.86.2.1 2004/07/29 17:56:50 simon Exp $

\C{config} Configuring PuTTY

This chapter describes all the configuration options in PuTTY.

PuTTY is configured using the control panel that comes up before you
start a session. Some options can also be changed in the middle of a
session, by selecting \q{Change Settings} from the window menu.

\H{config-session} The Session panel

The Session configuration panel contains the basic options you need
to specify in order to open a session at all, and also allows you to
save your settings to be reloaded later.

\S{config-hostname} The host name section

\cfg{winhelp-topic}{session.hostname}

The top box on the Session panel, labelled \q{Specify your
connection by host name}, contains the details that need to be
filled in before PuTTY can open a session at all.

\b The \q{Host Name} box is where you type the name, or the IP
address, of the server you want to connect to.

\b The \q{Protocol} radio buttons let you choose what type of
connection you want to make: a raw connection, a Telnet connection, an
rlogin connection or an SSH connection. (See \k{which-one} for a
summary of the differences between SSH, Telnet and rlogin.)

\b The \q{Port} box lets you specify which port number on the server
to connect to. If you select Telnet, Rlogin, or SSH, this box will
be filled in automatically to the usual value, and you will only
need to change it if you have an unusual server. If you select Raw
mode (see \k{using-rawprot}), you will almost certainly need to fill
in the \q{Port} box.

\S{config-saving} Loading and storing saved sessions

\cfg{winhelp-topic}{session.saved}

The next part of the Session configuration panel allows you to save
your preferred PuTTY options so they will appear automatically the
next time you start PuTTY. It also allows you to create \e{saved
sessions}, which contain a full set of configuration options plus a
host name and protocol. A saved session contains all the information
PuTTY needs to start exactly the session you want.

\b To save your default settings: first set up the settings the way
you want them saved. Then come back to the Session panel. Select the
\q{Default Settings} entry in the saved sessions list, with a single
click. Then press the \q{Save} button.

Note that PuTTY does not allow you to save a host name into the
Default Settings entry. This ensures that when PuTTY is started up,
the host name box is always empty, so a user can always just type in
a host name and connect.

If there is a specific host you want to store the details of how to
connect to, you should create a saved session, which will be
separate from the Default Settings.

\b To save a session: first go through the rest of the configuration
box setting up all the options you want. Then come back to the
Session panel. Enter a name for the saved session in the \q{Saved
Sessions} input box. (The server name is often a good choice for a
saved session name.) Then press the \q{Save} button. Your saved
session name should now appear in the list box.

\b To reload a saved session: single-click to select the session
name in the list box, and then press the \q{Load} button. Your saved
settings should all appear in the configuration panel.

\b To modify a saved session: first load it as described above. Then
make the changes you want. Come back to the Session panel,
single-click to select the session name in the list box, and press
the \q{Save} button. The new settings will be saved over the top of
the old ones.

\b To start a saved session immediately: double-click on the session
name in the list box.

\b To delete a saved session: single-click to select the session
name in the list box, and then press the \q{Delete} button.

Each saved session is independent of the Default Settings
configuration. If you change your preferences and update Default
Settings, you must also update every saved session separately.

Saved sessions are stored in the Registry, at the location

\c HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions

If you need to store them in a file, you could try the method
described in \k{config-file}.

\S{config-closeonexit} \q{Close Window on Exit}

\cfg{winhelp-topic}{session.coe}

Finally in the Session panel, there is an option labelled \q{Close
Window on Exit}. This controls whether the PuTTY session window
disappears as soon as the session inside it terminates. If you are
likely to want to copy and paste text out of the session after it
has terminated, you should arrange this option to be off.

\q{Close Window On Exit} has three settings. \q{Always} means always
close the window on exit; \q{Never} means never close on exit
(always leave the window open). The third setting, and the default
one, is \q{Only on clean exit}. In this mode, a session which
terminates normally will cause its window to close, but one which is
aborted unexpectedly by network trouble or a confusing message from
the server will leave the window up.

\H{config-logging} The Logging panel

\cfg{winhelp-topic}{logging.main}

The Logging configuration panel allows you to save log files of your
PuTTY sessions, for debugging, analysis or future reference.

The main option is a radio-button set that specifies whether PuTTY
will log anything at all. The options are

\b \q{Logging turned off completely}. This is the default option; in
this mode PuTTY will not create a log file at all.

\b \q{Log printable output only}. In this mode, a log file will be
created and written to, but only printable text will be saved into
it. The various terminal control codes that are typically sent down
an interactive session alongside the printable text will be omitted.
This might be a useful mode if you want to read a log file in a text
editor and hope to be able to make sense of it.

\b \q{Log all session output}. In this mode, \e{everything} sent by
the server into your terminal session is logged. If you view the log
file in a text editor, therefore, you may well find it full of
strange control characters. This is a particularly useful mode if
you are experiencing problems with PuTTY's terminal handling: you
can record everything that went to the terminal, so that someone
else can replay the session later in slow motion and watch to see
what went wrong.

\b \q{Log SSH packet data}. In this mode (which is only used by SSH
connections), the SSH message packets sent over the encrypted
connection are written to the log file. You might need this to debug
a network-level problem, or more likely to send to the PuTTY authors
as part of a bug report. \e{BE WARNED} that if you log in using a
password, the password will appear in the log file, so be sure to
edit it out before sending the log file to anyone else!

\S{config-logfilename} \q{Log file name}

\cfg{winhelp-topic}{logging.filename}

In this edit box you enter the name of the file you want to log the
session to. The \q{Browse} button will let you look around your file
system to find the right place to put the file; or if you already
know exactly where you want it to go, you can just type a pathname
into the edit box.

There are a few special features in this box. If you use the \c{&}
character in the file name box, PuTTY will insert details of the
current session in the name of the file it actually opens. The
precise replacements it will do are:

\b \c{&Y} will be replaced by the current year, as four digits.

\b \c{&M} will be replaced by the current month, as two digits.

\b \c{&D} will be replaced by the current day of the month, as two
digits.

\b \c{&T} will be replaced by the current time, as six digits
(HHMMSS) with no punctuation.

\b \c{&H} will be replaced by the host name you are connecting to.

For example, if you enter the host name
\c{c:\\puttylogs\\log-&h-&y&m&d-&t.dat}, you will end up with files looking
like

\c log-server1.example.com-20010528-110859.dat
\c log-unixbox.somewhere.org-20010611-221001.dat

\S{config-logfileexists} \q{What to do if the log file already exists}

\cfg{winhelp-topic}{logging.exists}

This control allows you to specify what PuTTY should do if it tries
to start writing to a log file and it finds the file already exists.
You might want to automatically destroy the existing log file and
start a new one with the same name. Alternatively, you might want to
open the existing log file and add data to the \e{end} of it.
Finally (the default option), you might not want to have any
automatic behaviour, but to ask the user every time the problem
comes up.

\H{config-terminal} The Terminal panel

The Terminal configuration panel allows you to control the behaviour
of PuTTY's terminal emulation.

\S{config-autowrap} \q{Auto wrap mode initially on}

\cfg{winhelp-topic}{terminal.autowrap}

Auto wrap mode controls what happens when text printed in a PuTTY
window reaches the right-hand edge of the window.

With auto wrap mode on, if a long line of text reaches the
right-hand edge, it will wrap over on to the next line so you can
still see all the text. With auto wrap mode off, the cursor will
stay at the right-hand edge of the screen, and all the characters in
the line will be printed on top of each other.

If you are running a full-screen application and you occasionally
find the screen scrolling up when it looks as if it shouldn't, you
could try turning this option off.

Auto wrap mode can be turned on and off by control sequences sent by
the server. This configuration option controls the \e{default}
state, which will be restored when you reset the terminal (see
\k{reset-terminal}). However, if you modify this option in
mid-session using \q{Change Settings}, it will take effect
immediately.

\S{config-decom} \q{DEC Origin Mode initially on}

\cfg{winhelp-topic}{terminal.decom}

DEC Origin Mode is a minor option which controls how PuTTY
interprets cursor-position control sequences sent by the server.

The server can send a control sequence that restricts the scrolling
region of the display. For example, in an editor, the server might
reserve a line at the top of the screen and a line at the bottom,
and might send a control sequence that causes scrolling operations
to affect only the remaining lines.

With DEC Origin Mode on, cursor coordinates are counted from the top
of the scrolling region. With it turned off, cursor coordinates are
counted from the top of the whole screen regardless of the scrolling
region.

It is unlikely you would need to change this option, but if you find
a full-screen application is displaying pieces of text in what looks
like the wrong part of the screen, you could try turning DEC Origin
Mode on to see whether that helps.

DEC Origin Mode can be turned on and off by control sequences sent
by the server. This configuration option controls the \e{default}
state, which will be restored when you reset the terminal (see
\k{reset-terminal}). However, if you modify this option in
mid-session using \q{Change Settings}, it will take effect
immediately.

\S{config-crlf} \q{Implicit CR in every LF}

\cfg{winhelp-topic}{terminal.lfhascr}

Most servers send two control characters, CR and LF, to start a new
line of the screen. The CR character makes the cursor return to the
left-hand side of the screen. The LF character makes the cursor move
one line down (and might make the screen scroll).

Some servers only send LF, and expect the terminal to move the
cursor over to the left automatically. If you come across a server
that does this, you will see a stepped effect on the screen, like
this:

\c First line of text
\c                   Second line
\c                              Third line

If this happens to you, try enabling the \q{Implicit CR in every LF}
option, and things might go back to normal:

\c First line of text
\c Second line
\c Third line

\S{config-erase} \q{Use background colour to erase screen}

\cfg{winhelp-topic}{terminal.bce}

Not all terminals agree on what colour to turn the screen when the
server sends a \q{clear screen} sequence. Some terminals believe the
screen should always be cleared to the \e{default} background
colour. Others believe the screen should be cleared to whatever the
server has selected as a background colour.

There exist applications that expect both kinds of behaviour.
Therefore, PuTTY can be configured to do either.

With this option disabled, screen clearing is always done in the
default background colour. With this option enabled, it is done in
the \e{current} background colour.

Background-colour erase can be turned on and off by control
sequences sent by the server. This configuration option controls the
\e{default} state, which will be restored when you reset the
terminal (see \k{reset-terminal}). However, if you modify this
option in mid-session using \q{Change Settings}, it will take effect
immediately.

\S{config-blink} \q{Enable blinking text}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?