From 80c8500136f5bd9b9cda3a45fdf76867f32a5d91 Mon Sep 17 00:00:00 2001 From: Khalid Zubair Date: Fri, 13 Nov 2015 10:01:03 -0800 Subject: [PATCH] Preserve exit code in bash hook Preserve the exit code from the previous command the user ran when exiting from the bash hook. This allows other commands in PROMPT_COMMAND to handle the exit code from the original user command. --- fasd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fasd b/fasd index 4275b7e..a9e443d 100755 --- a/fasd +++ b/fasd @@ -125,8 +125,11 @@ EOS bash-hook) cat <> "$_FASD_SINK" 2>&1 + # preserve exit code + return \$_exit_code } # add bash hook