From 0d3532c4e0929ddafb50b61fab0637a6974fc791 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 4 Mar 2018 17:50:49 -0500 Subject: conditionalize fancy-prompt config on being installed so that we don't end up promptless on a new system before installing it --- bashrc | 4 +++- zshrc | 12 +++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bashrc b/bashrc index f4caa0b..83c2145 100644 --- a/bashrc +++ b/bashrc @@ -54,7 +54,9 @@ source ~/.sh/fzf/shell/completion.bash source ~/.sh/fzf/shell/key-bindings.bash # }}} # prompt {{{ -export PROMPT_COMMAND="__err=\$?;$PROMPT_COMMAND;PS1=\"\$(fancy-prompt --prompt-escape bash "\$__err")\"" +if type fancy-prompt > /dev/null 2>&1; then + export PROMPT_COMMAND="__err=\$?;$PROMPT_COMMAND;PS1=\"\$(fancy-prompt --prompt-escape bash "\$__err")\"" +fi # }}} # }}} # fortune {{{ diff --git a/zshrc b/zshrc index 99ca293..e82c817 100644 --- a/zshrc +++ b/zshrc @@ -89,11 +89,13 @@ ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=black,bold' # }}} # }}} # prompt {{{ -function shell_prompt_precmd () { - PROMPT=`fancy-prompt --prompt-escape zsh $?` - RPS1='' -} -precmd_functions+=(shell_prompt_precmd) +if type fancy-prompt > /dev/null 2>&1; then + function shell_prompt_precmd () { + PROMPT=`fancy-prompt --prompt-escape zsh $?` + RPS1='' + } + precmd_functions+=(shell_prompt_precmd) +fi function zle-keymap-select () { setopt localoptions no_ksharrays { [[ "${@[2]-main}" == opp ]] } && return -- cgit v1.2.3-54-g00ecf