diff --git a/install.sh b/install.sh index 6dc692b..36b0916 100755 --- a/install.sh +++ b/install.sh @@ -121,7 +121,24 @@ __am_prompt_install() { echo $PROMPT_SHA > $PROMPT_SHA_PATH - local PROMPT_SHELL="${1:-"bash"}" + # get the requested shell + local PROMPT_SHELL="${1:-}" + + # determine if the request shell was not set + if [ -z "${PROMPT_SHELL:-}" ]; then + + # get the current shell + PROMPT_SHELL=$(echo $SHELL | rev | cut -d'/' -f1 | rev) + + # test if the current shell is something other than zsh + if [ "$PROMPT_SHELL" != "zsh" ]; then + + # default to bash + PROMPT_SHELL="bash" + fi + fi + + # lowercase the prompt shell local PROMPT_SHELL=$(echo $PROMPT_SHELL | tr '[:upper:]' '[:lower:]') # use the correct shell diff --git a/src/bash/bashrc b/src/bash/bashrc index 2bf30eb..4b5e1a2 100755 --- a/src/bash/bashrc +++ b/src/bash/bashrc @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# set prompt shell +export PROMPT_SHELL="bash" + # shell options shopt -s checkwinsize # check window size on script exit shopt -s cdable_vars # enable change directory to a variable value diff --git a/src/zsh/zshrc b/src/zsh/zshrc index 547a665..cf431a8 100644 --- a/src/zsh/zshrc +++ b/src/zsh/zshrc @@ -1,5 +1,8 @@ #!/usr/bin/env zsh +# set prompt shell +export PROMPT_SHELL="zsh" + # determine if this is a tty if [ -t 1 ]; then