Closed maxxnino closed 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?
@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
@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.
@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
@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.
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.
@EdenEast thank you, it work, i use LunaVim
$env:HOME = "$HOME"
$env:USER = "$HOME"
$env:SHELL = "cmd"
$env:TERMINAL = "$env:SHELL"
$env:VIMRUNTIME = "$(scoop prefix neovim-nightly)/share/nvim/runtime";
Set-Variable -name "LUNARVIM_RUNTIME_DIR" -Value "$HOME/.local/share/lunarvim"
Set-Variable -name "LUNARVIM_CONFIG_DIR" -Value "$HOME/.config/lvim"
nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" $args
lvim.builtin.terminal.shell = "pwsh -NoLogo"
Excellent, thanks for sharing @EdenEast 🙏🏿 . Gonna close this out then
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=
]])
cmd
is working fine. When i change the environment variable$SHELL
topwsh
orpowershell
. The toggle term open with empty window.