Fzf: FZF_CTRL_T_COMMAND does not work with absolute paths

Created on 9 Jun 2017  路  2Comments  路  Source: junegunn/fzf

  • Category

    • [ ] fzf binary

    • [ ] fzf-tmux script

    • [x] Key bindings

    • [ ] Completion

    • [ ] Vim

    • [ ] Neovim

    • [ ] Etc.

  • OS

    • [x] Linux

    • [ ] Mac OS X

    • [ ] Windows

    • [ ] Windows Subsystem for Linux

    • [ ] Etc.

  • Shell

    • [ ] bash

    • [ ] zsh

    • [x] fish

The bindings for in fish support taking a starting directory for search path. This does not work for absolute paths:

>> /Library/<C-T>
>
/ 163216/165601
  ibrary/Application Support
  ibrary/Application Support/App Store
  ibrary/Application Support/App Store/adoption.plist
> ibrary/Application Support/Apple
  ibrary/Application Support/Apple/Automator

The default FZF_CTRL_T_COMMAND always strips the first two characters on this line at the cut command. This only works for relative paths since they are prefixed with ./.

This always breaks for absolute paths or paths that are shell expanded to absolute paths ($HOME, ~, etc.):

>> $HOME<C-T>
>
\ 492016/496833
> sers/foo/Applications
  sers/foo/Applications/Amethyst.app
  sers/foo/Applications/Amethyst.app/Contents
  sers/foo/Applications/Amethyst.app/Contents/_CodeSignature
  sers/foo/Applications/Amethyst.app/Contents/_CodeSignature/CodeResources
  sers/foo/Applications/Amethyst.app/Contents/Frameworks
  sers/foo/Applications/Amethyst.app/Contents/Frameworks/Cartography.framework
bug

Most helpful comment

Thanks, it should be fixed now.

All 2 comments

I'm not sure why it's needed to strip the ./ for relative paths at all. It seems to be aesthetics as completions with leading ./ will still work correctly. If it's not required, the fix is simple as removing the extraneous cut -b3- command.

Thanks, it should be fixed now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jan-warchol picture jan-warchol  路  3Comments

lbeier picture lbeier  路  3Comments

nordlow picture nordlow  路  3Comments

firedev picture firedev  路  3Comments

skamsie picture skamsie  路  3Comments