to point to the right file, if needed. If you have both the 32-bit and 64-bit
version, rename to winpty32.dll and winpty64.dll to match the way Vim was
build.
- *ConPTY*
+ *ConPTY* *E982*
On more recent versions of MS-Windows 10 (beginning with the "October 2018
Update"), winpty is no longer required. On those versions, |:terminal| will use
Windows' built-in support for hosting terminal applications, "ConPTY". When
ConPTY is in use, there may be rendering artifacts regarding ambiguous-width
-characters. If you encounter any such issues, set 'termwintype' to "winpty"
-(which you then must have instlled).
+characters. If you encounter any such issues, install "winpty". Until the
+ConPTY problems have been fixed "winpty" will be preferred.
Environment variables are used to pass information to the running job:
VIM_SERVERNAME v:servername
static int
dyn_conpty_init(int verbose)
{
- static BOOL handled = FALSE;
- static int result;
- HMODULE hKerneldll;
- int i;
+ static HMODULE hKerneldll = NULL;
+ int i;
static struct
{
char *name;
{NULL, NULL}
};
- if (handled)
- return result;
-
if (!has_conpty_working())
{
- handled = TRUE;
- result = FAIL;
+ if (verbose)
+ emsg(_("E982: ConPTY is not available"));
return FAIL;
}
+ // No need to initialize twice.
+ if (hKerneldll)
+ return OK;
+
hKerneldll = vimLoadLib("kernel32.dll");
for (i = 0; conpty_entry[i].name != NULL
&& conpty_entry[i].ptr != NULL; ++i)
{
if (verbose)
semsg(_(e_loadfunc), conpty_entry[i].name);
+ hKerneldll = NULL;
return FAIL;
}
}
- handled = TRUE;
- result = OK;
return OK;
}
{
if (verbose)
semsg(_(e_loadfunc), winpty_entry[i].name);
+ hWinPtyDLL = NULL;
return FAIL;
}
}