8

In neovim, when use the command :term, it opens a new shell with bash. I want to use zsh by default.

zsh is already my default shell. I changed it with chsh.

Dougui
  • 227
  • 1
  • 2
  • 5

1 Answers1

11

Looking at :h :terminal it says

Execute {cmd} with 'shell' in a new terminal buffer

So use :set shell=/path/to/zsh. Put it in your vimrc file (probably init.vim) to make it "permanent".

B Layer
  • 19,834
  • 2
  • 30
  • 57
  • I keep getting An unknown element "" was received.. Are there other settings that should go with this? – FilBot3 Jan 16 '20 at 19:07
  • What's emitting that? Vim? Zsh? I've never seen that message before. If you don't have any more information I suggest you swap out your vimrc for a bare bones version with not much more than the set shell=... line and see what happens. And running vim with -V will tell you what's going on during startup. – B Layer Jan 17 '20 at 06:37
  • I have been having this issue as well, and it's a couple of plugins that are emitting the message (vim-plug and ctrlp.vim so far). It seems to have something to do with using powershell. https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/resources/RemotingErrorIdStrings.resx#L782

    Removing the "set shell" directive from my vimrc stops them from occurring. Still haven't figured out what's going on.

    – RageCage Jan 18 '21 at 22:07