comparison src/option.c @ 25084:beff72446e2e v8.2.3079

patch 8.2.3079: Powershell core not supported by default Commit: https://github.com/vim/vim/commit/a3d1b29bd36487167c98b3cefa30f06c529e412d Author: Mike Williams <mikew@globalgraphics.com> Date: Wed Jun 30 20:56:00 2021 +0200 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 https://github.com/vim/vim/issues/8481)
author Bram Moolenaar <Bram@vim.org>
date Wed, 30 Jun 2021 21:00:05 +0200
parents 0ce24f734615
children b32c83317492
comparison
equal deleted inserted replaced
25083:05c4686c56d2 25084:beff72446e2e
931 p_srr = (char_u *)">&"; 931 p_srr = (char_u *)">&";
932 options[idx_srr].def_val[VI_DEFAULT] = p_srr; 932 options[idx_srr].def_val[VI_DEFAULT] = p_srr;
933 } 933 }
934 } 934 }
935 # ifdef MSWIN 935 # ifdef MSWIN
936 // PowerShell 5.1/.NET outputs UTF-16 with BOM so re-encode to the 936 // Windows PowerShell output is UTF-16 with BOM so re-encode to the
937 // current codepage 937 // current codepage.
938 else if ( fnamecmp(p, "powershell") == 0 938 else if ( fnamecmp(p, "powershell") == 0
939 || fnamecmp(p, "powershell.exe") == 0 939 || fnamecmp(p, "powershell.exe") == 0
940 ) 940 )
941 { 941 {
942 # if defined(FEAT_QUICKFIX) 942 # if defined(FEAT_QUICKFIX)
963 || fnamecmp(p, "zsh-beta") == 0 963 || fnamecmp(p, "zsh-beta") == 0
964 || fnamecmp(p, "bash") == 0 964 || fnamecmp(p, "bash") == 0
965 || fnamecmp(p, "fish") == 0 965 || fnamecmp(p, "fish") == 0
966 || fnamecmp(p, "ash") == 0 966 || fnamecmp(p, "ash") == 0
967 || fnamecmp(p, "dash") == 0 967 || fnamecmp(p, "dash") == 0
968 || fnamecmp(p, "pwsh") == 0
968 # ifdef MSWIN 969 # ifdef MSWIN
969 || fnamecmp(p, "cmd") == 0 970 || fnamecmp(p, "cmd") == 0
970 || fnamecmp(p, "sh.exe") == 0 971 || fnamecmp(p, "sh.exe") == 0
971 || fnamecmp(p, "ksh.exe") == 0 972 || fnamecmp(p, "ksh.exe") == 0
972 || fnamecmp(p, "mksh.exe") == 0 973 || fnamecmp(p, "mksh.exe") == 0
974 || fnamecmp(p, "zsh.exe") == 0 975 || fnamecmp(p, "zsh.exe") == 0
975 || fnamecmp(p, "zsh-beta.exe") == 0 976 || fnamecmp(p, "zsh-beta.exe") == 0
976 || fnamecmp(p, "bash.exe") == 0 977 || fnamecmp(p, "bash.exe") == 0
977 || fnamecmp(p, "cmd.exe") == 0 978 || fnamecmp(p, "cmd.exe") == 0
978 || fnamecmp(p, "dash.exe") == 0 979 || fnamecmp(p, "dash.exe") == 0
980 || fnamecmp(p, "pwsh.exe") == 0
979 # endif 981 # endif
980 ) 982 )
981 { 983 {
982 # if defined(FEAT_QUICKFIX) 984 # if defined(FEAT_QUICKFIX)
983 if (do_sp) 985 if (do_sp)
984 { 986 {
985 # ifdef MSWIN 987 # ifdef MSWIN
986 p_sp = (char_u *)">%s 2>&1"; 988 p_sp = (char_u *)">%s 2>&1";
987 # else 989 # else
988 p_sp = (char_u *)"2>&1| tee"; 990 if (fnamecmp(p, "pwsh") == 0)
991 p_sp = (char_u *)">%s 2>&1";
992 else
993 p_sp = (char_u *)"2>&1| tee";
989 # endif 994 # endif
990 options[idx_sp].def_val[VI_DEFAULT] = p_sp; 995 options[idx_sp].def_val[VI_DEFAULT] = p_sp;
991 } 996 }
992 # endif 997 # endif
993 if (do_srr) 998 if (do_srr)
1009 * Default values depend on shell (cmd.exe is default shell): 1014 * Default values depend on shell (cmd.exe is default shell):
1010 * 1015 *
1011 * p_shcf p_sxq 1016 * p_shcf p_sxq
1012 * cmd.exe - "/c" "(" 1017 * cmd.exe - "/c" "("
1013 * powershell.exe - "-Command" "\"" 1018 * powershell.exe - "-Command" "\""
1019 * pwsh.exe - "-c" "\""
1014 * "sh" like shells - "-c" "\"" 1020 * "sh" like shells - "-c" "\""
1015 * 1021 *
1016 * For Win32 p_sxq is set instead of p_shq to include shell redirection. 1022 * For Win32 p_sxq is set instead of p_shq to include shell redirection.
1017 */ 1023 */
1018 if (strstr((char *)gettail(p_sh), "powershell") != NULL) 1024 if (strstr((char *)gettail(p_sh), "powershell") != NULL)