From 74a0a716315f1681b5b837cce8ba248ca33f6883 Mon Sep 17 00:00:00 2001 From: Rinyre Date: Sat, 13 May 2017 16:11:37 -0500 Subject: [PATCH] Return Windows binary exit code instead of 0 --- plugins/command-not-found/command-not-found.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/command-not-found/command-not-found.plugin.zsh b/plugins/command-not-found/command-not-found.plugin.zsh index 029f9b6b..29357a3f 100644 --- a/plugins/command-not-found/command-not-found.plugin.zsh +++ b/plugins/command-not-found/command-not-found.plugin.zsh @@ -39,13 +39,13 @@ case "$SYS_KERNEL" in *WSL*|*Microsoft*) command_not_found_handler () { commandsent="$@" buffer=("${(@s/ /)commandsent}") - which $buffer[1].exe>/dev/null + which $buffer[1].exe>/dev/null # Does binary exist in path? if [ $? -eq 0 ]; then buffer[1]=$buffer[1].exe $buffer - return 0 + exit # Returns exit code from Windows binary else - return 1 + return 1 # Returns 'command not found' fi } ;; *) ;;