Commit Graph

3276 Commits

Author SHA1 Message Date
Junegunn Choi fcd0ba9b94 Fix inconsistent placement of header-lines with border options
fzf displayed --header-lines inconsistently depending on the presence of borders:

  # --header and --header-lines co-located
  seq 10 | fzf --header-lines 3 --header "$(seq 101 103)" --header-first

  # --header and --header-lines separated
  seq 10 | fzf --header-lines 3 --header "$(seq 101 103)" --header-first --header-lines-border

This commit fixes the inconsistency with the following logic:

* If only one of --header or --header-lines is provided, --header-first
  applies to that single header.
* If both are present, --header-first affects only the regular --header,
  not --header-lines.
2025-06-06 11:13:39 +09:00
Koichi Murase ec521e47aa [bash,zsh] Reduce the number of fork & exec
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-06-05 13:02:11 +09:00
Koichi Murase e3f4a51c18 [zsh] Set shell options for pathname expansion "~/.ssh/config.d/*"
This applies the same changes as commit 0a06fd6f for Bash (GitHub PR
2025-06-05 13:02:11 +09:00
Koichi Murase 0a06fd6f63 [bash] Set shell options for pathname expansion "~/.ssh/config.d/*" (#4405)
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-06-03 20:47:28 +09:00
Koichi Murase 70eace5290 Fix the CI failure for PR caused by a spelling mistake (#4406) 2025-06-03 19:41:47 +09:00
junegunn 40f9f254a9 Deploying to master from @ junegunn/fzf@15d6c17390 🚀
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-06-01 00:02:34 +00:00
Junegunn Choi 15d6c17390 Fix ANSI attributes lost when nth:regular is set
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
Example:
  # foo was not displayed in italic
  echo -e "\x1b[33;3mfoo \x1b[mbar" | fzf --ansi --color fg:dim,nth:regular --nth 1
2025-05-30 21:02:35 +09:00
Junegunn Choi a9d1d42436 Fix ANSI attributes lost when 'regular' attribute is set to fg or nth
Examples:

  echo -e "\x1b[33;3mfoo \x1b[mbar" | fzf --ansi --color fg:regular
  echo -e "\x1b[33;3mfoo \x1b[mbar" | fzf --ansi --color nth:regular
2025-05-30 20:43:20 +09:00
Junegunn Choi 1ecfa38eee [bash] Fix 'complete' errors when IFS is newline
Fix #4342
2025-05-30 20:41:50 +09:00
Junegunn Choi 54fd92b7dd --no-color: Keep ANSI attributes in the list
Example:
  echo -e "\x1b[33;3mfoo \x1b[34;4mbar\x1b[m baz" | fzf --ansi --no-color
2025-05-30 20:33:21 +09:00
Junegunn Choi 835906d392 --no-color: Keep ANSI attributes in preview window
Example:
  fzf --preview 'echo -e "\x1b[33;3mfoo \x1b[34;4mbar\x1b[m baz"' --no-color
2025-05-30 20:26:53 +09:00
Junegunn Choi 1721e6a1ed Do not apply 'nth' attributes to trailing whitespaces
# foo  bar
    # -----    <- previously underlined trailing whitespace
    # ---      <- with the fix, trailing whitespace is excluded
    fzf --color nth:underline --nth 1 <<< 'foo  bar'
2025-05-30 19:43:10 +09:00
Junegunn Choi c7ee3b833f Fix FZF_CLICK_HEADER_NTH for multi-line headers 2025-05-30 17:10:26 +09:00
Junegunn Choi ffb6e28ca7 Allow customizing --ghost color via '--color ghost'
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Examples:

  # Dimmed red
  fzf --ghost booya --color ghost:red

  # Regular red
  fzf --ghost booya --color ghost:red:regular

Close #4398
2025-05-28 00:27:33 +09:00
Junegunn Choi a4c6846851 Fix background color of 'disabled' query
fzf --color disabled:red,list-bg:blue --disabled --query foo --input-border
2025-05-28 00:17:41 +09:00
Junegunn Choi d18c0bf694 [man] Add GET endpoint example
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
2025-05-22 21:57:04 +09:00
Junegunn Choi 4e3f9854e6 Update README.md
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
2025-05-17 22:06:06 +09:00
Junegunn Choi b27943423e Show ellipsis for truncated labels
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Close #4390
2025-05-17 11:25:15 +09:00
Junegunn Choi 894a1016bc RuboCop lint 2025-05-17 11:20:29 +09:00
Junegunn Choi efe6cddd34 Update README
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-05-16 22:15:38 +09:00
Junegunn Choi f1c6bdf3e8 Update README 2025-05-16 22:15:06 +09:00
Junegunn Choi 710659bcf5 Update SECURITY.md
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-05-14 11:06:15 +09:00
Josef Andersson be67775da4 Add initial security policy (#4379)
Signed-off-by: Josef Andersson <janderssonse@proton.me>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-05-14 11:05:20 +09:00
jiz4oh 2c6381499c [neovim] Respect winborder of Neovim 0.11+ (#4389)
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-05-14 00:53:26 +09:00
junegunn 4df842e78c Deploying to master from @ junegunn/fzf@b81696fb64 🚀
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-05-11 00:02:09 +00:00
Ajeet D'Souza b81696fb64 bash: set keybinding right before printing special character (#4377)
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
2025-05-10 15:29:27 +09:00
Junegunn Choi d226d841a1 0.62.0
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
v0.62.0
2025-05-04 18:31:18 +09:00
Junegunn Choi c6d83047e5 Allow whitespace as separator in --color option 2025-05-04 15:08:23 +09:00
Junegunn Choi 46dabccdf1 [vim] Update g:fzf_colors example with 'query' 2025-05-04 14:52:22 +09:00
Junegunn Choi cd9517b679 Add 'alt-bg' color for striped lines (#4370)
Test cases:

1. 'jump' should show alternating background colors even when 'alt-bg' is
not defined as before.

  go run main.go --bind load:jump

Two differences:
  * The alternating lines will not be in bold (was a bug)
  * The marker column will not be rendered with alternating background color

2. Use alternating background color when 'alt-bg' is set

  go run main.go --color bg:238,alt-bg:237
  go run main.go --color bg:238,alt-bg:237 --highlight-line

3. 'selected-bg' should take precedence

  go run main.go --color bg:238,alt-bg:237,selected-bg:232 \
                 --highlight-line --multi --bind 'load:select+up+select+up'

4. Should work with text with ANSI colors

  declare -f | perl -0777 -pe 's/^}\n/}\0/gm' |
    bat --plain --language bash --color always |
    go run main.go --read0 --ansi --reverse --multi \
                   --color bg:237,alt-bg:238,current-bg:236 --highlight-line

---

Close #4354
Fix #4372
2025-05-04 14:32:06 +09:00
junegunn cd6677ba1d Deploying to master from @ junegunn/fzf@9c1a47acf7 🚀
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-05-04 00:02:25 +00:00
bitraid 9c1a47acf7 [fish] Support deleting history items with SHIFT-DEL
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
Bind to SHIFT-DELETE a command that deletes the selected history items.
It can be overridden by $FZF_CTRL_R_OPTS.
2025-04-28 00:27:51 +09:00
bitraid 0c280a3ce1 [fish] Simplify commandline call in fzf-file-widget 2025-04-28 00:27:51 +09:00
bitraid 53e8b6e705 [fish] Add version check 2025-04-28 00:27:51 +09:00
bitraid ad33165fa7 [fish] History: Operate only on line at cursor
This allows inserting history entries when constructing multiline
commands.
2025-04-28 00:27:51 +09:00
junegunn 2055db61c8 Deploying to master from @ junegunn/fzf@d2c662e54f 🚀
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-04-27 00:02:22 +00:00
Junegunn Choi d2c662e54f Reset coordinator delay on 'reload'
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
Fix #4364
2025-04-25 21:30:25 +09:00
Junegunn Choi d24b58ef3f 0.61.3
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
v0.61.3
2025-04-22 20:53:23 +09:00
RafaelDominiquini 06ae9b0f3b Add missing environment variables (#4356)
Co-authored-by: Rafael Baboni Dominiquini <rafaeldominiquini@gmail.com>
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-04-22 20:51:43 +09:00
Junegunn Choi 2a9c1c06a4 Revert "Disable tmux popup when already running inside one (#4351)"
This reverts commit af8fe918d8.

Fix #4360
Fix #4359
2025-04-22 20:20:21 +09:00
Junegunn Choi 90ad1b7f22 0.61.2
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
v0.61.2
2025-04-20 11:37:15 +09:00
Junegunn Choi f22fbcd1af Fix typo and update CHANGLOG 2025-04-20 11:31:15 +09:00
Junegunn Choi 1d761684c5 Add --tty-default=/dev/tty and --no-tty-default option (#4352)
Fix #4242.

Use --no-tty-default, if you want fzf to perform a TTY look-up instead of defaulting to /dev/tty.
2025-04-20 11:24:50 +09:00
bitraid e491770f1c [fish] Improve option prefix processing
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled
- Support single-letter options without = such as -fFILEPATH
- fish v3.3.0 and newer: Disable option prefix if -- is preceded
2025-04-18 21:06:25 +09:00
bitraid a41be61506 [fish] Fix whitespace/regex characters in command line
This is a rewrite of __fzf_parse_commandline function, that fixes the
following issues, when CTRL-T/ALT-C is used and current command line
token contains:
- Escaped newlines (\n): This never worked correctly, but after 282884a,
  the string would split, and the script would enter an infinite loop
  while trying to set $dir.
- Escaped bell (\a, \cg), backspace (\b), form feed (\v, \cl), carriage
  return (\r), vertical tab (\v, \ck): walker-root would not set
  correctly for existing directories containing any of those characters.
- Regular expression special characters (^, +, ? etc): $dir would not be
  be stripped from $fzf_query if it contained any of those characters.

The lowest supported fish version is v3.1b. For optimal operation, the
function uses more recent commands when supported by the running
version. Specifically, for versions equal or newer than:
- v3.2.0: Sets variables using PCRE2 capture groups of `string match
  --regex` when needing to preserve any trailing newlines and
  simultaneously omit the extra newline that is appended by `string
  collect -N`.
- v3.5.0: Uses the builtin path command for path normalization, dirname
  extraction and existing directories check.
- v4.0.0: Uses the --tokens-expanded option of commandline, for
  expansion and dealing with unbalanced quotes and incomplete escape
  sequences. It also uses the regex style of string-escape, to prepare
  variable contents for regex operations. This is not used in older
  versions, because they don't escape newlines.
2025-04-18 21:06:25 +09:00
bitraid 1a8f633611 [fish] Fix for file/dir names containing newlines
CTRL-T/ALT-C now works correctly when selecting files or directories
that contain newlines in their names. When external commands defined by
$FZF_CTRL_T_COMMAND/$FZF_ALT_C_COMMAND are used (for example the fd
command with -0 switch), the --read0 option must also be set through
$FZF_CTRL_T_OPTS/$FZF_ALT_C_OPTS.
2025-04-18 21:06:25 +09:00
Pierre Guinoiseau af8fe918d8 Disable tmux popup when already running inside one (#4351) 2025-04-18 17:35:48 +09:00
istepic 8ef9dfd9a2 Update reference to manpage in README.md (#4348)
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-04-18 08:38:28 +09:00
phanium 66df24040f Fix panic when use header border without pointer/marker (#4345)
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-04-13 20:24:29 +09:00
junegunn ed4442d9ea Deploying to master from @ junegunn/fzf@0edb5d5ebb 🚀
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2025-04-13 00:26:08 +00:00