Skip to content

Releases: junegunn/fzf

0.70.0

02 Mar 08:02
v0.70.0
eacef5e

Choose a tag to compare

Demo: change-with-nth

change-with-nth.mp4

Summary

  • Added change-with-nth action for dynamically changing the --with-nth option.
    • Requires --with-nth to be set initially.
    • Multiple options separated by | can be given to cycle through.
    echo -e "a b c\nd e f\ng h i" | fzf --with-nth .. \
      --bind 'space:change-with-nth(1|2|3|1,3|2,3|)'
  • Added change-header-lines action for dynamically changing the --header-lines option
  • Performance improvements (1.3x to 1.9x faster filtering depending on query)
    === query: 'l' ===
      [all]   baseline:   168.87ms  current:    95.21ms  (1.77x)  matches: 5069891 (94.78%)
      [1T]    baseline:  1652.22ms  current:   841.40ms  (1.96x)  matches: 5069891 (94.78%)
    
    === query: 'lin' ===
      [all]   baseline:   343.27ms  current:   252.59ms  (1.36x)  matches: 3516507 (65.74%)
      [1T]    baseline:  3199.89ms  current:  2230.64ms  (1.43x)  matches: 3516507 (65.74%)
    
    === query: 'linux' ===
      [all]   baseline:    85.47ms  current:    63.72ms  (1.34x)  matches: 307229 (5.74%)
      [1T]    baseline:   774.64ms  current:   589.32ms  (1.31x)  matches: 307229 (5.74%)
    
    === query: 'linuxlinux' ===
      [all]   baseline:    55.13ms  current:    35.67ms  (1.55x)  matches: 12230 (0.23%)
      [1T]    baseline:   461.99ms  current:   332.38ms  (1.39x)  matches: 12230 (0.23%)
    
    === query: 'linuxlinuxlinux' ===
      [all]   baseline:    51.77ms  current:    32.53ms  (1.59x)  matches: 865 (0.02%)
      [1T]    baseline:   409.99ms  current:   296.33ms  (1.38x)  matches: 865 (0.02%)
    
  • Fixed nth attribute merge order to respect precedence hierarchy (#4697)
  • bash: Replaced printf with builtin printf to bypass local indirections (#4684) (@DarrenBishop)

0.68.0

20 Feb 02:06
v0.68.0
b908f7a

Choose a tag to compare

preview-wrap-word.mp4
  • Implemented word wrapping in the list section
    • Added --wrap=word (or --wrap-word) option and toggle-wrap-word action for word-level line wrapping in the list section
    • Changed default binding of ctrl-/ and alt-/ from toggle-wrap to toggle-wrap-word
    fzf --wrap=word
  • Implemented word wrapping in the preview window
    • Added wrap-word flag for --preview-window to enable word-level wrapping
    • Added toggle-preview-wrap-word action
    fzf --preview 'bat --style=plain --color=always {}' \
        --preview-window wrap-word \
        --bind space:toggle-preview-wrap-word
  • Added support for underline style variants in --color: underline-double, underline-curly, underline-dotted, underline-dashed
    fzf --color 'fg:underline-curly,current-fg:underline-dashed'
  • Added support for underline styles (4:N) and underline colors (SGR 58/59)
    # In the list section
    printf '\e[4:3;58;2;255;0;0mRed curly underline\e[0m\n' | fzf --ansi
    
    # In the preview window
    fzf --preview "printf '\e[4:3;58;2;255;0;0mRed curly underline\e[0m\n'"
  • Added --preview-wrap-sign to set a different wrap indicator for the preview window
  • Added alt-gutter color option (#4602) (@hedgieinsocks)
  • Added $FZF_WRAP environment variable to child processes (char or word when wrapping is enabled) (#4672) (@bitraid)
  • fish: Improved command history (CTRL-R) (#4672) (@bitraid)
    • Enabled syntax highlighting in the list on fish 4.3.3+
    • Added syntax-highlighted preview window that auto-shows for long or multi-line commands
    • Added ALT-ENTER to reformat and insert selected commands
    • Improved handling of bulk deletion of selected history entries (SHIFT-DELETE)
  • Added fish completion support (#4605) (@lalvarezt)
  • zsh: Handle multi-line history selection (#4595) (@LangLangBart)
  • Bug fixes
    • Fixed _fzf_compgen_{path,dir} to respect FZF_COMPLETION_{PATH,DIR}_OPTS (#4592) (@shtse8, @LangLangBart)
    • Fixed --preview-window follow not working correctly with wrapping (#3243, #4258)
    • Fixed symlinks to directories being returned as files (#4676) (@skk64)
    • Fixed SIGHUP signal handling (#4668) (@LangLangBart)
    • Fixed preview process not killed on exit (#4667)
    • Fixed coloring of items with zero-width characters (#4620)
    • Fixed track-current unset after a combined movement action (#4649)
    • Fixed --accept-nth being ignored in filter mode (#4636) (@charemma)
    • Fixed display width calculation with maxWidth (#4596) (@LangLangBart)
    • Fixed clearing of the rest of the current line on start (#4652)
    • Fixed x-api-key header not required for GET requests (#4627)
    • Fixed key reading not cancelled when execute triggered via a server request (#4653)
    • Fixed rebind of readline command redraw-current-line (#4635) (@jameslazo)
    • Fixed fzf-tmux TERM quoting and added mktemp usage (#4664) (@Goofygiraffe06)
    • Do not allow very long queries in FuzzyMatchV2 (#4608)

0.67.0

16 Nov 11:04
v0.67.0
2ab923f

Choose a tag to compare

image
  • Added --freeze-left=N option to keep the leftmost N columns always visible.
    # Keep the file name column fixed and always visible
    git grep --line-number --color=always -- '' |
        fzf --ansi --delimiter : --freeze-left 1
    
    # Can be used with --keep-right
    git grep --line-number --color=always -- '' |
        fzf --ansi --delimiter : --freeze-left 1 --keep-right
  • Also added --freeze-right=N option to keep the rightmost N columns always visible.
    # Stronger version of --keep-right that always keeps the right-end visible
    fd | fzf --freeze-right 1
    
    # Keep the base name always visible
    fd | fzf --freeze-right 1 --delimiter /
    
    # Keep both leftmost and rightmost components visible
    fd | fzf --freeze-left 1 --freeze-right 1 --delimiter /
  • Updated --info=inline to print the spinner (load indicator).
  • Bug fixes

0.66.1

26 Oct 06:13
v0.66.1
c1b259c

Choose a tag to compare

  • Bug fixes
    • Fixed a bug preventing 'ctrl-h' from being bound to an action (#4556)
    • Fixed --no-color / NO_COLOR theme (#4561)

0.66.0

12 Oct 13:24
v0.66.0
8cdfb23

Choose a tag to compare

Quick summary

This version introduces many new features centered around the new "raw" mode.

Type Class Name Description
New Option --raw Enable raw mode by default
New Option --gutter CHAR Set the gutter column character
New Option --gutter-raw CHAR Set the gutter column character in raw mode
Enhancement Option --listen SOCKET Added support for Unix domain sockets
New Action toggle-raw Toggle raw mode
New Action enable-raw Enable raw mode
New Action disable-raw Disable raw mode
New Action up-match Move up to the matching item
New Action down-match Move down to the matching item
New Action best Move to the matching item with the best score
New Color Name nomatch Color for non-matching items in raw mode
New Color Attr strip Remove original colors
New Env Var FZF_RAW Matching status in raw mode (0, 1, or undefined)
New Env Var FZF_DIRECTION up or down depending on the layout
New Env Var FZF_SOCK Path to the Unix domain socket fzf is listening on
Enhancement Key CTRL-N down -> down-match
Enhancement Key CTRL-P up -> up-match
Enhancement Shell CTRL-R binding Toggle raw mode with ALT-R
Enhancement Shell CTRL-R binding Opt-out with an empty FZF_CTRL_R_COMMAND

1. Introducing "raw" mode

This version introduces a new "raw" mode (named so because it shows the list "unfiltered"). In raw mode, non-matching items stay in their original positions, but appear dimmed. This allows you to see the surrounding items of a match and better understand the context of it. You can enable raw mode by default with --raw, but it's often more useful when toggled dynamically with the toggle-raw action.

tree | fzf --reverse --bind alt-r:toggle-raw

While non-matching items are displayed in a dimmed color, they are treated just like matching items, so you can place the cursor on them and perform any action. If you prefer to navigate only through matching items, use the down-match and up-match actions, which are from now on bound to CTRL-N and CTRL-P respectively, and also to ALT-DOWN and ALT-UP.

Key Action With --history
down down
up up
ctrl-j down
ctrl-k up
ctrl-n down-match next-history
ctrl-p up-match prev-history
alt-down down-match
alt-up up-match

Note

CTRL-N and CTRL-P are bound to next-history and prev-history when --history option is enabled, so in that case, you'll need to manually bind them, or use ALT-DOWN and ALT-UP instead.

Tip

up-match and down-match are equivalent to up and down when not in raw mode, so you can safely bind them to up and arrow keys if you prefer.

fzf --bind up:up-match,down:down-match

Customizing the behavior

In raw mode, the input list is presented in its original order, unfiltered, and your cursor will not move to the matching item automatically. Here are ways to customize the behavior.

# When the result list is updated, move the cursor to the item with the best score
# (assuming sorting is not disabled)
fzf --raw --bind result:best

# Move to the first matching item in the original list
# - $FZF_RAW is set to 0 when raw mode is enabled and the current item is a non-match
# - $FZF_DIRECTION is set to either 'up' or 'down' depending on the layout direction
fzf --raw --bind 'result:first+transform:[[ $FZF_RAW = 0 ]] && echo $FZF_DIRECTION-match'

Customizing the look

Gutter

To make the mode visually distinct, the gutter column is rendered in a dashed line using β–– character. But you can customize it with the --gutter-raw CHAR option.

# Use a thinner gutter instead of the default dashed line
fzf --bind alt-r:toggle-raw --gutter-raw β–Ž
Color and style of non-matching items

Non-matching items are displayed in a dimmed color by default, but you can change it with the --color nomatch:... option.

fzf --raw --color nomatch:red
fzf --raw --color nomatch:red:dim
fzf --raw --color nomatch:red:dim:strikethrough
fzf --raw --color nomatch:red:dim:strikethrough:italic

For colored input, dimming alone may not be enough, and you may prefer to remove colors entirely. For that case, a new special style attribute strip has been added.

fd --color always | fzf --ansi --raw --color nomatch:dim:strip:strikethrough

Conditional actions for raw mode

You may want to perform different actions depending on whether the current item is a match or not. For that, fzf now exports $FZF_RAW environment variable.

It's:

  • Undefined if raw mode is disabled
  • 1 if the current item is a match
  • 0 otherwise
# Do not allow selecting non-matching items
fzf --raw --bind 'enter:transform:[[ ${FZF_RAW-1} = 1 ]] && echo accept || echo bell'

Leveraging raw mode in shell integration

The CTRL-R binding (command history) now lets you toggle raw mode with ALT-R.

2. Style changes

The screenshot on the right shows the updated gutter style:

This version includes a few minor updates to fzf's classic visual style:

  • The gutter column is now narrower, rendered with the left-half block character (β–Œ).
  • Markers no longer use background colors.
  • The --color base16 theme (alias: 16) has been updated for better compatibility with both dark and light themes.

3. --listen now supports Unix domain sockets

If an argument to --listen ends with .sock, fzf will listen on a Unix domain socket at the specified path.

fzf --listen /tmp/fzf.sock --no-tmux

# GET
curl --unix-socket /tmp/fzf.sock http

# POST
curl --unix-socket /tmp/fzf.sock http -d up

Note that any existing file at the given path will be removed before creating the socket, so avoid using an important file path.

4. Added options

--gutter CHAR

The gutter column can now be customized using --gutter CHAR and styled with --color gutter:.... Examples:

# Right-aligned gutter
fzf --gutter '▐'

# Even thinner gutter
fzf --gutter 'β–Ž'

# Yellow checker pattern
fzf --gutter 'β–š' --color gutter:yellow

# Classic style
fzf --gutter ' ' --color gutter:reverse

--gutter-raw CHAR

As noted above, the --gutter-raw CHAR option was also added for customizing the gutter column in raw mode.

5. Added actions

The following actions were introduced to support working with raw mode:

Action Description
toggle-raw Toggle raw mode
enable-raw Enable raw mode
disable-raw Disable raw mode
up-match Move up to the matching item; identical to up if raw mode is disabled
down-match Move down to the matching item; identical to down if raw mode is disabled
best Move to the matching item with the best score; identical to first if raw mode is disabled

6. Added environment variables

$FZF_DIRECTION

$FZF_DIRECTION is now exported to child processes, indicating the list direction of the current layout:

  • up for the default layout
  • down for reverse or reverse-list

This simplifies writing transform actions involving layout-dependent actions like {up,down}-match, {up,down}-selected, and toggle+{up,down}.

fzf --raw --bind 'result:first+transform:[[ $FZF_RAW = 0 ]] && echo $FZF_DIRECTION-match'

$FZF_SOCK

When fzf is listening on a Unix domain socket using --listen, the path to the socket is exported as $FZF_SOCK, analogous to $FZF_PORT for TCP sockets.

$FZF_RAW

As described above, $FZF_RAW is now exported to child processes in raw mode, indicating whether the current item is a match (1) or not (0). It is not defined when not in raw mode.

$FZF_CTRL_R_COMMAND

You can opt-out CTRL-R binding from the shell integration by setting FZF_CTRL_R_COMMAND to an empty string. Setting it to any other value is not supported and will result in a warning.

# Disable ...
Read more

0.65.2

31 Aug 13:25
v0.65.2
416aff8

Choose a tag to compare

  • Bug fixes and improvements
    • Fix incorrect truncation of --info-command with --info=inline-right (#4479)
    • [install] Support old uname in macOS (#4492)
    • [bash 3] Fix CTRL-T and ALT-C to preserve the last yank (#4496)
    • Do not unset FZF_DEFAULT_* variables when using winpty (#4497) (#4400)
    • Fix rendering of items with tabs when using a non-default ellipsis (#4505)
  • This is the final release to support Windows 7.
    • Future versions will be built with the latest Go toolchain, which has dropped support for Windows 7.
    • Bug fixes will be backported to go-1.20 branch. You can build your own binary from it.

0.65.1

03 Aug 05:51
v0.65.1
e5cd7f0

Choose a tag to compare

  • Fixed incorrect $FZF_CLICK_HEADER_WORD and $FZF_CLICK_FOOTER_WORD when the header or footer contains ANSI escape sequences and tab characters.
  • Fixed a bug where you cannot unset the default --nth using change-nth action.
  • Fixed a highlighting bug when using --color fg:dim,nth:regular pattern over ANSI-colored items.

0.65.0

27 Jul 01:43
v0.65.0
04c4269

Choose a tag to compare

  • Added click-footer event that is triggered when the footer section is clicked. When the event is triggered, the following environment variables are set:
    • $FZF_CLICK_FOOTER_COLUMN - clicked column (1-based)
    • $FZF_CLICK_FOOTER_LINE - clicked line (1-based)
    • $FZF_CLICK_FOOTER_WORD - the word under the cursor
    fzf --footer $'[Edit] [View]\n[Copy to clipboard]' \
        --with-shell 'bash -c' \
        --bind 'click-footer:transform:
          [[ $FZF_CLICK_FOOTER_WORD =~ Edit ]] && echo "execute:vim \{}"
          [[ $FZF_CLICK_FOOTER_WORD =~ View ]] && echo "execute:view \{}"
          (( FZF_CLICK_FOOTER_LINE == 2 )) && (( FZF_CLICK_FOOTER_COLUMN < 20 )) &&
              echo "execute-silent(echo -n \{} | pbcopy)+bell"
        '
  • Added trigger(...) action that triggers events bound to another key or event.
    # You can click on each key name to trigger the actions bound to that key
    fzf --footer 'Ctrl-E: Edit / Ctrl-V: View / Ctrl-Y: Copy to clipboard' \
        --with-shell 'bash -c' \
        --bind 'ctrl-e:execute:vim {}' \
        --bind 'ctrl-v:execute:view {}' \
        --bind 'ctrl-y:execute-silent(echo -n {} | pbcopy)+bell' \
        --bind 'click-footer:transform:
          [[ $FZF_CLICK_FOOTER_WORD =~ Ctrl ]] && echo "trigger(${FZF_CLICK_FOOTER_WORD%:})"
        '
    • You can specify a series of keys and events
      fzf --bind 'a:up,b:trigger(a,a,a)'
  • Added support for {*n} and {*nf} placeholder.
    • {*n} evaluates to the zero-based ordinal index of all matched items.
    • {*nf} evaluates to the temporary file containing that.
  • Bug fixes and improvements
    • [neovim] Fixed margin background color when &winborder is used (#4453)
    • Fixed rendering error when hiding a preview window without border (#4465)
    • fix(shell): check for mawk existence before version check (#4468)
    • Fixed --no-header-lines-border behavior (08027e7)

0.64.0

06 Jul 15:05
v0.64.0
0076ec2

Choose a tag to compare

  • Added multi event that is triggered when the multi-selection has changed.
    fzf --multi \
        --bind 'ctrl-a:select-all,ctrl-d:deselect-all' \
        --bind 'multi:transform-footer:(( FZF_SELECT_COUNT )) && echo "Selected $FZF_SELECT_COUNT item(s)"'
  • Halfwidth and fullwidth alphanumeric and punctuation characters are now internally normalized to their ASCII equivalents to allow matching with ASCII queries.
    echo οΌ‘οΌ’οΌ£| fzf -q abc
  • Renamed clear-selection action to clear-multi for consistency.
    • clear-selection remains supported as an alias for backward compatibility.
  • Bug fixes
    • Fixed a bug that could cause fzf to abort due to incorrect update ordering.
    • Fixed a bug where some multi-selections were lost when using exclude or change-nth.

0.63.0

27 Jun 16:12
v0.63.0
397fe8e

Choose a tag to compare

Release highlights: https://junegunn.github.io/fzf/releases/0.63.0/

image

  • Added footer. The default border style for footer is line, which draws a single separator line.
    fzf --reverse --footer "fzf: friend zone forever"
    • Options
      • --footer[=STRING]
      • --footer-border[=STYLE]
      • --footer-label=LABEL
      • --footer-label-pos=COL[:bottom]
    • Colors
      • footer
      • footer-bg
      • footer-border
      • footer-label
    • Actions
      • change-footer
      • transform-footer
      • bg-transform-footer
      • change-footer-label
      • transform-footer-label
      • bg-transform-footer-label
  • line border style is now allowed for all types of border except for --list-border.
    fzf --height 50% --style full:line --preview 'cat {}' \
        --bind 'focus:bg-transform-header(file {})+bg-transform-footer(wc {})'
  • Added {*} placeholder flag that evaluates to all matched items.
    seq 10000 | fzf --preview "awk '{sum += \$1} END {print sum}' {*f}"
    • Use this with caution, as it can make fzf sluggish for large lists.
  • Added asynchronous transform actions with bg- prefix that run asynchronously in the background, along with bg-cancel action to cancel currently running bg-transform actions.
    # Implement popup that disappears after 1 second
    #   * Use footer as the popup
    #   * Use `bell` to ring the terminal bell
    #   * Use `bg-transform-footer` to clear the footer after 1 second
    #   * Use `bg-cancel` to cancel currently running background transform actions
    fzf --multi --list-border \
        --bind 'enter:execute-silent(echo -n {+} | pbcopy)+bell' \
        --bind 'enter:+transform-footer(echo Copied {} to clipboard)' \
        --bind 'enter:+bg-cancel+bg-transform-footer(sleep 1)'
    
    # It's okay for the commands to take a little while because they run in the background
    GETTER='curl -s http://metaphorpsum.com/sentences/1'
    fzf --style full --border --preview : \
        --bind "focus:bg-transform-header:$GETTER" \
        --bind "focus:+bg-transform-footer:$GETTER" \
        --bind "focus:+bg-transform-border-label:$GETTER" \
        --bind "focus:+bg-transform-preview-label:$GETTER" \
        --bind "focus:+bg-transform-input-label:$GETTER" \
        --bind "focus:+bg-transform-list-label:$GETTER" \
        --bind "focus:+bg-transform-header-label:$GETTER" \
        --bind "focus:+bg-transform-footer-label:$GETTER" \
        --bind "focus:+bg-transform-ghost:$GETTER" \
        --bind "focus:+bg-transform-prompt:$GETTER"
  • Added support for full-line background color in the list section
    for i in $(seq 16 255); do
      echo -e "\x1b[48;5;${i}m\x1b[0Khello"
    done | fzf --ansi
  • SSH completion enhancements by @akinomyoga
  • Bug fixes and improvements