Skip to content

Update git-prompt.sh for Zsh Error #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions git-extra/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkgbase="mingw-w64-${_realname}"
pkgname=($_realname
"${MINGW_PACKAGE_PREFIX}-${_realname}")
_ver_base=1.1
pkgver=1.1.667.036188a82
pkgver=1.1.674.6bde10035
pkgrel=1
pkgdesc="Git for Windows extra files"
arch=('any')
Expand Down Expand Up @@ -74,7 +74,7 @@ sha256sums=('8ed76d1cb069ac8568f21c431f5e23caebea502d932ab4cdff71396f4f0d5b72'
'd212e1bbe75a9f81443126701324c9c44c3ed5750dd9822eba754a1799ed13b3'
'402c51eba82453a76f5110f4754bb1005df507a6e4532574c2b9627ff4e1dc81'
'8433a9e72b3bc9c3bc7903b54b868399bdb17a6c8de4af4dd5450dd42859c898'
'0a4d04eb5ce035f9b94ebad51f0fc366ffda1f384fa6e586e8eef140440fb012'
'48e7327ad51e6b31fde3287aec8df1ee6e312dee2211bee331a6297f61c438f9'
'8056f48ae61f2cba668c07b31c56229914912444ca6656205aaffce59b8e6b11'
'32c9a549ecb1c9e06622221dae98a000ac2ce9c2be97d5d0c4f80610af3dc55c'
'02d38e480a1ec4227e94a5aa073945901680aa3387e3386f8b77f10426ebbc75'
Expand Down
23 changes: 19 additions & 4 deletions git-extra/git-prompt.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh
newline='
'

if test -f /etc/profile.d/git-sdk.sh
then
TITLEPREFIX=SDK-${MSYSTEM#MINGW}
Expand Down Expand Up @@ -25,10 +29,21 @@ else
COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"
if test -f "$COMPLETION_PATH/git-prompt.sh"
then
. "$COMPLETION_PATH/git-completion.bash"
. "$COMPLETION_PATH/git-prompt.sh"
PS1="$PS1"'\[\033[36m\]' # change color to cyan
PS1="$PS1"'`__git_ps1`' # bash function
. "$COMPLETION_PATH/git-prompt.sh"
if test -n "$ZSH_VERSION" # Avoids zsh git-completion.bash Error.
then
# Assembles git prompt that closely resembles the default bash prompt.
precmd()
{
pre="${newline}%F{green}%n@%m%f %F{magenta}${MSYSTEM:-"ZSH"}%f %F{yellow}%~%f %F{cyan}"
post="%f${newline}$ "
__git_ps1 "${pre}" "${post}" "(%s)"
}
else
. "$COMPLETION_PATH/git-completion.bash"
PS1="$PS1"'\[\033[36m\]' # change color to cyan
PS1="$PS1"'`__git_ps1`' # bash function
fi
fi
fi
PS1="$PS1"'\[\033[0m\]' # change color
Expand Down
Loading