[fzf-tmux] Use awk if bc is not found

Fix #3235
This commit is contained in:
Junegunn Choi 2023-04-06 13:43:18 +09:00
parent 20230402d0
commit f1a9629652
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -180,7 +180,7 @@ trap 'cleanup' EXIT
envs="export TERM=$TERM "
if [[ "$opt" =~ "-E" ]]; then
tmux_version=$(tmux -V | sed 's/[^0-9.]//g')
if [[ $(bc -l <<< "$tmux_version > 3.2") = 1 ]]; then
if [[ $(bc -l <<< "$tmux_version > 3.2" 2> /dev/null || awk '{print ($1 > 3.2)}' <<< "$tmux_version") = 1 ]]; then
FZF_DEFAULT_OPTS="--border $FZF_DEFAULT_OPTS"
opt="-B $opt"
elif [[ $tmux_version = 3.2 ]]; then