patch 8.1.0880: MS-Windows: inconsistent selection of winpty/conpty

Problem:    MS-Windows: inconsistent selection of winpty/conpty.
Solution:   Name option 'termwintype', use ++type argument and "term_pty" for
            term_start(). (Hirohito Higashi, closes #3915)
diff --git a/src/channel.c b/src/channel.c
index 484d013..34a1fc3 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -4947,27 +4947,27 @@
 		opt->jo_set2 |= JO2_TERM_KILL;
 		opt->jo_term_kill = tv_get_string_chk(item);
 	    }
-	    else if (STRCMP(hi->hi_key, "term_mode") == 0)
+	    else if (STRCMP(hi->hi_key, "tty_type") == 0)
 	    {
 		char_u *p;
 
-		if (!(supported2 & JO2_TERM_MODE))
+		if (!(supported2 & JO2_TTY_TYPE))
 		    break;
-		opt->jo_set2 |= JO2_TERM_MODE;
+		opt->jo_set2 |= JO2_TTY_TYPE;
 		p = tv_get_string_chk(item);
 		if (p == NULL)
 		{
-		    semsg(_(e_invargval), "term_mode");
+		    semsg(_(e_invargval), "tty_type");
 		    return FAIL;
 		}
 		// Allow empty string, "winpty", "conpty".
 		if (!(*p == NUL || STRCMP(p, "winpty") == 0
 					          || STRCMP(p, "conpty") == 0))
 		{
-		    semsg(_(e_invargval), "term_mode");
+		    semsg(_(e_invargval), "tty_type");
 		    return FAIL;
 		}
-		opt->jo_term_mode = p[0];
+		opt->jo_tty_type = p[0];
 	    }
 # if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
 	    else if (STRCMP(hi->hi_key, "ansi_colors") == 0)
@@ -5194,6 +5194,9 @@
 #ifdef UNIX
     vim_free(job->jv_termsig);
 #endif
+#ifdef WIN3264
+    vim_free(job->jv_tty_type);
+#endif
     free_callback(job->jv_exit_cb, job->jv_exit_partial);
     if (job->jv_argv != NULL)
     {
@@ -5963,6 +5966,9 @@
 #ifdef UNIX
     dict_add_string(dict, "termsig", job->jv_termsig);
 #endif
+#ifdef WIN3264
+    dict_add_string(dict, "tty_type", job->jv_tty_type);
+#endif
 
     l = list_alloc();
     if (l != NULL)