From 1f6fa1208ebb51721b3d4a7a8949ead3dd4df8ef Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Tue, 15 Jan 2008 22:29:53 +1000 Subject: [PATCH] Search for command-not-found in PATH on startup, since older implementations place it there darcs-hash:20080115122953-75c98-05ef8cb650a942c59dfa35aa63b25ccd49614dde.gz --- share/functions/__fish_config_interactive.fish | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index b9d11dd02..02a036636 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -214,10 +214,19 @@ function __fish_config_interactive -d "Initializations that should be performed end # If the ubuntu command-not-found package can be found, add a handler for it + + # First check in /usr/lib, this is where modern Ubuntus place this command if test -f /usr/lib/command-not-found function fish_command_not_found_handler --on-event fish_command_not_found /usr/lib/command-not-found $argv end + else + # Ubuntu Feisty places this command in the regular path instead + if type -p command-not-found >/dev/null + function fish_command_not_found_handler --on-event fish_command_not_found + command-not-found $argv + end + end end end