voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.46k stars 79 forks source link

Setting shell is pwsh on windows does not work correctly #425

Closed jinzhongjia closed 5 months ago

jinzhongjia commented 5 months ago

Environment

platform: windows 11 version: neovim nightly v0.10.0-dev-2216+g2cd76a758

Similar issues

https://github.com/voldikss/vim-floaterm/issues/249

What happened?

I try to set shell is pwsh, vim-floaterm does not work correctly.

The display is blank, and after I press Enter, it looks like this: image GIF 2024-1-28 23-15-49

It seems that pwsh is waiting for something from stdin.

I didn't set anything else

And I found this: https://vi.stackexchange.com/questions/40235/an-unknown-element-was-received-sending-commands-to-powershell

It give me the way to solve it:

vim.o.shell = 'pwsh'
vim.o.shellxquote = ''
vim.o.shellcmdflag = '-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command '
vim.o.shellquote = ''
vim.o.shellpipe = '| Out-File -Encoding UTF8 %s'
vim.o.shellredir = '| Out-File -Encoding UTF8 %s'

Then it works well.

I didn't know what happen, command :terminal works well when only set shell.

jinzhongjia commented 5 months ago

I get it, this is not problem of plugin It should be pwsh's problem