From 96456e24e6ae28cf70e1914901c0169ec7a41fe7 Mon Sep 17 00:00:00 2001 From: Vaidas Jablonskis Date: Mon, 4 Aug 2014 15:36:02 +0100 Subject: [PATCH] bash: fixes slow prompt and not add dir upon return key This fixes (#303) slow prompt issue, because every time one hits return key, autojump_add_to_database python code is executed, which is very noticeably slow. Also autojump should not add current directory to a database if it has not changed since last time return key was pressed, so this fixes that as well. --- bin/autojump.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/autojump.bash b/bin/autojump.bash index 25a3ff3..57817d8 100644 --- a/bin/autojump.bash +++ b/bin/autojump.bash @@ -45,7 +45,7 @@ case $PROMPT_COMMAND in *autojump*) ;; *) - PROMPT_COMMAND="${PROMPT_COMMAND:+$(echo "${PROMPT_COMMAND}" | awk '{gsub(/; *$/,"")}1') ; }autojump_add_to_database" + PROMPT_COMMAND="${PROMPT_COMMAND:+$(echo "${PROMPT_COMMAND}" | awk '{gsub(/; *$/,"")}1') ; }[[ $OLDPWD == $PPWD ]] && autojump_add_to_database && PPWD=$PWD" ;; esac