1
0
forked from aniani/vim

patch 8.2.3079: Powershell core not supported by default

Problem:    Powershell core not supported by default.
Solution:   Set option defaults for "pwsh". (Mike Williams, closes #8481)
This commit is contained in:
Mike Williams
2021-06-30 20:56:00 +02:00
committed by Bram Moolenaar
parent 834193afd7
commit a3d1b29bd3
10 changed files with 118 additions and 52 deletions

View File

@@ -2135,6 +2135,7 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext)
char_u *pathbuf = NULL;
char_u *pathext = NULL;
char_u *pathextbuf = NULL;
char_u *shname = NULL;
int noext = FALSE;
int retval = FALSE;
@@ -2142,8 +2143,10 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext)
return FALSE;
// Using the name directly when a Unix-shell like 'shell'.
if (strstr((char *)gettail(p_sh), "powershell") == NULL
&& strstr((char *)gettail(p_sh), "sh") != NULL)
shname = gettail(p_sh);
if (strstr((char *)shname, "sh") != NULL &&
!(strstr((char *)shname, "powershell") != NULL
|| strstr((char *)shname, "pwsh") != NULL))
noext = TRUE;
if (use_pathext)