junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
63.4k stars 2.36k forks source link

fish ctrl-t doesn't respect the relative directory with user defined $FZF_CTRL_T_COMMAND #3705

Closed kpskp77 closed 5 months ago

kpskp77 commented 5 months ago

Checklist

Output of fzf --version

0.48 (devel)

OS

Shell

Problem / Steps to reproduce

> echo $FZF_CTRL_T_COMMAND
fd --follow --exclude tags --exclude .svn --exclude .git . $dir 2>/dev/null

I think the problem is the variable $dir is not exported in key-bindings.fish

function fzf_key_bindings

  # Store current token in $dir as root for the 'find' command
  function fzf-file-widget -d "List files and folders"
    set -l commandline (__fzf_parse_commandline)
    set -l dir $commandline[1] ## <--- should be `set -lx` here?
    set -l fzf_query $commandline[2]
    set -l prefix $commandline[3]
junegunn commented 5 months ago

Maybe you're running into #3684?

junegunn commented 5 months ago

Thanks for the report, your analysis is spot on. It should be fixed now.