akinsho / toggleterm.nvim

A neovim lua plugin to help easily manage multiple terminal windows
GNU General Public License v3.0
4.39k stars 176 forks source link

Can't change default shell to powershell or pwsh #90

Closed maxxnino closed 3 years ago

maxxnino commented 3 years ago

empty

flash

akinsho commented 3 years ago

Hi @maxxnino, so I don't use windows and don't really have any experience with it or it's various shells so can't really help that much. I had a report of a similar issue and it turned out to be unrelated https://github.com/akinsho/toggleterm.nvim/issues/65. You can ask the other user how he resolved it. Can I ask if you set your shell to bash or something does that work?

maxxnino commented 3 years ago

@akinsho I set $SHELL to cmd and it's working. I just want to try something new like pwsh and it's stop working. The image below is a working shell

image

akinsho commented 3 years ago

@maxxnino I'm sorry I don't think I understand, you mean that specifically powershell doesn't work but cmd and other things do work? In which I genuinely have no idea I have zero experience with powershell other than knowing that it exists.

maxxnino commented 3 years ago

@akinsho in windows 10 there are two shell, The old one is cmd the newer one is powershell, both the sane as bash or zsh on linux

fedepujol commented 3 years ago

@maxxnino working just fine for me (Windows 10) but Im not in LunarVim and I don't have a $SHELL enviroment variable set. I've got an error when I tried to put somthing like pwsh.

There is a shell option in the pluggin that changes the shell to use, maybe change that to powershell? Don't know what the options are in LunarVim.

EdenEast commented 3 years ago

This is an issue with neovim. There is an issue with termopen() when vim.o.shell is set to powershell on windows. Refer to neovim issue #15634. I created a workaround in my config for this issue in this commit. This also requires that vim.o.shell is set to the default cmd.exe on windows.

maxxnino commented 3 years ago

@EdenEast thank you, it work, i use LunaVim

akinsho commented 3 years ago

Excellent, thanks for sharing @EdenEast 🙏🏿 . Gonna close this out then

dineshKumar777 commented 2 years ago

Adding this for reference, when configuring custom vim. Tested and working fine with nvim 0.7

-- lua config
-- https://stackoverflow.com/questions/36108950/setting-up-powershell-as-vims-shell-command-does-not-seem-to-be-passed-correct
vim.cmd([[
set shell=pwsh
set shellcmdflag=-command
set shellquote=\"
set shellxquote=
]])