Powerlevel9k / powerlevel9k

Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
https://github.com/romkatv/powerlevel10k
MIT License
13.47k stars 947 forks source link

Fix RVM #1149

Closed dritter closed 5 years ago

dritter commented 5 years ago

This is a cleaned up Version of #832 .

dritter commented 5 years ago

I don't think this will break anything, so I merged this one. @HaoZeke thanks and have a look at master. ;)

csalvato commented 5 years ago

I don't believe this fixes the RVM prompt. In my installation, this only shows the ruby version, but not the gemset. In my local repo, I changed this:

prompt_rvm() {
  if [ $commands[rvm-prompt] ]; then
    local version_and_gemset=${$(rvm-prompt v p)/ruby-}

    if [[ -n "$version_and_gemset" ]]; then
      "$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$version_and_gemset" 'RUBY_ICON'
    fi
  fi
}

to this...

prompt_rvm() {
  if [ $commands[rvm-prompt] ]; then
    local version_and_gemset=${$(rvm-prompt)/ruby-}

    if [[ -n "$version_and_gemset" ]]; then
      "$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$version_and_gemset" 'RUBY_ICON'
    fi
  fi
}

And it now displays as I want it to: image