gazorby / fifc

🐠 Configurable fzf completions for fish shell
MIT License
123 stars 7 forks source link

Preview shows error: /usr/bin/bash: line 1: _fifc_action: command not found #31

Closed Kukukuchu closed 3 months ago

Kukukuchu commented 1 year ago

Describe the bug Preview not working, only displays /usr/bin/bash: line 1: _fifc_action: command not found for any entry

To Reproduce Fresh install, no further config except setting editor env variable.

Expected behavior I expected bat to be used for preview for files, possibly no preview for stuff for which i don't have additional tools.

System (please complete the following information):

Additional context /usr/bin/bash is login shell running in WSL

gazorby commented 1 year ago

Hi @Kukukuchu

/usr/bin/bash is login shell

fifc is a fish plugin, so you need to have it installed and set as your default shell for the plugin to work

Kukukuchu commented 1 year ago

I don't think i want to set fish as login shell atm. I would like to continue using it as de facto default shell (e.g. I configured it as default in VSCode integrated terminal)

Setting local exported variable SHELL to /usr/bin/fish does seem to solve the problem. fzf.fish solves it by setting function scoped exported variable to fish shell before calling fzf in _fzf_wrapper: https://github.com/PatrickF1/fzf.fish/blob/main/functions/_fzf_wrapper.fish#L5

Would you consider adding something like that?

Adding that line (set --local --export SHELL (command --search fish)) to the _fifc function seems to work.

domglusk commented 7 months ago

I don't think i want to set fish as login shell atm. I would like to continue using it as de facto default shell (e.g. I configured it as default in VSCode integrated terminal)

Setting local exported variable SHELL to /usr/bin/fish does seem to solve the problem. fzf.fish solves it by setting function scoped exported variable to fish shell before calling fzf in _fzf_wrapper: https://github.com/PatrickF1/fzf.fish/blob/main/functions/_fzf_wrapper.fish#L5

Would you consider adding something like that?

Adding that line (set --local --export SHELL (command --search fish)) to the _fifc function seems to work.

Can confirm this works as a fix

phanen commented 4 months ago

Another workaround:

bind \t 'SHELL=fish _fifc'

or:

type -q _fifc
and functions -c _fifc _fifc_1
and function _fifc; SHELL=fish _fifc_1; end