zbirenbaum / nvterm

NvChad's Official Terminal Plugin ( Unmaintained but still usable and stable), wait for v3.0
GNU General Public License v3.0
181 stars 20 forks source link

[Request] Add option to change shell for nvterm #16

Closed FROST8ytes closed 2 years ago

FROST8ytes commented 2 years ago

It would be nice if we could set a default shell being used by nvterm in the config file. For example, my default shell is bash but I would like for nvterm to use fish automatically. Is this possible without using chsh to change the whole user's default shell? If not, how would I achieve similar result of using chsh on Windows?

zbirenbaum commented 2 years ago

technically this was already possible since the shell was read from vim.o.shell, but I exposed it in the config just now under terminals.shell

FROST8ytes commented 2 years ago

It seems like :set shell break nvterm but not NeoVim's default terminal.

https://user-images.githubusercontent.com/24704804/198827316-f49af38d-e2dd-4c1a-9a0a-f8031d49ba2a.mp4

zbirenbaum commented 2 years ago

This was because by default, nvterm reads the shell option from the config which is set to vim.o.shell during initialization unless otherwise specified. I removed the shell option from the config defaults, so that if it is undefined vim.o.shell will be respected at runtime, but if the user specifies a shell in their config it should default to that.

I also added an override flag to nvterm.new for the shell which has the highest priority.