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

Not showing any icon, even git branch name is not showing #1356

Open
FaisalBudiono opened this issue May 15, 2023 · 9 comments
Open

Not showing any icon, even git branch name is not showing #1356

FaisalBudiono opened this issue May 15, 2023 · 9 comments
Labels
bug Bug related to code base, behavior, displaying, etc.

Comments

@FaisalBudiono
Copy link

The problem

image
Up there, it should show the branch name and the git icon.

image
And here, it should show the docker icon

Relevant Zsh configuration

REAL_ZSHRC_PATH=$(ls -l $HOME/.zshrc | awk '{print $11}')
ZSH_CONFIG_PATH=${REAL_ZSHRC_PATH%/*}

export ZSH="$HOME/.oh-my-zsh"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

ZSH_THEME="spaceship"

plugins=(
  git
)

source $ZSH/oh-my-zsh.sh

alias -g cchown="sudo chown -R ucul:ucul"
alias -g cde="docker exec -ti"
alias -g cgbn="git branch --show-current"
alias -g cgca="git commit --amend"
alias -g cgd="git branch -d"
alias -g cgD="git branch -D"
alias -g cgdgone="git branch -vv | awk '/: gone\]/{print \$1}' | xargs git branch -d"
alias -g cgf="git fetch --all --prune"
alias -g cgg="git log --oneline --pretty=oneline --graph"
alias -g cggv="git log --pretty=full --graph"
alias -g cggvv="git log --pretty=fuller --graph"
alias -g cgpru="cgprune"
alias -g cgprune="git remote prune origin"
alias -g cgri="git rebase --rebase-merges -i"
alias -g cgrm="git rebase --rebase-merges"
alias -g cl="clear"

# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
  local node_version="$(nvm version)"
  local nvmrc_path="$(nvm_find_nvmrc)"

  if [ -n "$nvmrc_path" ]; then
    local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")

    if [ "$nvmrc_node_version" = "N/A" ]; then
      nvm install
    elif [ "$nvmrc_node_version" != "$node_version" ]; then
      nvm use
    fi
  elif [ "$node_version" != "$(nvm version default)" ]; then
    echo "Reverting to nvm default version"
    nvm use default
  fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc

# ZSH Plugin
source $HOME/antigen.zsh

antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-history-substring-search
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle jeffreytse/zsh-vi-mode

antigen apply

# Fix ZSH vi-mode change to NORMAL mode delay
#export KEYTIMEOUT=1
#set timeoutlen=1000
#set ttimeoutlen=50
set noesckeys


export FZF_DEFAULT_COMMAND="find -L"

keep_current_path() {
  printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"
}
precmd_functions+=(keep_current_path)

# This is specific to WSL 2. If the WSL 2 VM goes rogue and decides not to free
# up memory, this command will free your memory after about 20-30 seconds.
#   Details: https://github.com/microsoft/WSL/issues/4166#issuecomment-628493643
alias -g wslrefresh="sudo sh -c \"echo 3 >'/proc/sys/vm/drop_caches' && swapoff -a && swapon -a && printf '\n%s\n' 'Ram-cache and Swap Cleared'\""

function ccopy {
  $@ | clip.exe
}

What is version of Spaceship are you using?

v4.13.5

What is version of Zsh are you using?

zsh 5.8 (x86_64-ubuntu-linux-gnu)

What operation system are you running?

WSL Ubuntu 20.04

Do you use any Zsh framework or plugin manager?

No response

Which terminal emulator do you use?

Windows Terminal

Additional information

No response

@FaisalBudiono FaisalBudiono added the bug Bug related to code base, behavior, displaying, etc. label May 15, 2023
@FaisalBudiono
Copy link
Author

FaisalBudiono commented May 15, 2023

I'm going back using v3.12.0 and it works properly again

image
image


I just read about the v4 announcement (https://spaceship-prompt.sh/blog/2022-spaceship-v4/#Easier-configuration) and I just realized the ... is just a placeholder for the async function that was introduced by v4. My assumption is that the windows terminal cannot handle the async function

@ZUNZET17
Copy link

I'm having the same issue as well. How To set the behavior to stop using Async if that is what's causing the problem.

@FaisalBudiono
Copy link
Author

FaisalBudiono commented Jun 7, 2023

I'm having the same issue as well. How To set the behavior to stop using Async if that is what's causing the problem.

You can put this on your .zshrc

SPACESHIP_PROMPT_ASYNC=false

For further reading, you can see #1193

@yunsii
Copy link

yunsii commented Jun 13, 2023

I'm having the same issue as well. How To set the behavior to stop using Async if that is what's causing the problem.

You can put this on your .zshrc

SPACESHIP_PROMPT_ASYNC=false

For further reading, you can see #1193

At least it solved the problem

@FaisalBudiono
Copy link
Author

Guys I tried using #1193 (comment) for solving this issue and it works! Just need the maintener to fix it in the repo itself. But for now this is the workaround

@kal40
Copy link

kal40 commented Oct 8, 2023

I'm using wsl2 under windows and I have the same issue. If I disable the async prompt then the rendering is getting too slow that makes it unusable for me.

@FaisalBudiono
Copy link
Author

@kal40 if you want, you can use the fix from #1193 (comment) for now. At least the async will work on WSL2.

The PR for this (#1402) it's still on hold since we need to wait the zsh-async PR to be merged

@Alex-Space
Copy link

@kal40 if you want, you can use the fix from #1193 (comment) for now. At least the async will work on WSL2.

The PR for this (#1402) it's still on hold since we need to wait the zsh-async PR to be merged

Added sleep 0.05 to async.zsh file on 30 line. Unfortunately, it didn't help. It's been so long, and the problem hasn't been fixed, it's sad. The problem is only in windows terminal via WSL2, as I think.

@beruic
Copy link

beruic commented Apr 3, 2024

I think this may be an Ubuntu 20.04 issue. I experience this with one of my repos on Ubuntu 20.04.

Is there any information I can provide that may be of help?

Nevermind. It just started working, so I think it's related to #1402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug related to code base, behavior, displaying, etc.
Development

No branches or pull requests

6 participants