powerline-shell icon indicating copy to clipboard operation
powerline-shell copied to clipboard

Need to use precmd_functions for bash

Open kynan opened this issue 4 years ago • 3 comments

When adding powerline-shell to my ~/.bashrc following the instructions the prompt did not update when changing directories etc. Using the same config as for zsh only dropping the --shell argument worked fine:

function powerline_precmd() {
    PS1="$(powerline-shell $?)"
}

function install_powerline_precmd() {
  for s in "${precmd_functions[@]}"; do
    if [ "$s" = "powerline_precmd" ]; then
      return
    fi
  done
  precmd_functions+=(powerline_precmd)
}

if [ "$TERM" != "linux" ]; then
    install_powerline_precmd
fi

bash version: GNU bash, version 4.4.23(1)-release (x86_64-pc-linux-gnu)

kynan avatar Jul 29 '19 21:07 kynan

what is your version of python

jceaser avatar Jul 31 '19 10:07 jceaser

3.6.6

kynan avatar Jul 31 '19 20:07 kynan

does not work for me either, but I really don't understand why that script is as complicated as it is.

jceaser avatar Jul 31 '19 23:07 jceaser