From dcf44663057ec4df3581f8fd2a31c65a98e6988a Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 3 May 2016 08:43:50 +0100 Subject: [PATCH] Send the IUTF8 terminal mode in SSH "pty-req"s. An opcode for this was recently published in https://tools.ietf.org/html/draft-sgtatham-secsh-iutf8-00 . The default setting is conditional on frontend_is_utf8(), which is consistent with the pty back end's policy for setting the same flag locally. Of course, users can override the setting either way in the GUI configurer, the same as all other tty modes. --- settings.c | 10 +++++----- ssh.c | 1 + terminal.c | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/settings.c b/settings.c index 0df7bb87..fcccb850 100644 --- a/settings.c +++ b/settings.c @@ -54,11 +54,11 @@ const char *const ttymodes[] = { "SWTCH", "STATUS", "DISCARD", "IGNPAR", "PARMRK", "INPCK", "ISTRIP", "INLCR", "IGNCR", "ICRNL", "IUCLC", "IXON", "IXANY", "IXOFF", "IMAXBEL", - "ISIG", "ICANON", "XCASE", "ECHO", "ECHOE", - "ECHOK", "ECHONL", "NOFLSH", "TOSTOP", "IEXTEN", - "ECHOCTL", "ECHOKE", "PENDIN", "OPOST", "OLCUC", - "ONLCR", "OCRNL", "ONOCR", "ONLRET", "CS7", - "CS8", "PARENB", "PARODD", NULL + "IUTF8", "ISIG", "ICANON", "XCASE", "ECHO", + "ECHOE", "ECHOK", "ECHONL", "NOFLSH", "TOSTOP", + "IEXTEN", "ECHOCTL", "ECHOKE", "PENDIN", "OPOST", + "OLCUC", "ONLCR", "OCRNL", "ONOCR", "ONLRET", + "CS7", "CS8", "PARENB", "PARODD", NULL }; /* diff --git a/ssh.c b/ssh.c index 3fbd2b65..476518f8 100644 --- a/ssh.c +++ b/ssh.c @@ -125,6 +125,7 @@ static const struct ssh_ttymode { { "IXANY", 39, TTY_OP_BOOL }, { "IXOFF", 40, TTY_OP_BOOL }, { "IMAXBEL", 41, TTY_OP_BOOL }, + { "IUTF8", 42, TTY_OP_BOOL }, { "ISIG", 50, TTY_OP_BOOL }, { "ICANON", 51, TTY_OP_BOOL }, { "XCASE", 52, TTY_OP_BOOL }, diff --git a/terminal.c b/terminal.c index 26a3f0c9..7a444b71 100644 --- a/terminal.c +++ b/terminal.c @@ -6374,6 +6374,8 @@ char *term_get_ttymode(Terminal *term, const char *mode) const char *val = NULL; if (strcmp(mode, "ERASE") == 0) { val = term->bksp_is_delete ? "^?" : "^H"; + } else if (strcmp(mode, "IUTF8") == 0) { + val = frontend_is_utf8(term->frontend) ? "yes" : "no"; } /* FIXME: perhaps we should set ONLCR based on lfhascr as well? */ /* FIXME: or ECHO and friends based on local echo state? */