Skip to content

Plugin gives error with fish >=4.8.0 #548

Description

@dpetka2001

With the release of fish 4.8.0 this plugin is giving error when pressing <tab> to auto-complete

git-forgit add source: Error encountered while sourcing file '/usr/share/fish/completions/git.fish':
source: No such file or directory

According to changelog https://github.com/fish-shell/fish-shell/releases#release-4.8.0

With the exception of the $CMAKE_INSTALL_PREFIX/share/fish/man directory, fish no longer installs files to $CMAKE_INSTALL_PREFIX/share/fish. In particular, this means that both $CMAKE_INSTALL_PREFIX/share/fish/completions and $CMAKE_INSTALL_PREFIX/share/fish/functions should no longer exist. These directories have been ignored since fish 4.2. If another package installs fish scripts there, they should be corrected to install to extra_completionsdir (typically $CMAKE_INSTALL_PREFIX/share/fish/vendor_completions.d), extra_functionsdir (typically $CMAKE_INSTALL_PREFIX/share/fish/vendor_functions.d) or extra_confdir (typically $CMAKE_INSTALL_PREFIX/share/fish/vendor_functions.d) instead.

It seems that the asset files that were present in those directories are part of the binary now and those dirs are ignored.

I also looked through the issues (because I'm not familiar with fish codebase) and found this fish-shell/fish-shell#12769 and I tried one solution mentioned there, namely

# not functions -q __fish_git && source $__fish_data_dir/completions/git.fish
# WARN: see https://github.com/fish-shell/fish-shell/issues/12769

not functions -q __fish_git && status get-file completions/git.fish | source

and seems to be working. Not confident if that is the best solution, so reluctant to create a PR myself.

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