summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
authorMike Williams <mikew@globalgraphics.com>2021-06-30 20:56:00 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-30 20:56:00 +0200
commita3d1b29bd36487167c98b3cefa30f06c529e412d (patch)
treec2f313a89feb1b97cdd945ce904d258b518e9cae /src/option.c
parent834193afd7195bc96026d2aed696d64f8075cd35 (diff)
patch 8.2.3079: Powershell core not supported by defaultv8.2.3079
Problem: Powershell core not supported by default. Solution: Set option defaults for "pwsh". (Mike Williams, closes #8481)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c
index 5fc059e29d..ae303106ad 100644
--- a/src/option.c
+++ b/src/option.c
@@ -933,8 +933,8 @@ set_init_3(void)
}
}
# ifdef MSWIN
- // PowerShell 5.1/.NET outputs UTF-16 with BOM so re-encode to the
- // current codepage
+ // Windows PowerShell output is UTF-16 with BOM so re-encode to the
+ // current codepage.
else if ( fnamecmp(p, "powershell") == 0
|| fnamecmp(p, "powershell.exe") == 0
)
@@ -965,6 +965,7 @@ set_init_3(void)
|| fnamecmp(p, "fish") == 0
|| fnamecmp(p, "ash") == 0
|| fnamecmp(p, "dash") == 0
+ || fnamecmp(p, "pwsh") == 0
# ifdef MSWIN
|| fnamecmp(p, "cmd") == 0
|| fnamecmp(p, "sh.exe") == 0
@@ -976,6 +977,7 @@ set_init_3(void)
|| fnamecmp(p, "bash.exe") == 0
|| fnamecmp(p, "cmd.exe") == 0
|| fnamecmp(p, "dash.exe") == 0
+ || fnamecmp(p, "pwsh.exe") == 0
# endif
)
{
@@ -985,7 +987,10 @@ set_init_3(void)
# ifdef MSWIN
p_sp = (char_u *)">%s 2>&1";
# else
- p_sp = (char_u *)"2>&1| tee";
+ if (fnamecmp(p, "pwsh") == 0)
+ p_sp = (char_u *)">%s 2>&1";
+ else
+ p_sp = (char_u *)"2>&1| tee";
# endif
options[idx_sp].def_val[VI_DEFAULT] = p_sp;
}
@@ -1011,6 +1016,7 @@ set_init_3(void)
* p_shcf p_sxq
* cmd.exe - "/c" "("
* powershell.exe - "-Command" "\""
+ * pwsh.exe - "-c" "\""
* "sh" like shells - "-c" "\""
*
* For Win32 p_sxq is set instead of p_shq to include shell redirection.