From 790968120d280443be17737c73ff13928a633a37 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 15 Aug 2016 22:36:21 +0200 Subject: [PATCH] Give up earlier when we can't find default key bindings. This relates to #3302. --- share/functions/__fish_config_interactive.fish | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 630450c5c..fd206d45e 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -172,11 +172,18 @@ function __fish_config_interactive -d "Initializations that should be performed if set -q __fish_active_key_bindings echo "Keeping $__fish_active_key_bindings" >&2 return 1 - else + else if functions -q fish_default_key_bindings echo "Reverting to default bindings" >&2 set fish_key_bindings fish_default_key_bindings # Return because we are called again return 0 + else + # If we can't even find the default bindings, something is broken. + # Without it, we would eventually run into the stack size limit, but that'd print hundreds of duplicate lines + # so we should give up earlier. + echo "Cannot find fish_default_key_bindings, falling back to very simple bindings." >&2 + echo "Most likely something is wrong with your installation." >&2 + return 0 end end set -g __fish_active_key_bindings "$fish_key_bindings"