Mercurial > vim
comparison runtime/doc/os_dos.txt @ 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 | 3e661b0cf500 |
comparison
equal
deleted
inserted
replaced
25083:05c4686c56d2 | 25084:beff72446e2e |
---|---|
302 for the presence of "sh" anywhere in the 'shell' option. If it is present, | 302 for the presence of "sh" anywhere in the 'shell' option. If it is present, |
303 Vim sets the 'shellcmdflag' and 'shellquote' or 'shellxquote' options will be | 303 Vim sets the 'shellcmdflag' and 'shellquote' or 'shellxquote' options will be |
304 set as described above. | 304 set as described above. |
305 | 305 |
306 ============================================================================== | 306 ============================================================================== |
307 10. PowerShell *dos-powershell* | 307 10. PowerShell *dos-powershell* *dos-pwsh* |
308 | 308 |
309 Vim also supports Windows PowerShell. If 'shell' has been set to | 309 Vim supports PowerShell Desktop and PowerShell Core. PowerShell Desktop is |
310 "powershell.exe" at startup then VIM sets 'shellcmdflag', 'shellxquote', | 310 the version of PowerShell that is installed with Windows, while PowerShell |
311 'shellpipe', and 'shellredir' options to the following values: | 311 Core is a separate downloadable version that works cross-platform. To see |
312 which version you are using then enter the following in a PowerShell prompt - | |
313 $PSVersionTable.PSEdition | |
314 | |
315 If 'shell' includes "powershell" in the filename at startup then VIM sets | |
316 'shellcmdflag', 'shellxquote', 'shellpipe', and 'shellredir' options to the | |
317 following values: | |
312 | 318 |
313 'shellcmdflag' -Command | 319 'shellcmdflag' -Command |
314 'shellxquote' " | 320 'shellxquote' " |
315 'shellpipe' 2>&1 | Out-File -Encoding default | 321 'shellpipe' 2>&1 | Out-File -Encoding default |
316 'shellredir' 2>&1 | Out-File -Encoding default | 322 'shellredir' 2>&1 | Out-File -Encoding default |
317 | 323 |
324 If 'shell' includes "pwsh" in the filename at startup then VIM sets | |
325 'shellcmdflag', 'shellxquote', 'shellpipe', and 'shellredir' options to the | |
326 following values: | |
327 | |
328 'shellcmdflag' -c | |
329 'shellxquote' " | |
330 'shellpipe' >%s 2>&1 | |
331 'shellredir' >%s 2>&1 | |
332 | |
318 If you find that PowerShell commands are taking a long time to run then try | 333 If you find that PowerShell commands are taking a long time to run then try |
319 setting 'shellcmdflag' to "-NoProfile -Command". Note this will prevent any | 334 with "-NoProfile" at the beginning of the 'shellcmdflag'. Note this will |
320 PowerShell environment setup by the profile from taking place. | 335 prevent any PowerShell environment setup by the profile from taking place. |
321 | 336 |
322 If you have problems running PowerShell scripts through the 'shell' then try | 337 If you have problems running PowerShell scripts through the 'shell' then try |
323 setting 'shellcmdflag' to "-ExecutionPolicy RemoteSigned -Command". See | 338 with "-ExecutionPolicy RemoteSigned -Command" at the beginning of |
324 online Windows documentation for more information on PowerShell Execution | 339 'shellcmdflag'. See online Windows documentation for more information on |
325 Policy settings. | 340 PowerShell Execution Policy settings. |
341 | |
342 See |option-backslash| about including spaces in 'shellcmdflag' when using | |
343 multiple flags. | |
326 | 344 |
327 The 'shellpipe' and 'shellredir' option values re-encode the UTF-16le output | 345 The 'shellpipe' and 'shellredir' option values re-encode the UTF-16le output |
328 from Windows PowerShell to your currently configured console codepage. The | 346 from PowerShell Desktop to your currently configured console codepage. The |
329 output can be forced into a different encoding by changing "default" to one of | 347 output can be forced into a different encoding by changing "default" to one of |
330 the following: | 348 the following: |
331 | 349 |
332 unicode - UTF-16le (default output from PowerShell 5.1) | 350 unicode - UTF-16le (default output from PowerShell 5.1) |
333 bigendianunicode - UTF-16 | 351 bigendianunicode - UTF-16 |
334 utf8 - UTF-8 | 352 utf8 - UTF-8 |
335 utf7 - UTF-7 (no-BOM) | 353 utf7 - UTF-7 (no BOM) |
336 utf32 - UTF-32 | 354 utf32 - UTF-32 |
337 ascii - 7-bit ASCII character set | 355 ascii - 7-bit ASCII character set |
338 default - System's active code page (typically ANSI) | 356 default - System's active code page (typically ANSI) |
339 oem - System's current OEM code page | 357 oem - System's current OEM code page |
340 | 358 |
341 Note Multi-byte Unicode encodings include a leading BOM. | 359 Note The abovce multi-byte Unicode encodings include a leading BOM unless |
360 otherwise indicated. | |
361 | |
362 By default PowerShell Core's output is UTF-8 encoded without a BOM. If you | |
363 want to force the output of PowerShell Core into a different encoding then set | |
364 'shellredir' and 'shellpipe' to "2>&1 | Out-File -Encoding encoding" where | |
365 encoding is one of the following: | |
366 | |
367 ascii - 7-bit ASCII character set | |
368 bigendianunicode - UTF-16be | |
369 bigendianutf32 - UTF-32be | |
370 oem - System's current OEM code page | |
371 unicode - UTF-16le | |
372 utf7 - UTF-7 | |
373 utf8 - UTF-8 | |
374 utf8BOM - UTF-8, with BOM | |
375 utf8NoBOM - UTF-8, no BOM (default output from PowerShell Core) | |
376 utf32 - UTF-32 | |
377 | |
378 Since PowerShell Core 6.2, the Encoding parameter also supports specifying a | |
379 numeric ID of a registered code page (-Encoding 1251) or string names of | |
380 registered code pages (-Encoding "windows-1251"). The .NET documentation for | |
381 Encoding.CodePage has more information | |
342 | 382 |
343 vim:tw=78:ts=8:noet:ft=help:norl: | 383 vim:tw=78:ts=8:noet:ft=help:norl: |