Skip to content

CTRL-T binding not using last token with custom FZF_CTRL_T_COMMAND #4498

@ZacDanMon

Description

@ZacDanMon

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.65.1 (Fedora)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

fzf version: 0.65.1
fish version: 4.0.2

I've been exploring the shell integration features of fzf with fish shell, and I came across the CTRL-T binding and ways to customize it. From what I can see in the readme, referencing $dir in FZF_CTRL_T_COMMAND should allow me to use the current last token on the command line as the root directory. I've tried many different ways to format the command, with both find and fd, but I'm finding that any value in that variable causes the root directory to be the cwd, and not the last token.

The correct behavior is working if FZF_CTRL_T_COMMAND is unset. Following the example in the readme, hitting CTRL-T with the following text in the command line:

ls /var/

Does list files and directories relative to /var/

The problem occurs if you set FZF_CTRL_T_COMMAND to either:

And then try to use the CTRL-T binding from the same starting text as above, it will incorrectly list files relative to your current working directory.

I've tried this with my own fish config, and from a blank config started with fish -N and the behavior is the same. I haven't been able to find any value for FZF_CTRL_T_COMMAND that shows the list relative to the directory.

Based on previous issues I've found, like the one referenced above this seems to have been working before. I know there's been some bigger fish version changes lately, so it's possible the current way of setting that token isn't working with the newest version of fish.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions