aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_config_interactive.fish
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-29 14:19:45 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-29 14:19:45 -0700
commitd4fafeb6d66e415e85c67700e5a370765c09bb93 (patch)
tree7e208d860649e8651180b281ec715a96169a9dbe /share/functions/__fish_config_interactive.fish
parent844b01cb6be2ab3a3f7070112c94604b43710835 (diff)
parent31bf50b2d495222925371556169f61c1c5a81ed7 (diff)
Merge branch 'master' into 1218_rebase
Conflicts: builtin.cpp builtin_commandline.cpp highlight.cpp input.cpp input.h reader.cpp screen.cpp screen.h
Diffstat (limited to 'share/functions/__fish_config_interactive.fish')
-rw-r--r--share/functions/__fish_config_interactive.fish27
1 files changed, 22 insertions, 5 deletions
diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish
index a05d7985..46b6ca24 100644
--- a/share/functions/__fish_config_interactive.fish
+++ b/share/functions/__fish_config_interactive.fish
@@ -217,8 +217,8 @@ function __fish_config_interactive -d "Initializations that should be performed
end
end
- # Load key bindings
- __fish_reload_key_bindings
+ # Load key bindings. Redirect stderr per #1155
+ __fish_reload_key_bindings ^ /dev/null
# Repaint screen when window changes size
function __fish_winch_handler --on-signal winch
@@ -236,12 +236,29 @@ function __fish_config_interactive -d "Initializations that should be performed
# The first time a command is not found, look for command-not-found
# This is not cheap so we try to avoid doing it during startup
+ # config.fish already installed a handler for noninteractive command-not-found,
+ # so delete it here since we are now interactive
+ functions -e __fish_command_not_found_handler
+
+ # Now install our fancy variant
function __fish_command_not_found_setup --on-event fish_command_not_found
# Remove fish_command_not_found_setup so we only execute this once
functions --erase __fish_command_not_found_setup
- # First check in /usr/lib, this is where modern Ubuntus place this command
- if test -f /usr/lib/command-not-found
+ # First check if we are on OpenSUSE since SUSE's handler has no options
+ # and expects first argument to be a command and second database
+ # also check if there is command-not-found command.
+ if begin; test -f /etc/SuSE-release; and type -p command-not-found > /dev/null 2> /dev/null; end
+ function __fish_command_not_found_handler --on-event fish_command_not_found
+ /usr/bin/command-not-found $argv
+ end
+ # Check for Fedora's handler
+ else if test -f /usr/libexec/pk-command-not-found
+ function __fish_command_not_found_handler --on-event fish_command_not_found
+ /usr/libexec/pk-command-not-found -- $argv
+ end
+ # Check in /usr/lib, this is where modern Ubuntus place this command
+ else 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
@@ -253,7 +270,7 @@ function __fish_config_interactive -d "Initializations that should be performed
# Use standard fish command not found handler otherwise
else
function __fish_command_not_found_handler --on-event fish_command_not_found
- echo fish: Unknown command "'$argv'" >&2
+ __fish_default_command_not_found_handler $argv
end
end
__fish_command_not_found_handler $argv