diff src/os_win32.c @ 15804:864ec0dd71b9 v8.1.0909

patch 8.1.0909: MS-Windows: using ConPTY even though it is not stable commit https://github.com/vim/vim/commit/d9ef1b8d77f304c83241f807c17ffa26c9033778 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 13 19:23:10 2019 +0100 patch 8.1.0909: MS-Windows: using ConPTY even though it is not stable Problem: MS-Windows: using ConPTY even though it is not stable. Solution: When ConPTY version is unstable, prefer using winpty. (Ken Takata, closes #3949)
author Bram Moolenaar <Bram@vim.org>
date Wed, 13 Feb 2019 19:30:09 +0100
parents a3e2e7948ee4
children cea7a0fde805
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -187,6 +187,8 @@ static int win32_setattrs(char_u *name, 
 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).
- */
-#define CONPTY_FIRST_SUPPORT_BUILD MAKE_VER(10, 0, 17763)
+ * version 1809 (October 2018 update).  However, that version is unstable.
+ */
+#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;
+}