mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-11-14 13:03:49 +00:00
bugfix: use pwsh by explicite file extension
This commit is contained in:
parent
bb27e773c5
commit
7404b85ee4
@ -17,7 +17,7 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { 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' }, '<leader>to', '<cmd>term' .. cond_str .. '<cr>', { desc = '[T]erminal [O]pen' })
|
||||
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user