summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-13 19:23:10 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-13 19:23:10 +0100
commitd9ef1b8d77f304c83241f807c17ffa26c9033778 (patch)
tree6ee2529331b75406746e699dc7af020e00ecdf7b /src
parent9403a2168db82b7de80f792984084bb3f00e2263 (diff)
patch 8.1.0909: MS-Windows: using ConPTY even though it is not stablev8.1.0909
Problem: MS-Windows: using ConPTY even though it is not stable. Solution: When ConPTY version is unstable, prefer using winpty. (Ken Takata, closes #3949)
Diffstat (limited to 'src')
-rw-r--r--src/os_win32.c25
-rw-r--r--src/proto/os_win32.pro4
-rw-r--r--src/terminal.c4
-rw-r--r--src/version.c2
4 files changed, 27 insertions, 8 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index 10ca41881e..0680346af0 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -187,6 +187,8 @@ static int win32_setattrs(char_u *name, int attrs);
static int win32_set_archive(char_u *name);
static int vtp_working = 0;
+static int conpty_working = 0;
+static int conpty_stable = 0;
static void vtp_flag_init();
#ifndef FEAT_GUI_W32
@@ -7638,9 +7640,10 @@ mch_setenv(char *var, char *value, int x)
/*
* Support for pseudo-console (ConPTY) was added in windows 10
- * version 1809 (October 2018 update).
+ * version 1809 (October 2018 update). However, that version is unstable.
*/
-#define CONPTY_FIRST_SUPPORT_BUILD MAKE_VER(10, 0, 17763)
+#define CONPTY_FIRST_SUPPORT_BUILD MAKE_VER(10, 0, 17763)
+#define CONPTY_STABLE_BUILD MAKE_VER(10, 0, 32767) // T.B.D.
static void
vtp_flag_init(void)
@@ -7659,10 +7662,10 @@ vtp_flag_init(void)
vtp_working = 0;
#endif
-#ifdef FEAT_GUI_W32
if (ver >= CONPTY_FIRST_SUPPORT_BUILD)
- vtp_working = 1;
-#endif
+ conpty_working = 1;
+ if (ver >= CONPTY_STABLE_BUILD)
+ conpty_stable = 1;
}
@@ -7878,3 +7881,15 @@ has_vtp_working(void)
{
return vtp_working;
}
+
+ int
+has_conpty_working(void)
+{
+ return conpty_working;
+}
+
+ int
+is_conpty_stable(void)
+{
+ return conpty_stable;
+}
diff --git a/src/proto/os_win32.pro b/src/proto/os_win32.pro
index 7f45c5cf16..6157e011fd 100644
--- a/src/proto/os_win32.pro
+++ b/src/proto/os_win32.pro
@@ -70,7 +70,9 @@ void set_alist_count(void);
void fix_arg_enc(void);
int mch_setenv(char *var, char *value, int x);
void control_console_color_rgb(void);
-int has_vtp_working(void);
int use_vtp(void);
int is_term_win32(void);
+int has_vtp_working(void);
+int has_conpty_working(void);
+int is_conpty_stable(void);
/* vim: set ft=c : */
diff --git a/src/terminal.c b/src/terminal.c
index 2544f8567a..3be2698586 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -5521,7 +5521,7 @@ dyn_conpty_init(int verbose)
if (handled)
return result;
- if (!has_vtp_working())
+ if (!has_conpty_working())
{
handled = TRUE;
result = FAIL;
@@ -6139,7 +6139,7 @@ term_and_job_init(
if (tty_type == NUL)
{
- if (has_conpty)
+ if (has_conpty && (is_conpty_stable() || !has_winpty))
use_conpty = TRUE;
else if (has_winpty)
use_winpty = TRUE;
diff --git a/src/version.c b/src/version.c
index a6d7addc69..bc4ae279bd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -784,6 +784,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 909,
+/**/
908,
/**/
907,