From 40a4c6e06c6b785ee15fd5283eb0d628ddd43408 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 19 Aug 2019 20:38:15 +0100 Subject: [PATCH] Unix Plink: stop zeroing out the terminal size in pty-req. I noticed today that when you use Unix Plink interactively, to run a tty session on a remote host starting from a local tty, it doesn't copy the local terminal size into the "pty-req" channel request. It looks as if this is a bug introduced in 2ca0070f8, when I broke up ssh.c. Before that, the monolithic Ssh init procedure set ssh->term_width and ssh->term_height from the Conf you passed in. Afterwards, variables of the same name existed in both ssh.c *and* ssh2connection.c (the former so that it can buffer window-size changes before a connection layer yet exists to pass them on to), but somehow, *neither* source file remembered to initialise them from the Conf. Fixed by reinstating the initialisation in ssh.c. (For the same reason as above: you want the values in Conf to be overwritten if the window size changes between ssh_init and ssh2_connection_new.) --- ssh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ssh.c b/ssh.c index a1f8d9ac..f7957bb0 100644 --- a/ssh.c +++ b/ssh.c @@ -887,6 +887,9 @@ static const char *ssh_init(Seat *seat, Backend **backend_handle, ssh->ic_out_raw.fn = ssh_bpp_output_raw_data_callback; ssh->ic_out_raw.ctx = ssh; + ssh->term_width = conf_get_int(ssh->conf, CONF_width); + ssh->term_height = conf_get_int(ssh->conf, CONF_height); + ssh->backend.vt = &ssh_backend; *backend_handle = &ssh->backend;