From 1a12071a48a4ead52c8749118aef2a1016bdc5e5 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 29 Dec 2015 15:41:00 +0100 Subject: Immediately define command-not-found handler This skips the weird dance where we'd define a simple handler and then later overwrite with a fancier one, once the first event came in. It turns out that isn't necessary, as it doesn't actually improve startup speed because the checks needed to define fancier handlers are fast. In case we are non-interactive, still define the simple handler, and keep the default handler for users to switch to. --- share/config.fish | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'share/config.fish') diff --git a/share/config.fish b/share/config.fish index f1bb0c0c..b1d404ee 100644 --- a/share/config.fish +++ b/share/config.fish @@ -19,10 +19,9 @@ end # # Hook up the default as the principal command_not_found handler -# for starting up since finding and executing a real one is not cheap -# This will be erased in __fish_command_not_found_setup once we're interactive +# in case we are not interactive # -function __fish_startup_command_not_found_handler --on-event fish_command_not_found +status -i; or function __fish_command_not_found_handler --on-event fish_command_not_found __fish_default_command_not_found_handler $argv end -- cgit v1.2.3