Skip to content

--accept-nth does not work with -1 #4287

@gustavkrist

Description

@gustavkrist

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.60.2 (brew)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

When the -1 argument and -q is provided in combination with --accept-nth, all columns are output if there is only a single result.

When there are multiple results and one must be selected it outputs column 1 as expected:

$ echo "foo\t1\nbar\t2\nbaz\t3\nfoobar\t4" | fzf --accept-nth 1 -1 -q "bar"
# press enter to select an item
bar

When only one item matches the provided query, all columns are output:

$ echo "foo\t1\nbar\t2\nbaz\t3\nfoobar\t4" | fzf --accept-nth 1 -1 -q "baz"
baz     3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions