diff options
| author | Yang Tian <ytian.gt@gmail.com> | 2022-08-06 18:28:45 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-07 10:28:45 +0900 |
| commit | d826f9e72f4849c43525d7196ecc7adfe3a50a9d (patch) | |
| tree | 500e7e6c0ec9969b60891c9dd2443a61d9db4e1c | |
| parent | 6a6130615d600a1dd23bbb6916e386520eaeb6b2 (diff) | |
| download | fzf-d826f9e72f4849c43525d7196ecc7adfe3a50a9d.tar.gz | |
[fzf-tmux] Use fzf border instead of tmux popup border (#2908)
Co-authored-by: Yang Tian <yang.tian@getcruise.com>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
| -rw-r--r-- | CHANGELOG.md | 7 | ||||
| -rwxr-xr-x | bin/fzf-tmux | 9 |
2 files changed, 15 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index a3ea8abd..5411bd59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ CHANGELOG 0.32.1 ------ - Fixed incorrect ordering of `--tiebreak=chunk` +- fzf-tmux will show fzf border instead of tmux popup border (requires tmux 3.3) + ```sh + fzf-tmux -p70% + fzf-tmux -p70% --color=border:bright-red + fzf-tmux -p100%,60% --color=border:bright-yellow --border=horizontal + fzf-tmux -p70%,100% --color=border:bright-green --border=vertical + ``` 0.32.0 ------ diff --git a/bin/fzf-tmux b/bin/fzf-tmux index 92c3f66d..ff1df5ef 100755 --- a/bin/fzf-tmux +++ b/bin/fzf-tmux @@ -181,7 +181,14 @@ trap 'cleanup 1' SIGUSR1 trap 'cleanup' EXIT envs="export TERM=$TERM " -[[ "$opt" =~ "-E" ]] && FZF_DEFAULT_OPTS="--margin 0,1 $FZF_DEFAULT_OPTS" +if [[ "$opt" =~ "-E" ]]; then + FZF_DEFAULT_OPTS="--margin 0,1 $FZF_DEFAULT_OPTS" + tmux_verson=$(tmux -V) + if [[ ! $tmux_verson =~ 3\.2 ]]; then + FZF_DEFAULT_OPTS="--border $FZF_DEFAULT_OPTS" + opt="-B $opt" + fi +fi [[ -n "$FZF_DEFAULT_OPTS" ]] && envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")" [[ -n "$FZF_DEFAULT_COMMAND" ]] && envs="$envs FZF_DEFAULT_COMMAND=$(printf %q "$FZF_DEFAULT_COMMAND")" echo "$envs;" > "$argsf" |
