warp icon indicating copy to clipboard operation
warp copied to clipboard

Can't see my current git branch in my prompt

Open FlorianTousch opened this issue 3 years ago • 25 comments

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

CleanShot 2023-06-21 at 15 02 42@2x

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

FlorianTousch avatar Jun 21 '23 13:06 FlorianTousch

With the latest update even i'm not seeing the git branch in my warp terminal.

vinayk406 avatar Jun 21 '23 14:06 vinayk406

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?

dannyneira avatar Jun 21 '23 16:06 dannyneira

When I right click on the prompt there is no "Copy git branch" option. I am using the default prompt.

image

wagenet avatar Jun 21 '23 23:06 wagenet

I am also facing this issue. Not able to see the current branch in the terminal

Screenshot 2023-06-22 at 1 06 35 PM

adithyaakrishna avatar Jun 22 '23 07:06 adithyaakrishna

  1. I use zsh with warpify enabled zsh --version : zsh 5.9 (x86_64-apple-darwin22.0)
  2. The default prompt doesn't contain the git branch after upgrading to v0.2023.06.13.08.03.stable_03
  3. I don't have a .gitconfig
  4. Right-clicking the top of a block doesn't have the "copy git branch" option like it used to

terrisgit avatar Jun 22 '23 14:06 terrisgit

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_} %'

terrisgit avatar Jun 22 '23 14:06 terrisgit

The latest update broke it for me as well

filipminev avatar Jun 25 '23 12:06 filipminev

I'm also seeing the same issue, after the latest update

SHF-Tim avatar Jun 27 '23 17:06 SHF-Tim

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

FlorianTousch avatar Jun 28 '23 15:06 FlorianTousch

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.

edwincoronado avatar Jun 28 '23 17:06 edwincoronado

I agree that deleting the .zshrc file isn't the right solution.

dannyneira avatar Jun 28 '23 18:06 dannyneira

Having the same issue :( I really enjoyed this feature.

abartolo avatar Jun 29 '23 14:06 abartolo

@dannyneira Why would it have stopped working when it worked previously?

wagenet avatar Jun 30 '23 19:06 wagenet

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:

  1. How git was installed on your machine (if you can recall)
  2. 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!

charlespierce avatar Jun 30 '23 22:06 charlespierce

which -a git
/opt/homebrew/bin/git
/usr/bin/git

SHF-Tim avatar Jun 30 '23 23:06 SHF-Tim

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.

charlespierce avatar Jun 30 '23 23:06 charlespierce

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)")\$ '

goyalprashant avatar Jul 04 '23 05:07 goyalprashant

The newest update fixed this issue for me.

SHF-Tim avatar Jul 06 '23 21:07 SHF-Tim

The latest release also resolved it for me. Thanks!

wagenet avatar Jul 07 '23 00:07 wagenet

Excellent, glad to hear it! Thanks all for reporting and helping to debug 🚀

charlespierce avatar Jul 07 '23 00:07 charlespierce