Skip to content

Commit 19f9bbc

Browse files
committed
Allow specifying fzf options in $FZF_TMUX_OPTS without '--'
1 parent 779d8e1 commit 19f9bbc

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ CHANGELOG
88
```sh
99
fzf-tmux -p70%
1010
fzf-tmux -p70% --color=border:bright-red
11-
fzf-tmux -p100%,60% --color=border:bright-yellow --border=horizontal
11+
fzf-tmux -p100%,60% --color=border:bright-yellow --border=horizontal --padding 1,5 --margin 1,0
1212
fzf-tmux -p70%,100% --color=border:bright-green --border=vertical
13+
14+
# Key bindings (CTRL-T, CTRL-R, ALT-C) will use these options
15+
export FZF_TMUX_OPTS='-p100%,60% --color=border:green --border=horizontal --padding 1,5 --margin 1,0'
1316
```
1417

1518
0.32.0

bin/fzf-tmux

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ fail() {
1010
fzf="$(command -v fzf 2> /dev/null)" || fzf="$(dirname "$0")/fzf"
1111
[[ -x "$fzf" ]] || fail 'fzf executable not found'
1212

13-
tmux_args=()
1413
args=()
1514
opt=""
1615
skip=""
@@ -119,8 +118,6 @@ while [[ $# -gt 0 ]]; do
119118
# "--" can be used to separate fzf-tmux options from fzf options to
120119
# avoid conflicts
121120
skip=1
122-
tmux_args=("${args[@]}")
123-
args=()
124121
continue
125122
;;
126123
*)
@@ -212,7 +209,7 @@ if [[ "$opt" =~ "-E" ]]; then
212209
cat <&0 > $fifo1 &
213210
fi
214211
215-
tmux popup -d "$PWD" "${tmux_args[@]}" $opt "bash $argsf" > /dev/null 2>&1
212+
tmux popup -d "$PWD" $opt "bash $argsf" > /dev/null 2>&1
216213
exit $?
217214
fi
218215
@@ -226,7 +223,7 @@ else
226223
fi
227224
tmux set-window-option synchronize-panes off \;\
228225
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 \
230227
> /dev/null 2>&1 || { "$fzf" "${args[@]}"; exit $?; }
231228
cat $fifo2
232229
exit "$(cat $fifo3)"

src/options.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,6 +1544,8 @@ func parseOptions(opts *Options, allArgs []string) {
15441544
opts.ClearOnExit = false
15451545
case "--version":
15461546
opts.Version = true
1547+
case "--":
1548+
// Ignored
15471549
default:
15481550
if match, value := optString(arg, "--algo="); match {
15491551
opts.FuzzyAlgo = parseAlgo(value)

0 commit comments

Comments
 (0)