Skip to content
Myr

Allow specifying fzf options in $FZF_TMUX_OPTS without '--'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 779d8e1 · Browse files · 3 files+8 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+8 added−6 removed

  • other:+8 added−6 removed

3 files+8 added−6 removed

modified:bin/fzf-tmux+2 added-5 removed
8 unmodified lines
910fzf="$(command -v fzf 2> /dev/null)" || fzf="$(dirname "$0")/fzf"11[[ -x "$fzf" ]] || fail 'fzf executable not found'1213tmux_args=()13args=()14opt=""15skip=""16swap=""
100 unmodified lines
117 --)118 # "--" can be used to separate fzf-tmux options from fzf options to119 # avoid conflicts120 skip=1122 tmux_args=("${args[@]}")123 args=()121 continue122 ;;123 *)124 args+=("$arg")
83 unmodified lines
208 cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; out=\$? $close; exit \$out" >> $argsf209 cat <&0 > $fifo1 &210 fi211215 tmux popup -d "$PWD" "${tmux_args[@]}" $opt "bash $argsf" > /dev/null 2>&1212 tmux popup -d "$PWD" $opt "bash $argsf" > /dev/null 2>&1213 exit $?214fi215216mkfifo -m o+w $fifo3
5 unmodified lines
222 cat <&0 > $fifo1 &223fi224tmux set-window-option synchronize-panes off \;\225 set-window-option remain-on-exit off \;\229 split-window -c "$PWD" $opt "${tmux_args[@]}" "bash -c 'exec -a fzf bash $argsf'" $swap \226 split-window -c "$PWD" $opt "bash -c 'exec -a fzf bash $argsf'" $swap \227 > /dev/null 2>&1 || { "$fzf" "${args[@]}"; exit $?; }228cat $fifo2229exit "$(cat $fifo3)"
modified:src/options.go+2 added
1542 unmodified lines
1543 case "--no-clear":1544 opts.ClearOnExit = false1545 case "--version":1546 opts.Version = true1547 case "--":1548 // Ignored1549 default:1550 if match, value := optString(arg, "--algo="); match {1551 opts.FuzzyAlgo = parseAlgo(value)1552 } else if match, value := optString(arg, "-q", "--query="); match {
233 unmodified lines
modified:CHANGELOG.md+4 added-1 removed
6 unmodified lines
7- fzf-tmux will show fzf border instead of tmux popup border (requires tmux 3.3)8 ```sh9 fzf-tmux -p70%10 fzf-tmux -p70% --color=border:bright-red11 fzf-tmux -p100%,60% --color=border:bright-yellow --border=horizontal11 fzf-tmux -p100%,60% --color=border:bright-yellow --border=horizontal --padding 1,5 --margin 1,012 fzf-tmux -p70%,100% --color=border:bright-green --border=vertical1314 # Key bindings (CTRL-T, CTRL-R, ALT-C) will use these options15 export FZF_TMUX_OPTS='-p100%,60% --color=border:green --border=horizontal --padding 1,5 --margin 1,0'16 ```17180.32.019------
1270 unmodified lines