Skip to content

FZF_CTRL_T_OPTS evaluates IF statement with system default shell #4108

Answered by LangLangBart
lukejanicke asked this question in Q&A
Discussion options

You must be logged in to vote

I have found that FZF evaluates IF statements with the system default shell and not the current shell, if it is different.

Note

fzf runs the command with $SHELL -c if SHELL is set, otherwise with sh -c

Try assigning SHELL in your zsh or fish config file to see if it works for you.

fzf --bind 'start:become:echo zsh $ZSH_VERSION fish $FISH_VERSION bash $BASH_VERSION'
# zsh 5.9 fish bash

SHELL=$(which fish)

fzf --bind 'start:become:echo zsh $ZSH_VERSION fish $FISH_VERSION bash $BASH_VERSION'
# zsh fish 3.7.1 bash

Alternatively, you can pass the --with-shell=STR1 flag to fzf.

fzf --with-shell="$(which zsh) -c" \
  --bind 'start:become:echo zsh $ZSH_VERSION fish $FISH_VERSION bash $BASH_V…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lukejanicke
Comment options

Answer selected by lukejanicke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants