From 7404b85ee40bde9bfd13162e369278f0785845e5 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 22 Oct 2024 16:40:16 +0200 Subject: [PATCH] bugfix: use pwsh by explicite file extension --- lua/keymaps.lua | 2 +- lua/options.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index d563a78..1864baf 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -17,7 +17,7 @@ vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' } -- Open terminal in current window local use_ps = vim.fn.has 'win32' == 1 or vim.fn.has 'wsl' == 1 -local shellname = vim.fn.executable 'pwsh' == 1 and 'pwsh' or 'powershell' +local shellname = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell' local cond_str = use_ps and (' ' .. shellname .. '.exe') or '' vim.keymap.set({ 'n', 'v' }, 'to', 'term' .. cond_str .. '', { desc = '[T]erminal [O]pen' }) diff --git a/lua/options.lua b/lua/options.lua index 7cbe9b6..aaaaec7 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -9,7 +9,7 @@ vim.cmd 'silent! language en_US' -- Shell options -- Sets the shell to use for system() and ! commands in windows if vim.fn.has 'win32' == 1 and vim.fn.has 'wsl' == 0 then - vim.opt.shell = vim.fn.executable 'pwsh' == 1 and 'pwsh' or 'powershell' + vim.opt.shell = vim.fn.executable 'pwsh.exe' == 1 and 'pwsh' or 'powershell' vim.opt.shellcmdflag = '-NoLogo -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;' vim.opt.shellredir = '-RedirectStandardOutput %s -NoNewWindow -Wait' vim.opt.shellpipe = '2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode'