Git Product home page Git Product logo

Comments (8)

klaasb avatar klaasb commented on July 26, 2024 32

You can also fix it by using single quotes, so the variables and commands in PROMPT don't get evaluated when sourcing .zshrc. See here: http://unix.stackexchange.com/questions/14266/how-do-you-make-rprompt-in-zsh-update-itself-on-every-enter

from zsh-git-prompt.

cevaris avatar cevaris commented on July 26, 2024 10

Fixed by defining a precmd function in my .zshrc file.

source ~/.zsh.d/zsh-git-prompt/zshrc.sh
function precmd {
    PROMPT="%{$fg[green]%}%c $(git_super_status)%{$fg[red]%}~%{$fg[white]%}เฟ” %{$reset_color%}"
}

from zsh-git-prompt.

yibum avatar yibum commented on July 26, 2024 1

@klaasb Changing to single quotes works for me. Thanks!

from zsh-git-prompt.

therealplato avatar therealplato commented on July 26, 2024 1

+1 for single quote fix
I used it to implement a much simpler color indicator
screen shot 2016-04-26 at 9 48 05 am

from zsh-git-prompt.

zhimsel avatar zhimsel commented on July 26, 2024

@cevaris That actually seems to have worked. I'll test the rest of today and see if there are any bugs or situations where it doesn't work. Thanks!

from zsh-git-prompt.

cevaris avatar cevaris commented on July 26, 2024

๐Ÿ‘

from zsh-git-prompt.

aamnah avatar aamnah commented on July 26, 2024

Just a note that this single quote thing is valid for all files in the custom/ folder.

This gave me a hard time after having copied over code from my .bash_aliases. Some aliases there defined with double quotes made my git prompt stopped working again.

The following will cause issues

## Recursively delete `.DS_Store` files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"

## Kill all the tabs in Chrome to free up memory
# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description
alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill"

Had to flip the single and double arrangement: single quote outside, double quote inside

## Recursively delete `.DS_Store` files
alias cleanup='find . -type f -name "*.DS_Store" -ls -delet'

## Kill all the tabs in Chrome to free up memory
# [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description
alias chromekill='ps ux | grep "[C]hrome Helper --type=renderer" | grep -v extension-process | tr -s " " | cut -d " " -f2 | xargs kill'

from zsh-git-prompt.

sisrfeng avatar sisrfeng commented on July 26, 2024
source ~/dotF/zsh-git-prompt/zshrc.sh


function precmd {
export RPS1='$(git_super_status)'
}

from zsh-git-prompt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.