Comments (6)
Can you post your export PROMPT
line from the ~/.zshrc
? I think what's happening is the %
you've put at the front is escaping the first character in the non-printing character boundary, which is %{
, so you get %{
output from %%{
. That's my guess.
If I could see your .zshrc
I can have a better look at it.
from git-radar.
From ZSH Docs - Prompt Expansion:
If the PROMPT_PERCENT option is set, certain escape sequences that start with ‘%’ are expanded. Many escapes are followed by a single character, although some of these take an optional integer argument that should appear between the ‘%’ and the next character of the sequence. More complicated escape sequences are available to provide conditional expansion.
from git-radar.
Below are the several different prompts I've tried. There is nothing else in my .zshrc, I just started using ZSH and haven't copied anything else over from other rc files yet. It looks like you're right about the '%' escaping, maybe if I read through more of the ZSH docs it will become clear to me what's going on.
# my basic BASH prompt, no color
#PS1="[%D %T] %~
#alan@MBP (%j/%!)$
# result:
# [15-10-21 10:56:26] ~/src
# alan@MBP (0/30)$
# my basic BASH prompt, with color
#export PROMPT="%F{red}[%D %*] %~
#%F{red}alan@MBP (%F{cyan}%j%F{red}/%!)$%f "
# result:
# [15-10-21 10:56:26] ~/src
# alan@MBP (0/30)$
# my basic BASH prompt, with color and git-radar
#export PROMPT="%F{red}[%D %*] %~%f %$(git-radar --zsh --fetch)
#%F{red}alan@MBP (%F{cyan}%j%F{red}/%!)$%f "
# result:
# [15-10-21 10:56:05] ~/src %{ git:(𝘮 402 ⇄ 8 feature/PLAT-187 1↑) 10M
# alan@MBP (0/29)$
This is the best thing I've found so far:
# other attempts
#export PROMPT="%$(git-radar --zsh --fetch) $ "
# result:
# %{ git:(𝘮 402 ⇄ 8 feature/PLAT-187 1↑) 10M $
And this is your suggestion from issue 46, which isn't working for me:
export PROMPT=$'$(git-radar) '
# result:
# $(git-radar)
#export PROMPT=$'$(git-radar --zsh --fetch) '
# result:
# $(git-radar --zsh --fetch)
Thanks for your help. I thought there might be a simple fix, visible to someone who has used ZSH more - if that's not the case, don't worry about it.
from git-radar.
Ok, I've got it figured out.
You've only just started with ZSH so likely you haven't actually enabled prompt expansion. It's not something ZSH does by default but most people turn it on.
To do that add this to ~/.zshrc
:
setopt PROMPT_SUBST
Now use the form I suggested for your prompt:
export PROMPT=$'$(git-radar --zsh --fetch) '
I have a set of sane defaults I use at dotfiles/zsh/config.zsh. Most of them are commented but YMMV for which you like to use. zstyle ':completion:*' menu select
is particularly nice as it lets you arrow key move through completions, making auto-complete feel so much more modern.
Welcome to ZSH!
from git-radar.
That works, thanks!
from git-radar.
Cool, closing.
from git-radar.
Related Issues (20)
- is_cwd_a_dot_git_directory:1: = not found HOT 7
- Promote new Maintainers HOT 4
- Calling Formula.sha1 is deprecated! HOT 4
- Calling Formula.sha1 is deprecated! HOT 2
- Not upstream indicator taking up too much space HOT 12
- problem with fish HOT 2
- Weird issue with Makefile HOT 2
- Running git-radar --bash is slow HOT 3
- Fish - LS is completely bugged HOT 2
- command overlaps prompt with stash HOT 1
- odd sed error on branches named with multiple / characters HOT 7
- have to pull twice to update a work branch HOT 22
- Made a new lightweight stable version of git-radar HOT 2
- weird characters show up with git-radar on mac os x HOT 8
- fatal error messages with git-radar on local untracked branches HOT 11
- Unhandled git error when a tracked upstream branch is removed HOT 2
- 0.6 upgrade issue HOT 3
- feature req: color prompt red when folder not writable HOT 1
- Reduce the number of binaries needed to be added to the path HOT 3
- cd .git/ produces fatal: /usr/lib/git-core/git-stash cannot be used without a working tree HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-radar.