From 8a71e091a81c5d46770a261f84f8d5674fe73e6e Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 4 Jan 2025 18:47:00 +0900 Subject: [PATCH] Fix '--tmux border-native' --- CHANGELOG.md | 6 +++++- src/options.go | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4904d217b1..481f3492882 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,11 @@ CHANGELOG - Actions - `change-input-label` - `transform-input-label` -- Added `--preview-border[=STYLE]` as short for `--preview-window=border-[STYLE]` +- Added `--preview-border[=STYLE]` as short for `--preview-window=border[-STYLE]` +- You can specify `border-native` to `--tmux` so that native tmux border is used instead of `--border`. This can be useful if you start a different program from inside the popup. + ```sh + fzf --tmux border-native --bind 'enter:execute:less {}' + ``` - Added `toggle-multi-line` action - Added `toggle-hscroll` action diff --git a/src/options.go b/src/options.go index a3096d1131b..b21396a50bb 100644 --- a/src/options.go +++ b/src/options.go @@ -331,7 +331,12 @@ func parseTmuxOptions(arg string, index int) (*tmuxOptions, error) { } // Defaults to 'center' - switch tokens[0] { + first := "center" + if len(tokens) > 0 { + first = tokens[0] + } + + switch first { case "top", "up": opts.position = posUp opts.width = sizeSpec{100, true}