From a507822c0f67df661d1411f9274a65ca9cc832f5 Mon Sep 17 00:00:00 2001 From: AK47are <54732151+AK47are@users.noreply.github.com> Date: Thu, 6 Nov 2025 19:40:40 +0800 Subject: [PATCH] fix(terminal): add -NoProfile to powershell shellcmdflag (#6757) ## Description changing the PowerShell profile might accidentally cause errors in Neovim (see [issue](https://github.com/LazyVim/LazyVim/issues/4805)), which is a subtle bug. Add the `-NoProfile` flag to ensure Neovim is not affected by profile. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/terminal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/terminal.lua b/lua/lazyvim/util/terminal.lua index 0e1af758..4270d9c0 100644 --- a/lua/lazyvim/util/terminal.lua +++ b/lua/lazyvim/util/terminal.lua @@ -18,7 +18,7 @@ function M.setup(shell) -- Setting shell command flags vim.o.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;" + "-NoProfile -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;" -- Setting shell redirection vim.o.shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode'