1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-16 09:50:06 +00:00
Rbenv prompt option always displays #777
This commit is contained in:
Ben Hilburn 2018-04-13 22:04:50 -04:00 committed by GitHub
commit 13b0e383a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -516,6 +516,10 @@ It figures out the version being used by taking the output of the `rbenv version
* If `rbenv` is not in $PATH, nothing will be shown.
* If the current Ruby version is the same as the global Ruby version, nothing will be shown.
| Variable | Default Value | Description |
|----------|---------------|-------------|
|`POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW`|`false`|Set to true if you wish to show the rbenv segment even if the current Ruby version is the same as the global Ruby version|
##### rspec_stats
See [Unit Test Ratios](#unit-test-ratios), below.

View file

@ -1067,14 +1067,15 @@ prompt_ram() {
"$1_prompt_segment" "$0" "$2" "yellow" "$DEFAULT_COLOR" "$(printSizeHumanReadable "$ramfree" $base)" 'RAM_ICON'
}
set_default POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW false
# rbenv information
prompt_rbenv() {
if which rbenv 2>/dev/null >&2; then
if command 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
if [[ $rbenv_version_name == $rbenv_global && "$POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW" = false ]]; then
return
fi