summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_meta/options.lua
diff options
context:
space:
mode:
authorymich9963 <79522843+ymich9963@users.noreply.github.com>2025-12-10 05:57:16 +0000
committerGitHub <noreply@github.com>2025-12-10 00:57:16 -0500
commitd2e445e1bd321ea43b976d6aa7759d90b826ce62 (patch)
treefc191f7300055ae1c3ef4b0737841b7cd82834cd /runtime/lua/vim/_meta/options.lua
parentaeebc5185171d29767097d5b6240134bc19cee48 (diff)
docs(options): shell-powershell #36881
Problem: Current options for powershell and pwsh had mistakes and rationale behind them was not clear. Solution: Update the suggested options by splitting up powershell and pwsh, as well as ensuring that all options work and rationale is documented and discussed.
Diffstat (limited to 'runtime/lua/vim/_meta/options.lua')
-rw-r--r--runtime/lua/vim/_meta/options.lua23
1 files changed, 18 insertions, 5 deletions
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua
index 7befc642c5..afbc759b90 100644
--- a/runtime/lua/vim/_meta/options.lua
+++ b/runtime/lua/vim/_meta/options.lua
@@ -5840,12 +5840,25 @@ vim.go.sdf = vim.go.shadafile
--- To use PowerShell:
---
--- ```vim
---- let &shell = executable('pwsh') ? 'pwsh' : 'powershell'
---- let &shellcmdflag = '-NoLogo -NonInteractive -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues[''Out-File:Encoding'']=''utf8'';$PSStyle.OutputRendering=''plaintext'';Remove-Alias -Force -ErrorAction SilentlyContinue tee;'
---- let &shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode'
---- let &shellpipe = '2>&1 | %%{ "$_" } | tee %s; exit $LastExitCode'
---- set shellquote= shellxquote=
+--- set noshelltemp
+--- let &shell = 'powershell'
+--- let &shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command '
+--- let &shellcmdflag .= '[Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();'
+--- let &shellcmdflag .= '$PSDefaultParameterValues[''Out-File:Encoding'']=''utf8'';'
+--- let &shellpipe = '> %s 2>&1'
+--- set shellquote= shellxquote=
--- ```
+---
+--- *shell-pwsh*
+--- To use pwsh, use the above settings with `let &shell = 'pwsh'`, and
+--- add:
+---
+--- ```vim
+--- let &shellcmdflag .= '$PSStyle.OutputRendering = ''PlainText'';'
+--- " Workaround (may not be needed in future version of pwsh):
+--- let $__SuppressAnsiEscapeSequences = 1
+--- ```
+---
--- This option cannot be set from a `modeline` or in the `sandbox`, for
--- security reasons.
---