Skip to content

feature request: track selection across reload-sync #3460

Closed

Description

@yorickvP
  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Problem / Steps to reproduce

I'm using a single selection, and I have a binding that sorts my input in various ways:

    --bind 'ctrl-s:execute-silent(track+reload-sync<'"$FZF_DEFAULT_COMMAND" | sort -hk3'>)' \

However, this loses the current selection and instead selects whatever line is at that position in the new ordering.
I would like fzf to track of the currently selected line when reload-sync completes and it's still in there. How could I achieve this?

Activity

  1. junegunn commented on Oct 8, 2023

    @junegunn
    Owner

    What's the exact use case?

  2. added a commit that references this issue on Mar 14, 2026
    b5f7221
  3. added a commit that references this issue on Mar 14, 2026
    9f42285
  4. junegunn commented on Mar 15, 2026

    @junegunn
    Owner

    In 0.71.0, with --id-nth, reload-sync will preserve the selections.

    # --id-nth .. means we compare the entire line to find the entry after a reload
    fzf --id-nth .. --multi --bind 'start,ctrl-r:reload-sync:sort -R /usr/share/dict/words'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions