Disable pacman command-not-found handler

Apparently it's too slow on some systems

Fixes #7841.

(cherry picked from commit 95dc821a44)
This commit is contained in:
Fabian Homborg 2021-03-21 10:03:09 +01:00 committed by David Adam
parent 156d57d270
commit b2baf110c5

View file

@ -57,17 +57,18 @@ else if type -q pkgfile
__fish_default_command_not_found_handler $argv[1] __fish_default_command_not_found_handler $argv[1]
end end
end end
else if type -q pacman # pacman is too slow, see #7841.
function fish_command_not_found # else if type -q pacman
set -l paths $argv[1] # function fish_command_not_found
# If we've not been given an absolute path, try $PATH as the starting point, # set -l paths $argv[1]
# otherwise pacman will try *every path*, and e.g. bash-completion # # If we've not been given an absolute path, try $PATH as the starting point,
# isn't helpful. # # otherwise pacman will try *every path*, and e.g. bash-completion
string match -q '/*' -- $argv[1]; or set paths $PATH/$argv[1] # # isn't helpful.
# Pacman only prints the path, so we still need to print the error. # string match -q '/*' -- $argv[1]; or set paths $PATH/$argv[1]
__fish_default_command_not_found_handler $argv[1] # # Pacman only prints the path, so we still need to print the error.
pacman -F $paths # __fish_default_command_not_found_handler $argv[1]
end # pacman -F $paths
# end
else else
# Use standard fish command not found handler otherwise # Use standard fish command not found handler otherwise
function fish_command_not_found --on-event fish_command_not_found function fish_command_not_found --on-event fish_command_not_found