#ifdef FEAT_TERMGUICOLORS
"termguicolors",
#endif
-#ifdef FEAT_TERMINAL
+#if defined(FEAT_TERMINAL) && !defined(WIN3264)
"terminal",
#endif
#ifdef TERMINFO
#ifdef FEAT_NETBEANS_INTG
else if (STRICMP(name, "netbeans_enabled") == 0)
n = netbeans_active();
+#endif
+#if defined(FEAT_TERMINAL) && defined(WIN3264)
+ else if (STRICMP(name, "terminal") == 0)
+ n = terminal_enabled();
#endif
}
}
}
-# ifdef WIN3264
+# if defined(WIN3264) || defined(PROTO)
/**************************************
* 2. MS-Windows implementation.
*/
+# ifndef PROTO
+
#define WINPTY_SPAWN_FLAG_AUTO_SHUTDOWN 1ul
#define WINPTY_SPAWN_FLAG_EXIT_AFTER_SHUTDOWN 2ull
#define WINPTY_DLL "winpty.dll"
static HINSTANCE hWinPtyDLL = NULL;
+# endif
- int
-dyn_winpty_init(void)
+ static int
+dyn_winpty_init(int verbose)
{
int i;
static struct
/* No need to initialize twice. */
if (hWinPtyDLL)
- return 1;
+ return OK;
/* Load winpty.dll, prefer using the 'winptydll' option, fall back to just
* winpty.dll. */
if (*p_winptydll != NUL)
hWinPtyDLL = vimLoadLib(WINPTY_DLL);
if (!hWinPtyDLL)
{
- EMSG2(_(e_loadlib), *p_winptydll != NUL ? p_winptydll : WINPTY_DLL);
- return 0;
+ if (verbose)
+ EMSG2(_(e_loadlib), *p_winptydll != NUL ? p_winptydll
+ : (char_u *)WINPTY_DLL);
+ return FAIL;
}
for (i = 0; winpty_entry[i].name != NULL
&& winpty_entry[i].ptr != NULL; ++i)
if ((*winpty_entry[i].ptr = (FARPROC)GetProcAddress(hWinPtyDLL,
winpty_entry[i].name)) == NULL)
{
- EMSG2(_(e_loadfunc), winpty_entry[i].name);
- return 0;
+ if (verbose)
+ EMSG2(_(e_loadfunc), winpty_entry[i].name);
+ return FAIL;
}
}
- return 1;
+ return OK;
}
/*
garray_T ga;
char_u *cmd;
- if (!dyn_winpty_init())
+ if (dyn_winpty_init(TRUE) == FAIL)
return FAIL;
if (argvar->v_type == VAR_STRING)
winpty_set_size(term->tl_winpty, cols, rows, NULL);
}
+ int
+terminal_enabled(void)
+{
+ return dyn_winpty_init(FALSE) == OK;
+}
+
+
# else
/**************************************