How to disable Powerlevel10k in Warp and install Starship

3.4k Views Asked by At

I just installed Warp terminal and I'm loving it.

But I want to customize the prompt with Starship and still having Powerlevel10k on my iTerm2 terminal. Does it is posible?

3

There are 3 best solutions below

0
On BEST ANSWER

After a few hours I managed to install Starship on Warp and still having Powerlevel10k on iTerm (and all the others terminals ) modifying my .zshrc file as the Warp documentation says.

So at the start of the file I wrapped the Powelevel10k initialization to only activate it if the terminal is not Warp:

# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ $TERM_PROGRAM != "WarpTerminal" ]]; then
    if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
      source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
    fi
fi

And I wrapped the Starship initialization only for Warp at the end of the file:

if [[ $TERM_PROGRAM == "WarpTerminal" ]]; then
    eval "$(starship init zsh)"
fi
0
On

I would add to @Christian answer small hint in case of still missing prompt:

if [[ $TERM_PROGRAM == "iTerm.app" ]]; then
  test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
fi

That shell integration quite often cause a issue (e.g. https://github.com/warpdotdev/Warp/issues/1518) - the same was for me and the conditional initialisation helped to solve the problem.

0
On

If anyone else has tried the technique for fixing Powerlevel10k or Starship without success, check if you have Powershell installed.

Powershell Issues

I was having this issue, and I thought it was because of Powerlevel, but it was because of Powerline!

Warp keeps adding extra content like 'Username > Documents > DirectoryName > app'

Terminal screenshot

The Fix

In my ~/.bash_profile I had:


. /Users/dilraj/Library/Python/2.7/lib/python/site-packages/powerline/bindings/bash/powerline.sh

I updated it to:

if [[ $TERM_PROGRAM != "WarpTerminal" ]]; then
  # Powerline - Do not run in Warp.dev
  . /Users/dilraj/Library/Python/2.7/lib/python/site-packages/powerline/bindings/bash/powerline.sh
fi

Then run source ~/.bash_profile and exit and re-open your command line interfaces! Wrap is good for me now!