Can't see my current git branch in my prompt
Discord username (optional)
No response
Describe the bug
I search in internet and what I undersrand is that sith the default prompt, we have: path + branch + nb of changes. I did have this configuration, but for some reason I can't find a way to see my git infos.
To reproduce
1: Go to a file with a git repository 2: Watch the prompt
Expected behavior
For exemple in my screenshot
~/iOS/GL/gl-ios [feat/client-16086-sorts]2
Screenshots
Operating system
MacOS
Operating system and version
14.0.0
Shell Version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin23) zsh 5.9 (x86_64-apple-darwin23.0)
Current Warp version
v0.2023.06.13.08.03.stable_03
Regression
No, this bug or issue has existed throughout my experience using Warp
Recent working Warp date
~15/06/23
Additional context
No response
Does this block you from using Warp daily?
Yes, this issue prevents me from using Warp daily.
Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)
Yes, this I confirmed this only happens in Warp, not other terminals.
Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e
None
With the latest update even i'm not seeing the git branch in my warp terminal.
Hey Folks, sorry to hear about this issue. I can't seem to reproduce this on my end. There are a few questions that may help us narrow down the root of the issue.
- Is there any custom prompt you're using or Warp default prompt? If default, as a workaround, you can try using a custom prompt like Starship.rs so that you can see the git branch.
- When you right-click on the prompt and "Copy git branch", then paste it into the input editor, does it paste the branch or nothing?
- Also, care to share your redacted (make sure to not include any personal information on these files. i.e. logins, IPs, etc.) gitconfig or rcfiles so that we can try and reproduce this issue?
When I right click on the prompt there is no "Copy git branch" option. I am using the default prompt.
I am also facing this issue. Not able to see the current branch in the terminal
- I use zsh with warpify enabled
zsh --version : zsh 5.9 (x86_64-apple-darwin22.0) - The default prompt doesn't contain the git branch after upgrading to v0.2023.06.13.08.03.stable_03
- I don't have a .gitconfig
- Right-clicking the top of a block doesn't have the "copy git branch" option like it used to
I was able to get a custom prompt working by adding this to ~/.zshrc, restarting, right-clicking the prompt, and selecting “custom”.
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats "%F{010}(%b)%f "
precmd() { vcs_info }
setopt prompt_subst
PROMPT='${PWD/#$HOME/~} ${vcs_info_msg_0_} %'
The latest update broke it for me as well
I'm also seeing the same issue, after the latest update
I fix the issue by deleting the .zshrc and other related files 🤷🏽♂️
Didn't know why because I didn't use it previously.
Not sure it will work for everyone.
Thanks for all the sharings
This issue is also happening to me since latest update. Deleting the .zshrc files is not an actual solution. I have stuff in .zshrc that I rely on.
I agree that deleting the .zshrc file isn't the right solution.
Having the same issue :( I really enjoyed this feature.
@dannyneira Why would it have stopped working when it worked previously?
Hi all! Apologies you're running into this regression 😦 I have a hypothesis about what is causing it, related to how we locate the git executable to populate that portion of the default prompt. If you're seeing this behavior, can you share:
- How
gitwas installed on your machine (if you can recall) - The output of
which -a git
That should help confirm if what I'm seeing is in fact the root cause of this issue, or if we need more investigation. Thanks!
which -a git
/opt/homebrew/bin/git
/usr/bin/git
Thanks @SHF-Tim, I think that confirms my hypothesis! We should have a fix out for this in the next release—it may be tight given the holiday, in which case it would be the release after.
I was also facing same issue, but when I right clicked on prompt and selected 'use my own prompt' it started working.
I use below in my .zshrc
# Prompt Change
source /opt/homebrew/etc/bash_completion.d/git-prompt.sh
setopt PROMPT_SUBST ; PS1='%~$(__git_ps1 " git:(%s)")\$ '
The newest update fixed this issue for me.
The latest release also resolved it for me. Thanks!
Excellent, glad to hear it! Thanks all for reporting and helping to debug 🚀