summaryrefslogtreecommitdiff
path: root/src/os_win32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-13 22:30:11 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-13 22:30:11 +0200
commit57da69816872d53038e8a7e8dd4dc39a31192f0d (patch)
tree39106371159bdf50be5a35c4da1e542d0601f0eb /src/os_win32.c
parentdbec74907eb614517bcf27116d5aad32e087f241 (diff)
downloadvim-git-57da69816872d53038e8a7e8dd4dc39a31192f0d.tar.gz
patch 8.1.2027: MS-Windows: problem with ambiwidth charactersv8.1.2027
Problem: MS-Windows: problem with ambiwidth characters. Solution: handle ambiguous width characters in ConPTY on Windows 10 (1903). (Nobuhiro Takasaki, closes #4411)
Diffstat (limited to 'src/os_win32.c')
-rw-r--r--src/os_win32.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/os_win32.c b/src/os_win32.c
index 5bff89ad3..ae77e40eb 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -186,6 +186,7 @@ static int win32_setattrs(char_u *name, int attrs);
static int win32_set_archive(char_u *name);
static int conpty_working = 0;
+static int conpty_type = 0;
static int conpty_stable = 0;
static void vtp_flag_init();
@@ -7249,9 +7250,25 @@ mch_setenv(char *var, char *value, int x)
/*
* Support for pseudo-console (ConPTY) was added in windows 10
- * version 1809 (October 2018 update). However, that version is unstable.
+ * version 1809 (October 2018 update).
*/
#define CONPTY_FIRST_SUPPORT_BUILD MAKE_VER(10, 0, 17763)
+
+/*
+ * ConPTY differences between versions, need different logic.
+ * version 1903 (May 2019 update).
+ */
+#define CONPTY_1903_BUILD MAKE_VER(10, 0, 18362)
+
+/*
+ * Confirm until this version. Also the logic changes.
+ * insider preview.
+ */
+#define CONPTY_INSIDER_BUILD MAKE_VER(10, 0, 18898)
+
+/*
+ * Not stable now.
+ */
#define CONPTY_STABLE_BUILD MAKE_VER(10, 0, 32767) // T.B.D.
static void
@@ -7281,6 +7298,12 @@ vtp_flag_init(void)
if (ver >= CONPTY_STABLE_BUILD)
conpty_stable = 1;
+ if (ver <= CONPTY_INSIDER_BUILD)
+ conpty_type = 3;
+ if (ver <= CONPTY_1903_BUILD)
+ conpty_type = 2;
+ if (ver < CONPTY_FIRST_SUPPORT_BUILD)
+ conpty_type = 1;
}
#if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) || defined(PROTO)
@@ -7503,6 +7526,12 @@ has_conpty_working(void)
}
int
+get_conpty_type(void)
+{
+ return conpty_type;
+}
+
+ int
is_conpty_stable(void)
{
return conpty_stable;