agnoster / agnoster-zsh-theme

A ZSH theme designed to disclose information contextually, with a powerline aesthetic
3.95k stars 583 forks source link

Broken prompt after another oh-my-zsh upgrade #155

Closed jorotg closed 3 years ago

jorotg commented 3 years ago

After anothe oh-my-zsh upgrade my prompt is messed up:

/Users/alabala1/.oh-my-zsh/themes/agnoster.zsh-theme:97: parse error near `<<<' alabala1@ip-192-168-2-4 ~ %

prompt_context() {
<<<<<<< Updated upstream                                   < ---   line 97
  if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
=======
  if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
>>>>>>> Stashed changes
  fi
}

If I comment lines 97, 100 and 103 then I get: /Users/alabala1/.oh-my-zsh/themes/agnoster.zsh-theme:108: parse error near `prompt_git'

prompt_git() {     <-- line 108
  (( $+commands[git] )) || return
  if [[ "$(git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]]; then
    return
  fi
  local PL_BRANCH_CHAR
  () {
    local LC_ALL="" LC_CTYPE="en_US.UTF-8"
    PL_BRANCH_CHAR=$'\ue0a0'         # 
  }
  local ref dirty mode repo_path
HomyeeKing commented 3 years ago

same here, looks like git conflict not be handled

romanlex commented 3 years ago

same issue

tsterk commented 3 years ago

I've got the same issue here.

HaidongPang commented 3 years ago

It seems to be a CRLF error. Try this solution, it works.

cd $ZSH
git config core.autocrlf input
git rm --cached -r .
git reset --hard

Reference from: @sandyplus

mcornella commented 3 years ago

The agnoster theme in OMZ is not the same as this one. This should be an issue in OMZ, so you can close this one. Also, the proper way to make changes to a theme is to copy it in $ZSH_CUSTOM with the same name and modify it there: full info here.

Flexiboy commented 3 years ago

It seems to be a CRLF error. Try this solution, it works.

cd $ZSH
git config core.autocrlf input
git rm --cached -r .
git reset --hard

Reference from: @sandyplus

This worked partially for me. Yes it fixed the parse errors but I didn't got back the interface as you can see with the before/after screenshots below.

Before: Screen Shot 2021-04-14 at 6 36 31 PM After: Screen Shot 2021-04-14 at 6 36 43 PM