Skip to content
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

omz update raises "upgrade.sh:186: bad pattern: ^[[31m" #12430

Closed
MarArMar opened this issue May 18, 2024 · 9 comments
Closed

omz update raises "upgrade.sh:186: bad pattern: ^[[31m" #12430

MarArMar opened this issue May 18, 2024 · 9 comments
Assignees
Labels
Area: updater Update subsystem Resolution: not our issue Issue or pull request not related to Oh My Zsh

Comments

@MarArMar
Copy link

MarArMar commented May 18, 2024

Describe the bug

[oh-my-zsh] It's time to update! You can do that by running omz update

omz update

/.oh-my-zsh/tools/upgrade.sh:186: bad pattern: ^[[31m

Steps to reproduce

omz update

/.oh-my-zsh/tools/upgrade.sh:186: bad pattern: ^[[31m

Expected behavior

Works, updates omz

OS / Linux distribution

TUXEDO OS 2 ; KDE Plasma Version: 5.27.10 ; Kernel Version: 6.5.0-10036-tuxedo (64-bit)

Zsh version

5.8.1

Terminal emulator

Konsole

If using WSL on Windows, which version of WSL

None

Additional context

No response

@mcornella
Copy link
Member

Looks like this is hitting the printf call as if -m was passed. Can you run

/usr/bin/env zsh -xv $ZSH/tools/upgrade.sh

to debug and post the logs?

@mcornella mcornella added Area: updater Update subsystem Status: needs repro Bug that doesn't have a reproduction labels May 22, 2024
@MarArMar
Copy link
Author

MarArMar commented May 23, 2024

Thanks, here are the logs :

/usr/bin/env zsh -xv $ZSH/tools/upgrade.sh
# /etc/zsh/zshenv: system-wide .zshenv file for zsh(1).
#
# This file is sourced on all invocations of the shell.
# If the -f flag is present or if the NO_RCS option is
# set within this file, all other initialization files
# are skipped.
#
# This file should contain commands to set the command
# search path, plus other important environment variables.
# This file should not contain commands that produce
# output or assume the shell is attached to a tty.
#
# Global Order: zshenv, zprofile, zshrc, zlogin

# Original path: etc/zsh/zshenv

if [[ -z "$PATH" || "$PATH" == "/bin:/usr/bin" ]]; then
  export PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi
+/etc/zsh/zshenv:17> [[ -z /home/me/.pyenv/shims:/home/me/.pyenv/bin:/home/me/.local/bin:/home/me/.bun/bin:/home/me/.pyenv/bin:/home/me/.local/bin:/home/me/.bun/bin:/home/me/.local/share/pnpm:/home/me/.nvm/versions/node/v20.13.1/bin:/tmp/.mount_cursorpPypR9:/tmp/.mount_cursorpPypR9/usr/sbin:/home/me/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin || /home/me/.pyenv/shims:/home/me/.pyenv/bin:/home/me/.local/bin:/home/me/.bun/bin:/home/me/.pyenv/bin:/home/me/.local/bin:/home/me/.bun/bin:/home/me/.local/share/pnpm:/home/me/.nvm/versions/node/v20.13.1/bin:/tmp/.mount_cursorpPypR9:/tmp/.mount_cursorpPypR9/usr/sbin:/home/me/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin == /bin:/usr/bin ]]

#~~ MY EDITS ~~#
# My Log level
# 0: Trace
# 1: Debug
# 2: Info
# 3: Warnings
# 4: Errors
# 5: Critical
export KIT_LOG_LEVEL=1
+/etc/zsh/zshenv:29> export KIT_LOG_LEVEL=1
#~~ END OF MY EDITS ~~#
. "$HOME/.cargo/env"
+/home/me/.zshenv:1> . /home/me/.cargo/env
#!/bin/sh
# rustup shell setup
# affix colons on either side of $PATH to simplify matching
case ":${PATH}:" in
    *:"$HOME/.cargo/bin":*)
        ;;
    *)
        # Prepending path in case a system-installed rustc needs to be overridden
        export PATH="$HOME/.cargo/bin:$PATH"
        ;;
esac
+/home/me/.cargo/env:4> case :/home/me/.pyenv/shims:/home/me/.pyenv/bin:/home/me/.local/bin:/home/me/.bun/bin:/home/me/.pyenv/bin:/home/me/.local/bin:/home/me/.bun/bin:/home/me/.local/share/pnpm:/home/me/.nvm/versions/node/v20.13.1/bin:/tmp/.mount_cursorpPypR9:/tmp/.mount_cursorpPypR9/usr/sbin:/home/me/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: (*:/home/me/.cargo/bin:*)
#!/usr/bin/env zsh
set +u # disable nounset
+/home/me/.oh-my-zsh/tools/upgrade.sh:2> set +u

local ret=0 # exit code
+/home/me/.oh-my-zsh/tools/upgrade.sh:4> local ret=0

# Protect against running with shells other than zsh
if [ -z "$ZSH_VERSION" ]; then
  exec zsh "$0" "$@"
fi
+/home/me/.oh-my-zsh/tools/upgrade.sh:7> [ -z 5.8.1 ']'

# Protect against unwanted sourcing
case "$ZSH_EVAL_CONTEXT" in
  *:file) echo "error: this file should not be sourced" && return 1 ;;
esac
+/home/me/.oh-my-zsh/tools/upgrade.sh:12> case toplevel (*:file)

# Define "$ZSH" if not defined -- in theory this should be `export`ed by the calling script
if [[ -z "$ZSH" ]]; then
  ZSH="${0:a:h:h}"
fi
+/home/me/.oh-my-zsh/tools/upgrade.sh:17> [[ -z /home/me/.oh-my-zsh ]]

cd "$ZSH"
+/home/me/.oh-my-zsh/tools/upgrade.sh:21> cd /home/me/.oh-my-zsh

verbose_mode="default"
+/home/me/.oh-my-zsh/tools/upgrade.sh:23> verbose_mode=default 
interactive=false
+/home/me/.oh-my-zsh/tools/upgrade.sh:24> interactive=false 

while getopts "v:i" opt; do
  case $opt in
    v)
      if [[ $OPTARG == default || $OPTARG == minimal || $OPTARG == silent ]]; then
        verbose_mode=$OPTARG
      else
        echo "[oh-my-zsh] update verbosity '$OPTARG' is not valid"
        echo "[oh-my-zsh] valid options are 'default', 'minimal' and 'silent'"
      fi
      ;;
    i) interactive=true ;;
  esac
done
+/home/me/.oh-my-zsh/tools/upgrade.sh:26> getopts v:i opt

# Use colors, but only if connected to a terminal
# and that terminal supports them.

# The [ -t 1 ] check only works when the function is not called from
# a subshell (like in `$(...)` or `(...)`, so this hack redefines the
# function at the top level to always return false when stdout is not
# a tty.
if [ -t 1 ]; then
  is_tty() {
    true
  }
else
  is_tty() {
    false
  }
fi
+/home/me/.oh-my-zsh/tools/upgrade.sh:47> [ -t 1 ']'

# This function uses the logic from supports-hyperlinks[1][2], which is
# made by Kat Marchán (@zkat) and licensed under the Apache License 2.0.
# [1] https://github.com/zkat/supports-hyperlinks
# [2] https://crates.io/crates/supports-hyperlinks
#
# Copyright (c) 2021 Kat Marchán
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
supports_hyperlinks() {
  # $FORCE_HYPERLINK must be set and be non-zero (this acts as a logic bypass)
  if [ -n "$FORCE_HYPERLINK" ]; then
    [ "$FORCE_HYPERLINK" != 0 ]
    return $?
  fi

  # If stdout is not a tty, it doesn't support hyperlinks
  is_tty || return 1

  # DomTerm terminal emulator (domterm.org)
  if [ -n "$DOMTERM" ]; then
    return 0
  fi

  # VTE-based terminals above v0.50 (Gnome Terminal, Guake, ROXTerm, etc)
  if [ -n "$VTE_VERSION" ]; then
    [ $VTE_VERSION -ge 5000 ]
    return $?
  fi

  # If $TERM_PROGRAM is set, these terminals support hyperlinks
  case "$TERM_PROGRAM" in
  Hyper|iTerm.app|terminology|WezTerm|vscode) return 0 ;;
  esac

  # These termcap entries support hyperlinks
  case "$TERM" in
  xterm-kitty|alacritty|alacritty-direct) return 0 ;;
  esac

  # xfce4-terminal supports hyperlinks
  if [ "$COLORTERM" = "xfce4-terminal" ]; then
    return 0
  fi

  # Windows Terminal also supports hyperlinks
  if [ -n "$WT_SESSION" ]; then
    return 0
  fi

  # Konsole supports hyperlinks, but it's an opt-in setting that can't be detected
  # https://github.com/ohmyzsh/ohmyzsh/issues/10964
  # if [ -n "$KONSOLE_VERSION" ]; then
  #   return 0
  # fi

  return 1
}

# Adapted from code and information by Anton Kochkov (@XVilka)
# Source: https://gist.github.com/XVilka/8346728
supports_truecolor() {
  case "$COLORTERM" in
  truecolor|24bit) return 0 ;;
  esac

  case "$TERM" in
  iterm           |\
  tmux-truecolor  |\
  linux-truecolor |\
  xterm-truecolor |\
  screen-truecolor) return 0 ;;
  esac

  return 1
}

fmt_link() {
  # $1: text, $2: url, $3: fallback mode
  if supports_hyperlinks; then
    printf '\033]8;;%s\033\\%s\033]8;;\033\\\n' "$2" "$1"
    return
  fi

  case "$3" in
  --text) printf '%s\n' "$1" ;;
  --url|*) fmt_underline "$2" ;;
  esac
}

fmt_underline() {
  is_tty && printf '\033[4m%s\033[24m\n' "$*" || printf '%s\n' "$*"
}

setopt typeset_silent
+/home/me/.oh-my-zsh/tools/upgrade.sh:160> setopt typeset_silent
typeset -a RAINBOW
+/home/me/.oh-my-zsh/tools/upgrade.sh:161> typeset -a RAINBOW

if is_tty; then
  if supports_truecolor; then
    RAINBOW=(
      "$(printf '\033[38;2;255;0;0m')"
      "$(printf '\033[38;2;255;97;0m')"
      "$(printf '\033[38;2;247;255;0m')"
      "$(printf '\033[38;2;0;255;30m')"
      "$(printf '\033[38;2;77;0;255m')"
      "$(printf '\033[38;2;168;0;255m')"
      "$(printf '\033[38;2;245;0;172m')"
    )
  else
    RAINBOW=(
      "$(printf '\033[38;5;196m')"
      "$(printf '\033[38;5;202m')"
      "$(printf '\033[38;5;226m')"
      "$(printf '\033[38;5;082m')"
      "$(printf '\033[38;5;021m')"
      "$(printf '\033[38;5;093m')"
      "$(printf '\033[38;5;163m')"
    )
  fi

  RED=$(printf '\033[31m')
  GREEN=$(printf '\033[32m')
  YELLOW=$(printf '\033[33m')
  BLUE=$(printf '\033[34m')
  BOLD=$(printf '\033[1m')
  RESET=$(printf '\033[0m')
fi
+/home/me/.oh-my-zsh/tools/upgrade.sh:163> is_tty
+is_tty:1> true
+/home/me/.oh-my-zsh/tools/upgrade.sh:164> supports_truecolor
+supports_truecolor:1> case truecolor (truecolor)
+supports_truecolor:2> return 0
+/home/me/.oh-my-zsh/tools/upgrade.sh:165> RAINBOW=+/home/me/.oh-my-zsh/tools/upgrade.sh:165> printf '\033[38;2;255;0;0m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:165> RAINBOW=+/home/me/.oh-my-zsh/tools/upgrade.sh:165> printf '\033[38;2;255;97;0m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:165> RAINBOW=+/home/me/.oh-my-zsh/tools/upgrade.sh:165> printf '\033[38;2;247;255;0m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:165> RAINBOW=+/home/me/.oh-my-zsh/tools/upgrade.sh:165> printf '\033[38;2;0;255;30m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:165> RAINBOW=+/home/me/.oh-my-zsh/tools/upgrade.sh:165> printf '\033[38;2;77;0;255m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:165> RAINBOW=+/home/me/.oh-my-zsh/tools/upgrade.sh:165> printf '\033[38;2;168;0;255m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:165> RAINBOW=+/home/me/.oh-my-zsh/tools/upgrade.sh:165> printf '\033[38;2;245;0;172m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:165> RAINBOW=( $'\C-[[38;2;255;0;0m' $'\C-[[38;2;255;97;0m' $'\C-[[38;2;247;255;0m' $'\C-[[38;2;0;255;30m' $'\C-[[38;2;77;0;255m' $'\C-[[38;2;168;0;255m' $'\C-[[38;2;245;0;172m' ) 
+/home/me/.oh-my-zsh/tools/upgrade.sh:186> RED=+/home/me/.oh-my-zsh/tools/upgrade.sh:186> printf '\033[31m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:186> RED=$'\C-[[31m' 
+/home/me/.oh-my-zsh/tools/upgrade.sh:187> GREEN=+/home/me/.oh-my-zsh/tools/upgrade.sh:187> printf '\033[32m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:187> GREEN=$'\C-[[32m' 
+/home/me/.oh-my-zsh/tools/upgrade.sh:188> YELLOW=+/home/me/.oh-my-zsh/tools/upgrade.sh:188> printf '\033[33m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:188> YELLOW=$'\C-[[33m' 
+/home/me/.oh-my-zsh/tools/upgrade.sh:189> BLUE=+/home/me/.oh-my-zsh/tools/upgrade.sh:189> printf '\033[34m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:189> BLUE=$'\C-[[34m' 
+/home/me/.oh-my-zsh/tools/upgrade.sh:190> BOLD=+/home/me/.oh-my-zsh/tools/upgrade.sh:190> printf '\033[1m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:190> BOLD=$'\C-[[1m' 
+/home/me/.oh-my-zsh/tools/upgrade.sh:191> RESET=+/home/me/.oh-my-zsh/tools/upgrade.sh:191> printf '\033[0m'
+/home/me/.oh-my-zsh/tools/upgrade.sh:191> RESET=$'\C-[[0m' 

# Update upstream remote to ohmyzsh org
git remote -v | while read remote url extra; do
  case "$url" in
  git://github.com/robbyrussell/oh-my-zsh(|.git))
    # Update out-of-date "unauthenticated git protocol on port 9418" to https
    git remote set-url "$remote" "https://github.com/ohmyzsh/ohmyzsh.git" ;;
  https://github.com/robbyrussell/oh-my-zsh(|.git))
    git remote set-url "$remote" "https://github.com/ohmyzsh/ohmyzsh.git" ;;
  git@github.com:robbyrussell/oh-my-zsh(|.git))
    git remote set-url "$remote" "git@github.com:ohmyzsh/ohmyzsh.git" ;;
  https://github.com/ohmyzsh/ohmyzsh(|.git)) ;;
  git@github.com:ohmyzsh/ohmyzsh(|.git)) ;;
  *) continue ;;
  esac

  # If we reach this point we have found the proper ohmyzsh upstream remote. If we don't,
  # we'll only update from the set remote if `oh-my-zsh.remote` has been set to a remote,
  # as when installing from a fork.
  git config --local oh-my-zsh.remote "$remote"
  break
done
+/home/me/.oh-my-zsh/tools/upgrade.sh:195> read remote url extra
+/home/me/.oh-my-zsh/tools/upgrade.sh:195> git remote -v
+/home/me/.oh-my-zsh/tools/upgrade.sh:196> case https://github.com/ohmyzsh/ohmyzsh.git (git://github.com/robbyrussell/oh-my-zsh(|.git))
+/home/me/.oh-my-zsh/tools/upgrade.sh:196> case https://github.com/ohmyzsh/ohmyzsh.git (https://github.com/robbyrussell/oh-my-zsh(|.git))
+/home/me/.oh-my-zsh/tools/upgrade.sh:196> case https://github.com/ohmyzsh/ohmyzsh.git (git@github.com:robbyrussell/oh-my-zsh(|.git))
+/home/me/.oh-my-zsh/tools/upgrade.sh:196> case https://github.com/ohmyzsh/ohmyzsh.git (https://github.com/ohmyzsh/ohmyzsh(|.git))
+/home/me/.oh-my-zsh/tools/upgrade.sh:212> git config --local oh-my-zsh.remote origin
+/home/me/.oh-my-zsh/tools/upgrade.sh:213> break

# Set git-config values known to fix git errors
# Line endings (#4069)
git config core.eol lf
+/home/me/.oh-my-zsh/tools/upgrade.sh:218> git config core.eol lf
git config core.autocrlf false
+/home/me/.oh-my-zsh/tools/upgrade.sh:219> git config core.autocrlf false
# zeroPaddedFilemode fsck errors (#4963)
git config fsck.zeroPaddedFilemode ignore
+/home/me/.oh-my-zsh/tools/upgrade.sh:221> git config fsck.zeroPaddedFilemode ignore
git config fetch.fsck.zeroPaddedFilemode ignore
+/home/me/.oh-my-zsh/tools/upgrade.sh:222> git config fetch.fsck.zeroPaddedFilemode ignore
git config receive.fsck.zeroPaddedFilemode ignore
+/home/me/.oh-my-zsh/tools/upgrade.sh:223> git config receive.fsck.zeroPaddedFilemode ignore
# autostash on rebase (#7172)
resetAutoStash=$(git config --bool rebase.autoStash 2>/dev/null)
+/home/me/.oh-my-zsh/tools/upgrade.sh:225> resetAutoStash=+/home/me/.oh-my-zsh/tools/upgrade.sh:225> git config --bool rebase.autoStash
+/home/me/.oh-my-zsh/tools/upgrade.sh:225> resetAutoStash='' 
git config rebase.autoStash true
+/home/me/.oh-my-zsh/tools/upgrade.sh:226> git config rebase.autoStash true

local ret=0
+/home/me/.oh-my-zsh/tools/upgrade.sh:228> local ret=0

# repository settings
remote=${"$(git config --local oh-my-zsh.remote)":-origin}
+/home/me/.oh-my-zsh/tools/upgrade.sh:231> remote=+/home/me/.oh-my-zsh/tools/upgrade.sh:231> git config --local oh-my-zsh.remote
+/home/me/.oh-my-zsh/tools/upgrade.sh:231> remote=origin 
branch=${"$(git config --local oh-my-zsh.branch)":-master}
+/home/me/.oh-my-zsh/tools/upgrade.sh:232> branch=+/home/me/.oh-my-zsh/tools/upgrade.sh:232> git config --local oh-my-zsh.branch
+/home/me/.oh-my-zsh/tools/upgrade.sh:232> branch=master 

# repository state
last_head=$(git symbolic-ref --quiet --short HEAD || git rev-parse HEAD)
+/home/me/.oh-my-zsh/tools/upgrade.sh:235> last_head=+/home/me/.oh-my-zsh/tools/upgrade.sh:235> git symbolic-ref --quiet --short HEAD
+/home/me/.oh-my-zsh/tools/upgrade.sh:235> last_head=master 
# checkout update branch
git checkout -q "$branch" -- || exit 1
+/home/me/.oh-my-zsh/tools/upgrade.sh:237> git checkout -q master --
# branch commit before update (used in changelog)
last_commit=$(git rev-parse "$branch")
+/home/me/.oh-my-zsh/tools/upgrade.sh:239> last_commit=+/home/me/.oh-my-zsh/tools/upgrade.sh:239> git rev-parse master
+/home/me/.oh-my-zsh/tools/upgrade.sh:239> last_commit=a779d6563ffb2f0093b4b74c8d5ff0982fa3e930 

# Update Oh My Zsh
if [[ $verbose_mode != silent ]]; then
  printf "${BLUE}%s${RESET}\n" "Updating Oh My Zsh"
fi
+/home/me/.oh-my-zsh/tools/upgrade.sh:242> [[ default != silent ]]
+/home/me/.oh-my-zsh/tools/upgrade.sh:243> printf $'\C-[[34m%s\C-[[0m\\n' 'Updating Oh My Zsh'
Updating Oh My Zsh
if LANG= git pull --quiet --rebase $remote $branch; then
  # Check if it was really updated or not
  if [[ "$(git rev-parse HEAD)" = "$last_commit" ]]; then
    message="Oh My Zsh is already at the latest version."
  else
    message="Hooray! Oh My Zsh has been updated!"

    # Save the commit prior to updating
    git config oh-my-zsh.lastVersion "$last_commit"

    # Print changelog to the terminal
    if [[ $interactive == true && $verbose_mode == default ]]; then
      "$ZSH/tools/changelog.sh" HEAD "$last_commit"
    fi

    if [[ $verbose_mode != silent ]]; then
      printf "${BLUE}%s \`${BOLD}%s${RESET}${BLUE}\`${RESET}\n" "You can see the changelog with" "omz changelog"
    fi
  fi

  if [[ $verbose_mode == default ]]; then
    printf '%s         %s__      %s           %s        %s       %s     %s__   %s\n'      $RAINBOW $RESET
    printf '%s  ____  %s/ /_    %s ____ ___  %s__  __  %s ____  %s_____%s/ /_  %s\n'      $RAINBOW $RESET
    printf '%s / __ \\%s/ __ \\  %s / __ `__ \\%s/ / / / %s /_  / %s/ ___/%s __ \\ %s\n'  $RAINBOW $RESET
    printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s   / /_%s(__  )%s / / / %s\n'      $RAINBOW $RESET
    printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s   /___/%s____/%s_/ /_/  %s\n'    $RAINBOW $RESET
    printf '%s    %s        %s           %s /____/ %s       %s     %s          %s\n'      $RAINBOW $RESET
    printf '\n'
    printf "${BLUE}%s${RESET}\n\n" "$message"
    printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on Twitter:" "$(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)"
    printf "${BLUE}${BOLD}%s %s${RESET}\n" "Want to get involved in the community? Join our Discord:" "$(fmt_link "Discord server" https://discord.gg/ohmyzsh)"
    printf "${BLUE}${BOLD}%s %s${RESET}\n" "Get your Oh My Zsh swag at:" "$(fmt_link "Planet Argon Shop" https://shop.planetargon.com/collections/oh-my-zsh)"
  elif [[ $verbose_mode == minimal ]]; then
    printf "${BLUE}%s${RESET}\n" "$message"
  fi
else
  ret=$?
  printf "${RED}%s${RESET}\n" 'There was an error updating. Try again later?'
fi
+/home/me/.oh-my-zsh/tools/upgrade.sh:245> LANG='' git pull --quiet --rebase origin master
+/home/me/.oh-my-zsh/tools/upgrade.sh:247> [[+/home/me/.oh-my-zsh/tools/upgrade.sh:247> git rev-parse HEAD
+/home/me/.oh-my-zsh/tools/upgrade.sh:247> [[ 203369b0f9ec284e06b73f555a14fa5f02be5a0a = a779d6563ffb2f0093b4b74c8d5ff0982fa3e930 ]]
+/home/me/.oh-my-zsh/tools/upgrade.sh:250> message='Hooray! Oh My Zsh has been updated!' 
+/home/me/.oh-my-zsh/tools/upgrade.sh:253> git config oh-my-zsh.lastVersion a779d6563ffb2f0093b4b74c8d5ff0982fa3e930
+/home/me/.oh-my-zsh/tools/upgrade.sh:256> [[ false == true ]]
+/home/me/.oh-my-zsh/tools/upgrade.sh:260> [[ default != silent ]]
+/home/me/.oh-my-zsh/tools/upgrade.sh:261> printf $'\C-[[34m%s `\C-[[1m%s\C-[[0m\C-[[34m`\C-[[0m\\n' 'You can see the changelog with' 'omz changelog'
You can see the changelog with `omz changelog`
+/home/me/.oh-my-zsh/tools/upgrade.sh:265> [[ default == default ]]
+/home/me/.oh-my-zsh/tools/upgrade.sh:266> printf '%s         %s__      %s           %s        %s       %s     %s__   %s\n' $'\C-[[38;2;255;0;0m' $'\C-[[38;2;255;97;0m' $'\C-[[38;2;247;255;0m' $'\C-[[38;2;0;255;30m' $'\C-[[38;2;77;0;255m' $'\C-[[38;2;168;0;255m' $'\C-[[38;2;245;0;172m' $'\C-[[0m'
         __                                     __   
+/home/me/.oh-my-zsh/tools/upgrade.sh:267> printf '%s  ____  %s/ /_    %s ____ ___  %s__  __  %s ____  %s_____%s/ /_  %s\n' $'\C-[[38;2;255;0;0m' $'\C-[[38;2;255;97;0m' $'\C-[[38;2;247;255;0m' $'\C-[[38;2;0;255;30m' $'\C-[[38;2;77;0;255m' $'\C-[[38;2;168;0;255m' $'\C-[[38;2;245;0;172m' $'\C-[[0m'
  ____  / /_     ____ ___  __  __   ____  _____/ /_  
+/home/me/.oh-my-zsh/tools/upgrade.sh:268> printf '%s / __ \\%s/ __ \\  %s / __ `__ \\%s/ / / / %s /_  / %s/ ___/%s __ \\ %s\n' $'\C-[[38;2;255;0;0m' $'\C-[[38;2;255;97;0m' $'\C-[[38;2;247;255;0m' $'\C-[[38;2;0;255;30m' $'\C-[[38;2;77;0;255m' $'\C-[[38;2;168;0;255m' $'\C-[[38;2;245;0;172m' $'\C-[[0m'
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ 
+/home/me/.oh-my-zsh/tools/upgrade.sh:269> printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s   / /_%s(__  )%s / / / %s\n' $'\C-[[38;2;255;0;0m' $'\C-[[38;2;255;97;0m' $'\C-[[38;2;247;255;0m' $'\C-[[38;2;0;255;30m' $'\C-[[38;2;77;0;255m' $'\C-[[38;2;168;0;255m' $'\C-[[38;2;245;0;172m' $'\C-[[0m'
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / 
+/home/me/.oh-my-zsh/tools/upgrade.sh:270> printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s   /___/%s____/%s_/ /_/  %s\n' $'\C-[[38;2;255;0;0m' $'\C-[[38;2;255;97;0m' $'\C-[[38;2;247;255;0m' $'\C-[[38;2;0;255;30m' $'\C-[[38;2;77;0;255m' $'\C-[[38;2;168;0;255m' $'\C-[[38;2;245;0;172m' $'\C-[[0m'
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  
+/home/me/.oh-my-zsh/tools/upgrade.sh:271> printf '%s    %s        %s           %s /____/ %s       %s     %s          %s\n' $'\C-[[38;2;255;0;0m' $'\C-[[38;2;255;97;0m' $'\C-[[38;2;247;255;0m' $'\C-[[38;2;0;255;30m' $'\C-[[38;2;77;0;255m' $'\C-[[38;2;168;0;255m' $'\C-[[38;2;245;0;172m' $'\C-[[0m'
                        /____/                       
+/home/me/.oh-my-zsh/tools/upgrade.sh:272> printf '\n'

+/home/me/.oh-my-zsh/tools/upgrade.sh:273> printf $'\C-[[34m%s\C-[[0m\\n\\n' 'Hooray! Oh My Zsh has been updated!'
Hooray! Oh My Zsh has been updated!

+/home/me/.oh-my-zsh/tools/upgrade.sh:274> fmt_link @ohmyzsh https://twitter.com/ohmyzsh
+fmt_link:2> supports_hyperlinks
+supports_hyperlinks:2> [ -n '' ']'
+supports_hyperlinks:8> is_tty
+is_tty:1> true
+supports_hyperlinks:11> [ -n '' ']'
+supports_hyperlinks:16> [ -n '' ']'
+supports_hyperlinks:22> case vscode (Hyper | iTerm.app | terminology | WezTerm | vscode)
+supports_hyperlinks:23> return 0
+fmt_link:3> printf '\033]8;;%s\033\\%s\033]8;;\033\\\n' https://twitter.com/ohmyzsh @ohmyzsh
+fmt_link:4> return
+/home/me/.oh-my-zsh/tools/upgrade.sh:274> printf $'\C-[[34m\C-[[1m%s %s\C-[[0m\\n' 'To keep up with the latest news and updates, follow us on Twitter:' $'\C-[]8;;https://twitter.com/ohmyzsh\C-[\\@ohmyzsh\C-[]8;;\C-[\\'
To keep up with the latest news and updates, follow us on Twitter: @ohmyzsh
+/home/me/.oh-my-zsh/tools/upgrade.sh:275> fmt_link 'Discord server' https://discord.gg/ohmyzsh
+fmt_link:2> supports_hyperlinks
+supports_hyperlinks:2> [ -n '' ']'
+supports_hyperlinks:8> is_tty
+is_tty:1> true
+supports_hyperlinks:11> [ -n '' ']'
+supports_hyperlinks:16> [ -n '' ']'
+supports_hyperlinks:22> case vscode (Hyper | iTerm.app | terminology | WezTerm | vscode)
+supports_hyperlinks:23> return 0
+fmt_link:3> printf '\033]8;;%s\033\\%s\033]8;;\033\\\n' https://discord.gg/ohmyzsh 'Discord server'
+fmt_link:4> return
+/home/me/.oh-my-zsh/tools/upgrade.sh:275> printf $'\C-[[34m\C-[[1m%s %s\C-[[0m\\n' 'Want to get involved in the community? Join our Discord:' $'\C-[]8;;https://discord.gg/ohmyzsh\C-[\\Discord server\C-[]8;;\C-[\\'
Want to get involved in the community? Join our Discord: Discord server
+/home/me/.oh-my-zsh/tools/upgrade.sh:276> fmt_link 'Planet Argon Shop' https://shop.planetargon.com/collections/oh-my-zsh
+fmt_link:2> supports_hyperlinks
+supports_hyperlinks:2> [ -n '' ']'
+supports_hyperlinks:8> is_tty
+is_tty:1> true
+supports_hyperlinks:11> [ -n '' ']'
+supports_hyperlinks:16> [ -n '' ']'
+supports_hyperlinks:22> case vscode (Hyper | iTerm.app | terminology | WezTerm | vscode)
+supports_hyperlinks:23> return 0
+fmt_link:3> printf '\033]8;;%s\033\\%s\033]8;;\033\\\n' https://shop.planetargon.com/collections/oh-my-zsh 'Planet Argon Shop'
+fmt_link:4> return
+/home/me/.oh-my-zsh/tools/upgrade.sh:276> printf $'\C-[[34m\C-[[1m%s %s\C-[[0m\\n' 'Get your Oh My Zsh swag at:' $'\C-[]8;;https://shop.planetargon.com/collections/oh-my-zsh\C-[\\Planet Argon Shop\C-[]8;;\C-[\\'
Get your Oh My Zsh swag at: Planet Argon Shop

# go back to HEAD previous to update
git checkout -q "$last_head" --
+/home/me/.oh-my-zsh/tools/upgrade.sh:286> git checkout -q master --

# Unset git-config values set just for the upgrade
case "$resetAutoStash" in
  "") git config --unset rebase.autoStash ;;
  *) git config rebase.autoStash "$resetAutoStash" ;;
esac
+/home/me/.oh-my-zsh/tools/upgrade.sh:289> case  ()
+/home/me/.oh-my-zsh/tools/upgrade.sh:290> git config --unset rebase.autoStash

# Exit with `1` if the update failed
exit $ret
+/home/me/.oh-my-zsh/tools/upgrade.sh:295> exit 0

Exit seems to be 0 so maybe your command worked

@mcornella
Copy link
Member

That doesn't have the issue, wait, I see the CLI uses a different command, let's try:

set -xv; omz update; set +xv

@MarArMar
Copy link
Author

Result :

❯ set -xv; omz update; set +xv
+/usr/bin/zsh:65> omz update
+omz:1> [[ 1 -gt 0 ]]
+omz:6> local command=update
+omz:7> shift
+omz:11> ((  1  ))
+omz:16> _omz::update
+_omz::update:2> ((  1  ))
+_omz::update:7> cd -q /home/me/.oh-my-zsh
+_omz::update:7> /opt/cursor.appimage rev-parse HEAD
+_omz::update:7> local last_commit=203369b0f9ec284e06b73f555a14fa5f02be5a0a
+_omz::update:8> [[ 0 -eq 0 ]]
+_omz::update:14> zstyle -s :omz:update verbose verbose_mode
+_omz::update:14> verbose_mode=default 
+_omz::update:15> [[ '' != --unattended ]]
+_omz::update:16> ZSH=/home/me/.oh-my-zsh /opt/cursor.appimage -f /home/me/.oh-my-zsh/tools/upgrade.sh -i -v default
/home/me/.oh-my-zsh/tools/upgrade.sh:186: bad pattern: ^[[31m
+_omz::update:16> return 1
+/usr/bin/zsh:65> set +xv

@mcornella
Copy link
Member

Do you have command aliased to /opt/cursor.appimage? If so, what is that and why?

@mcornella
Copy link
Member

OK no, it looks like both git and zsh direct to /opt/cursor.appimage for some reason, you should check why that is.

@mcornella mcornella added Resolution: not our issue Issue or pull request not related to Oh My Zsh and removed Status: needs repro Bug that doesn't have a reproduction labels May 25, 2024
@MarArMar
Copy link
Author

MarArMar commented May 25, 2024

I have installed the cursor IDE and I run my commands in it on Linux

It is installed as an appimage. Cursor is a VSCode Fork

https://cursor.sh/

@carlosala
Copy link
Member

Make sure you don't have any alias/function/whatever redefining git and zsh command. Does that happen as well in a regular terminal, not inside cursor? In case it doesn't happen outside of cursor, open an issue to them since it'll for sure be their issue.
Thanks for the report!

@carlosala carlosala closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
@MarArMar
Copy link
Author

MarArMar commented May 31, 2024

Ok indeed in regular terminal it worked ! Thanks

Hooray! Oh My Zsh has been updated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: updater Update subsystem Resolution: not our issue Issue or pull request not related to Oh My Zsh
Projects
Archived in project
Development

No branches or pull requests

3 participants