Loki Kriasus
Loki Kriasus

Reputation: 1301

Setting up Powershell as Vim's shell: command does not seem to be passed correctly

I am trying to set up Powershell as shell in GVIM on Windows.

When I do :!ls, I get a vimrun.exe window with the command I am running, which seems to be doing nothing. It stays like that until I close it.

vimrun.exe output


My .vimrc configuration:

set shell=powershell
set shellcmdflag=-command
set shellquote=\"
set shellxquote=

Nothing interferes with it: when I do :verbose set shell? shellcmdflag? shellquote? shellxquote? I get the values set above.

When I remove vimrun.exe from %PATH%, I get a Powershell window, which is just empty (no output in it) with same behavior.

The command itself is fine - when I execute it manually from cmd, it works as expected.

When Vim shell is set to cmd, everything works as expected as well.

There are questions that may seem related, but are not same:

Upvotes: 7

Views: 8106

Answers (1)

Loki Kriasus
Loki Kriasus

Reputation: 1301

Turns out the issue was in 32-bit powershell not working correctly on my system (yet to figure out why). I changed set shell=powershell to:

set shell=C:\\WINDOWS\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe

That launches 64-bit powershell, which works fine on my system.

Upvotes: 4

Related Questions