Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

rbenv prompt option always displays #777

Closed
ghost opened this issue Mar 17, 2018 · 4 comments
Closed

rbenv prompt option always displays #777

ghost opened this issue Mar 17, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 17, 2018

In powerlevel9k.zsh-theme the rbenv_prompt is set to only show the ruby version if it is different from the global version set.

For people like me who want to always see the ruby version segment in the prompt, could the conditional be removed or at least an option (eg via an environment variable) to keep it always showing?

===>
local rbenv_global="$(rbenv global)"

#Don't show anything if the current Ruby is the same as the global Ruby.
if [[ $rbenv_version_name == $rbenv_global ]]; then
   return
fi

=== From the function ===>

rbenv information

prompt_rbenv() {
if which rbenv 2>/dev/null >&2; then
local rbenv_version_name="$(rbenv version-name)"
local rbenv_global="$(rbenv global)"

# Don't show anything if the current Ruby is the same as the global Ruby.
 if [[ $rbenv_version_name == $rbenv_global ]]; then
   return
 fi

"$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON'

fi
}

@bhilburn
Copy link
Member

@RyanDav - Yup, good idea. Let's add a flag that turns it on permanently.

Are you up for taking a crack at the PR?

@ghost
Copy link
Author

ghost commented Mar 26, 2018

Yes, I'll give it a go this week

@ghost
Copy link
Author

ghost commented Apr 3, 2018

@bhilburn Now submitted a PR for this change #795

bhilburn added a commit that referenced this issue Apr 14, 2018
…ays-#777

Rbenv prompt option always displays #777
@dritter
Copy link
Member

dritter commented Jun 2, 2018

Closing this Issue; PR is already merged. Thx @RyanDav

@dritter dritter closed this as completed Jun 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants