patch 8.0.0949: winpty.dll name is fixed
Problem: winpty.dll name is fixed.
Solution: Add the 'winptydll' option. Make the default name depend on
whether it is a 32-bit or 64-bit build. (idea by Yasuhiro
Matsumoto, closes #1978)
diff --git a/src/option.c b/src/option.c
index 1877b7e..3dc52f8 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3098,6 +3098,20 @@
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
+ {"winptydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE,
+#if defined(WIN3264) && defined(TERMINAL)
+ (char_u *)&p_winptydll, PV_NONE, {
+# ifdef _WIN64
+ (char_u *)"winpty64.dll",
+# else
+ (char_u *)"winpty32.dll",
+# endif
+ (char_u *)0L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)0L, (char_u *)0L}
+#endif
+ SCRIPTID_INIT},
{"winwidth", "wiw", P_NUM|P_VI_DEF,
#ifdef FEAT_WINDOWS
(char_u *)&p_wiw, PV_NONE,
diff --git a/src/option.h b/src/option.h
index 9b7e88f..b772a8e 100644
--- a/src/option.h
+++ b/src/option.h
@@ -966,6 +966,9 @@
EXTERN long p_wmw; /* 'winminwidth' */
EXTERN long p_wiw; /* 'winwidth' */
#endif
+#if defined(WIN3264) && defined(TERMINAL)
+EXTERN char_u *p_winptydll; /* 'winptydll' */
+#endif
EXTERN int p_ws; /* 'wrapscan' */
EXTERN int p_write; /* 'write' */
EXTERN int p_wa; /* 'writeany' */
diff --git a/src/terminal.c b/src/terminal.c
index 149679e..c4fa847 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -38,6 +38,7 @@
* in tl_scrollback are no longer used.
*
* TODO:
+ * - make [range]terminal pipe [range] lines to the terminal
* - implement term_setsize()
* - add test for giving error for invalid 'termsize' value.
* - support minimal size when 'termsize' is "rows*cols".
@@ -2768,11 +2769,15 @@
/* No need to initialize twice. */
if (hWinPtyDLL)
return 1;
- /* Load winpty.dll */
- hWinPtyDLL = vimLoadLib(WINPTY_DLL);
+ /* Load winpty.dll, prefer using the 'winptydll' option, fall back to just
+ * winpty.dll. */
+ if (*p_winptydll != NUL)
+ hWinPtyDLL = vimLoadLib((char *)p_winptydll);
+ if (!hWinPtyDLL)
+ hWinPtyDLL = vimLoadLib(WINPTY_DLL);
if (!hWinPtyDLL)
{
- EMSG2(_(e_loadlib), WINPTY_DLL);
+ EMSG2(_(e_loadlib), *p_winptydll != NUL ? p_winptydll : WINPTY_DLL);
return 0;
}
for (i = 0; winpty_entry[i].name != NULL
diff --git a/src/version.c b/src/version.c
index b2de15d..085b2e1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 949,
+/**/
948,
/**/
947,