mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Fix copymode when hlimit mismatches the client side
This commit is contained in:
parent
6b31869600
commit
278b20f506
@ -99,12 +99,9 @@ static void unpack_array(struct tmate_unpacker *uk,
|
|||||||
static void tmate_header(struct tmate_unpacker *uk)
|
static void tmate_header(struct tmate_unpacker *uk)
|
||||||
{
|
{
|
||||||
char hostname[128];
|
char hostname[128];
|
||||||
int protocol = unpack_int(uk);
|
tmate_client.protocol = unpack_int(uk);
|
||||||
|
|
||||||
if (protocol != 1)
|
tmate_debug("new master, protocol version: %d", tmate_client.protocol);
|
||||||
decoder_error();
|
|
||||||
|
|
||||||
tmate_debug("new master, protocol version: %d", protocol);
|
|
||||||
|
|
||||||
if (gethostname(hostname, sizeof(hostname)) < 0)
|
if (gethostname(hostname, sizeof(hostname)) < 0)
|
||||||
tmate_fatal("cannot get hostname");
|
tmate_fatal("cannot get hostname");
|
||||||
@ -356,6 +353,11 @@ static void tmate_sync_copy_mode(struct tmate_unpacker *uk)
|
|||||||
if (sel_uk.argc) {
|
if (sel_uk.argc) {
|
||||||
data->screen.sel.flag = 1;
|
data->screen.sel.flag = 1;
|
||||||
data->selx = unpack_int(&sel_uk);
|
data->selx = unpack_int(&sel_uk);
|
||||||
|
if (tmate_client.protocol >= 2) {
|
||||||
|
data->sely = -unpack_int(&sel_uk) + screen_hsize(data->backing)
|
||||||
|
+ screen_size_y(data->backing)
|
||||||
|
- 1;
|
||||||
|
} else
|
||||||
data->sely = unpack_int(&sel_uk);
|
data->sely = unpack_int(&sel_uk);
|
||||||
data->rectflag = unpack_int(&sel_uk);
|
data->rectflag = unpack_int(&sel_uk);
|
||||||
} else
|
} else
|
||||||
|
3
tmate.h
3
tmate.h
@ -99,6 +99,9 @@ struct tmate_ssh_client {
|
|||||||
struct event ev_ssh;
|
struct event ev_ssh;
|
||||||
struct event ev_keepalive_timer;
|
struct event ev_keepalive_timer;
|
||||||
|
|
||||||
|
/* only for tmux client */
|
||||||
|
int protocol;
|
||||||
|
|
||||||
/* only for client-pty */
|
/* only for client-pty */
|
||||||
int pty;
|
int pty;
|
||||||
struct event ev_pty;
|
struct event ev_pty;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user