HELPCTX(connection_termtype),
dlg_stdeditbox_handler, I(offsetof(Config,termtype)),
I(sizeof(((Config *)0)->termtype)));
+ ctrl_editbox(s, "Terminal speeds", 's', 50,
+ HELPCTX(connection_termspeed),
+ dlg_stdeditbox_handler, I(offsetof(Config,termspeed)),
+ I(sizeof(((Config *)0)->termspeed)));
ctrl_editbox(s, "Auto-login username", 'u', 50,
HELPCTX(connection_username),
dlg_stdeditbox_handler, I(offsetof(Config,username)),
if (!midsession) {
s = ctrl_getset(b, "Connection/Telnet", "data",
"Data to send to the server");
- ctrl_editbox(s, "Terminal-speed string", 's', 50,
- HELPCTX(telnet_termspeed),
- dlg_stdeditbox_handler, I(offsetof(Config,termspeed)),
- I(sizeof(((Config *)0)->termspeed)));
ctrl_text(s, "Environment variables:", HELPCTX(telnet_environ));
ctrl_columns(s, 2, 80, 20);
ed = (struct environ_data *)
s = ctrl_getset(b, "Connection/Rlogin", "data",
"Data to send to the server");
- ctrl_editbox(s, "Terminal-speed string", 's', 50,
- HELPCTX(rlogin_termspeed),
- dlg_stdeditbox_handler, I(offsetof(Config,termspeed)),
- I(sizeof(((Config *)0)->termspeed)));
ctrl_editbox(s, "Local username:", 'l', 50,
HELPCTX(rlogin_localuser),
dlg_stdeditbox_handler, I(offsetof(Config,localusername)),
-\versionid $Id: config.but,v 1.76 2004/03/05 19:01:45 jacob Exp $
+\versionid $Id: config.but,v 1.77 2004/04/24 20:05:03 jacob Exp $
\C{config} Configuring PuTTY
setting or not, you probably need to consult the manual for your
application or your server.
+\S{config-termspeed} \q{Terminal speeds}
+
+\cfg{winhelp-topic}{connection.termspeed}
+
+The Telnet, Rlogin, and SSH protocols allow the client to specify
+terminal speeds to the server.
+
+This parameter does \e{not} affect the actual speed of the connection,
+which is always \q{as fast as possible}; it is just a hint that is
+sometimes used by server software to modify its behaviour. For
+instance, if a slow speed is indicated, the server may switch to a
+less bandwidth-hungry display mode.
+
+The value is usually meaningless in a network environment, but
+PuTTY lets you configure it, in case you find the server is reacting
+badly to the default value.
+
+The format is a pair of numbers separated by a comma, for instance,
+\c{38400,38400}. The first number represents the output speed
+(\e{from} the server), and the second is the input speed (\e{to} the
+server). (Only the first is used in the Rlogin protocol.)
+
+This option has no effect on Raw connections.
+
\S{config-username} \q{Auto-login username}
\cfg{winhelp-topic}{connection.username}
The Telnet panel allows you to configure options that only apply to
Telnet sessions.
-\S{config-termspeed} \q{Terminal-speed string}
-
-\cfg{winhelp-topic}{telnet.termspeed}
-
-Telnet allows the client to send a text string that describes the
-terminal speed. PuTTY lets you configure this, in case you find the
-server is reacting badly to the default value. (I'm not aware of any
-servers that do have a problem with it.)
-
\S{config-environ} Setting environment variables on the server
\cfg{winhelp-topic}{telnet.environ}
-The Telnet protocol also provides a means for the client to pass
+The Telnet protocol provides a means for the client to pass
environment variables to the server. Many Telnet servers have
stopped supporting this feature due to security flaws, but PuTTY
still supports it for the benefit of any servers which have found
The Rlogin panel allows you to configure options that only apply to
Rlogin sessions.
-\S{config-rlogin-termspeed} \q{Terminal-speed string}
-
-\cfg{winhelp-topic}{rlogin.termspeed}
-
-Like Telnet, Rlogin allows the client to send a text string that
-describes the terminal speed. PuTTY lets you configure this, in case
-you find the server is reacting badly to the default value. (I'm not
-aware of any servers that do have a problem with it.)
-
\S{config-rlogin-localuser} \q{Local username}
\cfg{winhelp-topic}{rlogin.localuser}
}
if (!ssh->cfg.nopty) {
+ /* Unpick the terminal-speed string. */
+ /* XXX perhaps we should allow no speeds to be sent. */
+ int ospeed = 38400, ispeed = 38400; /* last-resort defaults */
+ sscanf(ssh->cfg.termspeed, "%d,%d", &ospeed, &ispeed);
+ /* Send the pty request. */
send_packet(ssh, SSH1_CMSG_REQUEST_PTY,
PKT_STR, ssh->cfg.termtype,
PKT_INT, ssh->term_height,
PKT_INT, ssh->term_width,
- PKT_INT, 0, PKT_INT, 0, PKT_CHAR, 0, PKT_END);
+ PKT_INT, 0, PKT_INT, 0, /* width,height in pixels */
+ PKT_CHAR, 192, PKT_INT, ispeed, /* TTY_OP_ISPEED */
+ PKT_CHAR, 193, PKT_INT, ospeed, /* TTY_OP_OSPEED */
+ PKT_CHAR, 0, PKT_END);
ssh->state = SSH_STATE_INTERMED;
do {
crReturnV;
c_write_str(ssh, "Server refused to allocate pty\r\n");
ssh->editing = ssh->echoing = 1;
}
- logevent("Allocated pty");
+ logeventf(ssh, "Allocated pty (ospeed %dbps, ispeed %dbps)",
+ ospeed, ispeed);
} else {
ssh->editing = ssh->echoing = 1;
}
* Now allocate a pty for the session.
*/
if (!ssh->cfg.nopty) {
+ /* Unpick the terminal-speed string. */
+ /* XXX perhaps we should allow no speeds to be sent. */
+ int ospeed = 38400, ispeed = 38400; /* last-resort defaults */
+ sscanf(ssh->cfg.termspeed, "%d,%d", &ospeed, &ispeed);
+ /* Build the pty request. */
ssh2_pkt_init(ssh, SSH2_MSG_CHANNEL_REQUEST);
ssh2_pkt_adduint32(ssh, ssh->mainchan->remoteid); /* recipient channel */
ssh2_pkt_addstring(ssh, "pty-req");
ssh2_pkt_adduint32(ssh, 0); /* pixel width */
ssh2_pkt_adduint32(ssh, 0); /* pixel height */
ssh2_pkt_addstring_start(ssh);
- ssh2_pkt_addstring_data(ssh, "\0", 1); /* TTY_OP_END, no special options */
+ ssh2_pkt_addbyte(ssh, 128); /* TTY_OP_ISPEED */
+ ssh2_pkt_adduint32(ssh, ispeed);
+ ssh2_pkt_addbyte(ssh, 129); /* TTY_OP_OSPEED */
+ ssh2_pkt_adduint32(ssh, ospeed);
+ ssh2_pkt_addstring_data(ssh, "\0", 1); /* TTY_OP_END */
ssh2_pkt_send(ssh);
ssh->state = SSH_STATE_INTERMED;
c_write_str(ssh, "Server refused to allocate pty\r\n");
ssh->editing = ssh->echoing = 1;
} else {
- logevent("Allocated pty");
+ logeventf(ssh, "Allocated pty (ospeed %dbps, ispeed %dbps)",
+ ospeed, ispeed);
}
} else {
ssh->editing = ssh->echoing = 1;
#define WINHELP_CTX_appearance_hidemouse "appearance.hidemouse"
#define WINHELP_CTX_appearance_border "appearance.border"
#define WINHELP_CTX_connection_termtype "connection.termtype"
+#define WINHELP_CTX_connection_termspeed "connection.termspeed"
#define WINHELP_CTX_connection_username "connection.username"
#define WINHELP_CTX_connection_keepalive "connection.keepalive"
#define WINHELP_CTX_connection_nodelay "connection.nodelay"
#define WINHELP_CTX_proxy_auth "proxy.auth"
#define WINHELP_CTX_proxy_command "proxy.command"
#define WINHELP_CTX_proxy_socksver "proxy.socksver"
-#define WINHELP_CTX_telnet_termspeed "telnet.termspeed"
#define WINHELP_CTX_telnet_environ "telnet.environ"
#define WINHELP_CTX_telnet_oldenviron "telnet.oldenviron"
#define WINHELP_CTX_telnet_passive "telnet.passive"
#define WINHELP_CTX_telnet_specialkeys "telnet.specialkeys"
#define WINHELP_CTX_telnet_newline "telnet.newline"
-#define WINHELP_CTX_rlogin_termspeed "rlogin.termspeed"
#define WINHELP_CTX_rlogin_localuser "rlogin.localuser"
#define WINHELP_CTX_ssh_nopty "ssh.nopty"
#define WINHELP_CTX_ssh_ciphers "ssh.ciphers"