]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Send the IUTF8 terminal mode in SSH "pty-req"s.
authorSimon Tatham <anakin@pobox.com>
Tue, 3 May 2016 07:43:50 +0000 (08:43 +0100)
committerSimon Tatham <anakin@pobox.com>
Tue, 3 May 2016 10:13:48 +0000 (11:13 +0100)
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
ssh.c
terminal.c

index 0df7bb87a7304cc4733030d178be311c3ad77d6d..fcccb850fb80cc6e24c9f10288a4fcb44315e7c6 100644 (file)
@@ -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 3fbd2b65793c653a89b645b446842416faf8af6e..476518f82cc2014e7c4ab38f7270ab99c3c9656e 100644 (file)
--- 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 },
index 26a3f0c93f64b90228802ea6a50027a6500dd21d..7a444b7192647b1841fec3fe6aa6f0a79128d70a 100644 (file)
@@ -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? */