Open sandersantema opened 3 years ago
Thanks for the report! I admit, I had not anticipated this case. Do you think it would be reasonable to cache the correct shell identity as a module-local variable, rather then checking it in activate_hererocks_cmd
? That would sidestep the "can't use nvim_get_option
in a callback" issue, and I don't think the value of SHELL
should change while Neovim is running.
I may be totally wrong here, but I wonder if the shell-specific code is necessary. It looks like the activation scripts for hererocks only add stdpath('cache') .. '/packer_hererocks/2.1.0-beta3/bin'
to $PATH
. Wouldn't it be possible to run the luarocks executable in packer_hererocks/2.1.0-beta3/bin/
directly without running it in a shell? (You might even be able to avoid messing with shellescape()
)
That's a fair idea. I thought about this when adapting neorocks
to the packer
luarocks module, but opted to keep using the activation script in case luarocks
updates what that script does at some point in the future. Still, might be a cleaner solution.
I've setup my fish shell as an interactive only shell, which means
echo $SHELL
reports/bin/bash
in fish when on its own and/bin/sh
from tmux.fish
is launched automatically frombash
,bash
is accessed by usingbash --norc
. I can't remember exactly why I've done this but I believe settingfish
as the login shell had some nasty consequences on my OpenSUSE Tumbleweed system.All of this leads to
activate_hererocks_cmd
frompacker.luarocks
reporting the wrong shell, after whichhererocks
tries to use the wrongactivate
binary, namelyactivate
instead ofactivate.fish
. Such as can be seen in the following log message:One possible fix which I can think of is checking whether
vim.o.shell
is set and if so setting the shell to that value and if not setting it toos.getenv(SHELL)
, like this:I think this makes sense given that nvim would use the wrong shell too without having
vim.o.shell
set. Unfortunately this causes an error:As a workaround I can start
nvim
asenv SHELL=fish nvim
or I could permanently set$SHELL
tofish
in my environment which might have been the best idea all along eitherway but I suppose it still might be a nice idea to capture possible edge cases such as this.