:term cannot change from bash to zsh


(!!! tell me if this should be moved to github issues. I am not sure myself)

I am trying to learn how to use the built in terminal emulator.
:term opens buffer with bash, and not my zsh from /usr/local/bin/zsh.
echo $SHELL gives /usr/local/bin/zsh.

What to do?? :smiley:

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
bash-3.2$ chsh -s /bin/zsh
Changing shell for user.
Password for user:
chsh: no changes made



nvim --version

╰ v --version
NVIM v0.5.0-dev+nightly-55-g691a72bb6
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210323-38439-6z66vz/build/config -I/tmp/neovim-20210323-38439-6z66vz/src -I/usr/local/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/usr/local/opt/gettext/include -I/tmp/neovim-20210323-38439-6z66vz/build/src/nvim/auto -I/tmp/neovim-20210323-38439-6z66vz/build/include
Compiled by hjalmarjakobsson@macbook2Triangle

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-691a72b_2/share/nvim"

You can set, e.g., set shell=fish in your init.vim.

(I’ll leave the answer to the inevitable follow-up question “but how do I do it… in Lua?!” as an exercise to the reader.)

yes i know this but it doesn’t work for me. i have tried =zsh, = /bin/zsh, and =/usr/local/bin/zsh but it still opens with bash and I cannot change it from within the term emulator it seems.

Then something is wrong with your config; it works for me on macOS (also with the default zsh, and fish installed via homebrew in /usr/local/bin). No messing about with chsh etc. required.

Can you try this with a minimal config?

Also, your neovim version is quite old (March 23), so you should upgrade to latest HEAD.

(FWIW, my neovim correctly inherits the shell from the calling terminal.)

hmm thanks for you taking your time to answer again.

I will try to follow your suggestions. I started using nightly on march 23 because I found a dotfiles repo that looked interesting but I am haven’t been using nvim for very long so it might give an imperssion that I am pro but actually I am noob. I’ll try the minimal config and then update because that makes me really nervous :stuck_out_tongue:

i can read on how to use another config in the starting neovim helpfiles right??

You should update first. (PSA: If you grab the nightly tiger by the tail, you have to constantly hold on. “Nightly” means “always the latest nightly”!)

To start with a different init.vim, use nvim -u init.vim (doesn’t have to be that name). This still loads your runtime files (.config/nvim/plugin etc.), though; to skip those as well, add --clean or noplugin. There’s also -u NONE to start with a clean slate (which is what you want here, I think, to see what shell you get then). This is explained quite well in :h startup (which is required reading in my eyes, anyway).

allright cool. then i will follow your suggestions.
I haven been trying to push through as many of the nvim docs as I can in the last few days. starting neovim will be the next one I read!! it didn’t make sense to me a couple of weeks ago but now I am starting to get. Nice.

1 Like

oooh!!! I have to ask you also if it is possible to see which nvim binary is used from within nvim???

Last comments, then I’ll leave you to your bingeing:

  1. Start your config from a clean slate and add stuff (plugins or options) one-by-one, making sure you understand what each does before moving on to the next.
  2. Avoid “distributions” or fancy dotfile repos except as sources of inspiration (“I wonder what this plugin does – let me check out its repo!”).
  3. Always take note of the date of blog posts or commits on repos – neovim has changed a lot, particularly over the last year, and anything older than three months should be assumed broken or no longer best practice.

(GitHub - nanotee/nvim-lua-guide: A guide to using Lua in Neovim is a good authoritative source for the Lua side, at least; as is, of course, the documentation neovim ships with.)

And you can see the path to the running neovim instance by :echo v:progpath.

1 Like

Awesome, thank you very much for you guidance! Now I have many things to dive into.

:echo v:progpath will tell you what binary you are using.

1 Like

yes it is amazing!! I have been procrastinating reading through the eval help file because I get uncomfortable every time I see it is over 11k lines but now’s the time.