Giter Site home page Giter Site logo

Comments (6)

ColinTheRobot avatar ColinTheRobot commented on July 20, 2024 2

Thanks @michaeldfallen. I finally got it working, forgot the need for single quotes rather than double and needed to call setopt PROMPT_SUBST

from git-radar.

monguin61 avatar monguin61 commented on July 20, 2024

I had this same problem while trying to get started using zsh. It looks like the $ needs to be escaped with just %, not /, so the following is (almost) working for me:

%$(git-radar --zsh --fetch)

"Almost", because this results in output like the following:

%{ git:(𝘮 34 ⇄ 65 feature/AUD-1140) 2A

I'm not sure why that %{ is present at the beginning.

from git-radar.

michaeldfallen avatar michaeldfallen commented on July 20, 2024

My PROMPT setting is here: https://github.com/michaeldfallen/dotfiles/blob/master/zsh/prompt.zsh#L20

Can you try something like that?

export PROMPT=$'$(git-radar --zsh --fetch)'

where the $' style of quotes seems to prevent execution of the contents.

from git-radar.

ColinTheRobot avatar ColinTheRobot commented on July 20, 2024

Hmmm, I got it work for a second (actually a second) following the conversation issue 28

now though sourcing the file just repeats the bare unexecuted prompt

image

.zshrc only contains the following resulting in the above.

export PATH=$PATH:$HOME/.git-radar
export PROMPT="$PROMPT\$(git-radar --zsh --fetch) "

from git-radar.

michaeldfallen avatar michaeldfallen commented on July 20, 2024

That's because you are appending git-radar to the $PROMPT. So the second time you source ~/.zshrc you append git-radar to $PROMPT which was $PROMPT with git-radar appended.

The best way to get it to work is to have a single definition of export PROMPT. Here is mine:

michaeldfallen/dotfiles/prompt.zsh:

export PROMPT=$'$(ret_status)$(directory_name)$(git_radar) '

Those functions build each part of the prompt. Remember that the ~/.zshrc is just a shell script. It will execute each time you source it. Thus if you try to do any appending to any variables you are going to run in to problems on the next execution.

from git-radar.

acarltonsmith avatar acarltonsmith commented on July 20, 2024

and needed to call setopt PROMPT_SUBST

Setting setopt PROMPT_SUBST also fixed issues for me, is this worth mentioning in the docs?

from git-radar.

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.