From bc8a83208f9b4aa8fcc29cc35a0eeec3ae67c5b9 Mon Sep 17 00:00:00 2001 From: dinhnv Date: Wed, 22 Nov 2017 11:30:24 +0700 Subject: [PATCH 1/5] pyenv promt segment uses $PYENV_VERSION environment variable" --- powerlevel9k.zsh-theme | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 73178865..b65c2077 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1379,18 +1379,10 @@ prompt_virtualenv() { } # pyenv: current active python version (with restrictions) -# More information on pyenv (Python version manager like rbenv and rvm): -# https://github.com/yyuu/pyenv -# the prompt parses output of pyenv version and only displays the first word +# https://github.com/pyenv/pyenv#choosing-the-python-version prompt_pyenv() { - local pyenv_version="$(pyenv version 2>/dev/null)" - pyenv_version="${pyenv_version%% *}" - # XXX: The following should return the same as above. - # This reads better for devs familiar with sed/awk/grep/cut utilities - # Using shell expansion/substitution may hamper future maintainability - #local pyenv_version="$(pyenv version 2>/dev/null | head -n1 | cut -d' ' -f1)" - if [[ -n "$pyenv_version" && "$pyenv_version" != "system" ]]; then - "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$pyenv_version" 'PYTHON_ICON' + if [[ -n "$PYENV_VERSION" ]]; then + "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$PYENV_VERSION" 'PYTHON_ICON' fi } From f154e75667aff0801c3d978b44f5e4551d91e240 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Mon, 27 Nov 2017 15:15:44 +0900 Subject: [PATCH 2/5] Disable alias of grep If user defined alias of grep command with '-r' or '--recursive' option, it causes a slow response of command line. It is not unexpected behavior of vcs info. This commit explicitly disables alias of grep to suppress side effects. --- functions/vcs.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/vcs.zsh b/functions/vcs.zsh index c3e507b9..89f04143 100644 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -17,7 +17,7 @@ function +vi-git-untracked() { fi if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \ - -n $(git status ${FLAGS} | grep -E '^\?\?' 2> /dev/null | tail -n1) ]]; then + -n $(git status ${FLAGS} | \grep -E '^\?\?' 2> /dev/null | tail -n1) ]]; then hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')" VCS_WORKDIR_HALF_DIRTY=true else @@ -137,15 +137,15 @@ function +vi-vcs-detect-changes() { function +vi-svn-detect-changes() { local svn_status="$(svn status)" - if [[ -n "$(echo "$svn_status" | grep \^\?)" ]]; then + if [[ -n "$(echo "$svn_status" | \grep \^\?)" ]]; then hook_com[unstaged]+=" $(print_icon 'VCS_UNTRACKED_ICON')" VCS_WORKDIR_HALF_DIRTY=true fi - if [[ -n "$(echo "$svn_status" | grep \^\M)" ]]; then + if [[ -n "$(echo "$svn_status" | \grep \^\M)" ]]; then hook_com[unstaged]+=" $(print_icon 'VCS_UNSTAGED_ICON')" VCS_WORKDIR_DIRTY=true fi - if [[ -n "$(echo "$svn_status" | grep \^\A)" ]]; then + if [[ -n "$(echo "$svn_status" | \grep \^\A)" ]]; then hook_com[staged]+=" $(print_icon 'VCS_STAGED_ICON')" VCS_WORKDIR_DIRTY=true fi From 6e931f6047994ebb4a83924c298678d059e183d4 Mon Sep 17 00:00:00 2001 From: Torben Hartmann Date: Mon, 27 Nov 2017 21:38:03 +0100 Subject: [PATCH 3/5] Fixed Issue with whitespaces in path. --- powerlevel9k.zsh-theme | 3 +++ 1 file changed, 3 insertions(+) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 73178865..5dd394ea 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -695,7 +695,10 @@ set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/" set_default POWERLEVEL9K_HOME_FOLDER_ABBREVIATION "~" set_default POWERLEVEL9K_DIR_SHOW_WRITABLE false prompt_dir() { + local tmp=$IFS + local IFS="" local current_path=$(pwd | sed -e "s,^$HOME,~,") + local IFS=$tmp if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_folder_marker" ]]; then set_default POWERLEVEL9K_SHORTEN_DELIMITER $'\U2026' From 42b72423467b5457d1feb0b307712dc7badf80e5 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 4 Dec 2017 19:30:38 -0500 Subject: [PATCH 4/5] Updating build status to be `master` only. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c1974de..3ae786b8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![](https://raw.githubusercontent.com/bhilburn/powerlevel9k-logo/master/logo-banner.png) --- -[![Build Status](https://travis-ci.org/bhilburn/powerlevel9k.svg?branch=next)](https://travis-ci.org/bhilburn/powerlevel9k) +[![Build Status](https://travis-ci.org/bhilburn/powerlevel9k.svg?branch=master)](https://travis-ci.org/bhilburn/powerlevel9k) [![Join the chat at https://gitter.im/bhilburn/powerlevel9k](https://badges.gitter.im/bhilburn/powerlevel9k.svg)](https://gitter.im/bhilburn/powerlevel9k?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Powerlevel9k is a theme for ZSH which uses [Powerline From 02fbaf2c4befcc9a291f391a1a045d1a055332c0 Mon Sep 17 00:00:00 2001 From: Torben Hartmann Date: Tue, 5 Dec 2017 17:30:49 +0100 Subject: [PATCH 5/5] IFS Fix attemp --- powerlevel9k.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 5dd394ea..fb344f25 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -695,10 +695,10 @@ set_default POWERLEVEL9K_DIR_PATH_SEPARATOR "/" set_default POWERLEVEL9K_HOME_FOLDER_ABBREVIATION "~" set_default POWERLEVEL9K_DIR_SHOW_WRITABLE false prompt_dir() { - local tmp=$IFS + local tmp="$IFS" local IFS="" local current_path=$(pwd | sed -e "s,^$HOME,~,") - local IFS=$tmp + local IFS="$tmp" if [[ -n "$POWERLEVEL9K_SHORTEN_DIR_LENGTH" || "$POWERLEVEL9K_SHORTEN_STRATEGY" == "truncate_with_folder_marker" ]]; then set_default POWERLEVEL9K_SHORTEN_DELIMITER $'\U2026'