From fee09ac42bd618e153e2f3473f5dcf736004b420 Mon Sep 17 00:00:00 2001 From: GlazerMann Date: Fri, 5 Feb 2021 12:35:27 -0600 Subject: [PATCH] Fix for tcsh --- bin/autojump.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/bin/autojump.sh b/bin/autojump.sh index 0ddff47..dbeabda 100644 --- a/bin/autojump.sh +++ b/bin/autojump.sh @@ -1,13 +1,14 @@ # the login $SHELL isn't always the one used # NOTE: problems might occur if /bin/sh is symlinked to /bin/bash +# Because csh is so different from sh, we cannot use the same code +echo $shell | grep -q csh && goto CSH + if [ -n "${BASH}" ]; then shell="bash" elif [ -n "${ZSH_NAME}" ]; then shell="zsh" elif [ -n "${__fish_datadir}" ]; then shell="fish" -elif [ -n "${version}" ]; then - shell="tcsh" else shell=$(echo ${SHELL} | awk -F/ '{ print $NF }') fi @@ -24,3 +25,15 @@ elif [ -s ~/.autojump/share/autojump/autojump.${shell} ]; then elif [ -s /usr/local/share/autojump/autojump.${shell} ]; then source /usr/local/share/autojump/autojump.${shell} fi + +return + +# csh/tcsh jump here +CSH: + +if ( -f ~/.autojump/share/autojump/autojump.tcsh ) then + source ~/.autojump/share/autojump/autojump.tcsh +# check global install +else if ( -f /usr/local/share/autojump/autojump.tcsh ) then + source /usr/local/share/autojump/autojump.tcsh +endif