summaryrefslogtreecommitdiffstats
path: root/runtime/doc/os_dos.txt
diff options
context:
space:
mode:
authorMike Williams <mikew@globalgraphics.com>2021-06-28 20:53:58 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-28 20:53:58 +0200
commit127950241e84c822d3c50f46a00d42a70d2d5cb6 (patch)
tree6b5a0ac43a29edeb6e1cc3c3fb9f7c6f966cb28e /runtime/doc/os_dos.txt
parentffec6dd16a766180429addaa78928c773a3c9832 (diff)
patch 8.2.3071: shell options are not set properly for PowerShellv8.2.3071
Problem: Shell options are not set properly for PowerShell. Solution: Use better option defaults. (Mike Willams, closes #8459)
Diffstat (limited to 'runtime/doc/os_dos.txt')
-rw-r--r--runtime/doc/os_dos.txt45
1 files changed, 42 insertions, 3 deletions
diff --git a/runtime/doc/os_dos.txt b/runtime/doc/os_dos.txt
index 925c7e0915..b45cb088cb 100644
--- a/runtime/doc/os_dos.txt
+++ b/runtime/doc/os_dos.txt
@@ -17,6 +17,7 @@ versions of Vim. Also see |os_win32.txt| and |os_msdos.txt|.
7. Interrupting |dos-CTRL-Break|
8. Temp files |dos-temp-files|
9. Shell option default |dos-shell|
+10. PowerShell |dos-powershell|
==============================================================================
1. File locations *dos-locations*
@@ -297,8 +298,46 @@ For Win32 as:
<shell> -c "command name >file"
For DOS 32 bit, DJGPP does this internally somehow.
-When starting up, Vim checks for the presence of "sh" anywhere in the 'shell'
-option. If it is present, Vim sets the 'shellcmdflag' and 'shellquote' or
-'shellxquote' options will be set as described above.
+When starting up, if Vim does not recognise a standard Windows shell it checks
+for the presence of "sh" anywhere in the 'shell' option. If it is present,
+Vim sets the 'shellcmdflag' and 'shellquote' or 'shellxquote' options will be
+set as described above.
+
+==============================================================================
+10. PowerShell *dos-powershell*
+
+Vim also supports Windows PowerShell. If 'shell' has been set to
+"powershell.exe" at startup then VIM sets 'shellcmdflag', 'shellxquote',
+'shellpipe', and 'shellredir' options to the following values:
+
+'shellcmdflag' -Command
+'shellxquote' "
+'shellpipe' 2>&1 | Out-File -Encoding default
+'shellredir' 2>&1 | Out-File -Encoding default
+
+If you find that PowerShell commands are taking a long time to run then try
+setting 'shellcmdflag' to "-NoProfile -Command". Note this will prevent any
+PowerShell environment setup by the profile from taking place.
+
+If you have problems running PowerShell scripts through the 'shell' then try
+setting 'shellcmdflag' to "-ExecutionPolicy RemoteSigned -Command". See
+online Windows documentation for more information on PowerShell Execution
+Policy settings.
+
+The 'shellpipe' and 'shellredir' option values re-encode the UTF-16le output
+from Windows PowerShell to your currently configured console codepage. The
+output can be forced into a different encoding by changing "default" to one of
+the following:
+
+ unicode - UTF-16le (default output from PowerShell 5.1)
+ bigendianunicode - UTF-16
+ utf8 - UTF-8
+ utf7 - UTF-7 (no-BOM)
+ utf32 - UTF-32
+ ascii - 7-bit ASCII character set
+ default - System's active code page (typically ANSI)
+ oem - System's current OEM code page
+
+Note Multi-byte Unicode encodings include a leading BOM.
vim:tw=78:ts=8:noet:ft=help:norl: