wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.32k stars 136 forks source link

feat: allow overriding default $SHELL /bin/bash #260

Closed Congee closed 1 year ago

Congee commented 1 year ago

Some systems do not have /bin/bash. e.g., Alpine and NixOS. This change allows the user to provide one's own path of bash to fzf. It solves the error fork/exec /bin/bash.

Note that fzf --preview 'xxxx' essentially executes $SHELL -c 'xxxx', so I tested on bash, zsh, and fish forgit::blame and it worked.

Check list

Description

Type of change

Test environment

carlfriedrich commented 1 year ago

@Congee Thanks for your submission. I wasn't aware that bash could be available in different places. We cannot use your proposed solution, though, because we have to enforce usage of bash as a shell for the preview commands. Otherwise users that have set their SHELL to something different (e.g. fish) will have non-working preview in fzf.

How about this:

SHELL=$(which bash)

Would that work for you?

Congee commented 1 year ago

@carlfriedrich yo, I have updated this PR and the commit message as you suggested :grin: