diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/shell_command_selectors.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua index 353b30f26..e90cb81c9 100644 --- a/lua/nvim-treesitter/shell_command_selectors.lua +++ b/lua/nvim-treesitter/shell_command_selectors.lua @@ -318,7 +318,11 @@ end ---@return string command function M.make_directory_change_for_command(dir, command) if fn.has "win32" == 1 then - return string.format("pushd %s & %s & popd", cmdpath(dir), command) + if vim.o.shell == "powershell" or vim.o.shell == "pwsh" then + return string.format("pushd %s ; %s ; popd", cmdpath(dir), command) + else + return string.format("pushd %s & %s & popd", cmdpath(dir), command) + end else return string.format("cd %s;\n %s", dir, command) end |
