starship: Starship not loading using init zsh

Current Behavior

I don’t see the starship prompt. I only see the default zsh prompt.

Expected Behavior

I should see the starship prompt instead of the default zsh prompt.

Additional context/Screenshots

I tested this on an archlinux container. My issue is similar to https://github.com/starship/starship/issues/2508 but it doesn’t apply to me since my .zshrc is only one line.

Even if I’m still using zsh as my shell, creating this .bashrc would show the starship prompt.

eval "$(starship init bash)"

I also tested installing from the package manager and through curl -fsSL https://starship.rs/install.sh | bash

Possible Solution

Environment

  • Starship version: 0.51.0
  • zsh version: 5.8 (x86_64-pc-linux-gnu)
  • Operating system: Arch Linux Unknown
  • Terminal emulator: termite v15
  • Git Commit Hash: 88c3844d
  • Branch/Tag: v0.51.0
  • Rust Version: rustc 1.50.0
  • Rust channel: release
  • Build Time: 2021-03-25 14:52:19

Relevant Shell Configuration

# cat .zshrc
eval "$(starship init zsh)"

Starship Configuration

<unknown config>

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 7
  • Comments: 16 (5 by maintainers)

Most upvoted comments

@mahor1221 Better yet, running prompt off before starship’s init will also work to disable grml’s prompt functionality in favor of Starship’s.

With the release of v0.51.0, we updated Starship to only set $PROMPT once, at initialization, whereas we would previously re-set it every render.

This means that shells that were previously having their Starship prompt overridden would later be re-overridden by Starship. As a result, previously misconfigured prompts that shouldn’t have worked are now no longer working.

removed grml-zsh-config and it worked but in 0.50.0 we didn’t need to comment out anything. it just worked out of the box

if anyone else using it comment out these lines:

# grml-zsh-config-0.18.0-1
# /etc/zsh/zshrc

2541    # Finally enable one of the prompts.
2542    if [[ -n $GRML_CHROOT ]]; then
2543        prompt grml-chroot
2544    elif [[ $GRMLPROMPT -gt 0 ]]; then
2545        prompt grml-large
2546    else
2547        prompt grml
2548    fi

Adding prompt off before the eval "$(starship init zsh)" line fixed the issue for me.

Are you using something like grml-zsh-config? If you are, then a quick workaround is to manually remove or comment out the lines that set the prompt in /etc/zsh/zshrc.