terminalzshiterm2warp

How to disable Powerlevel10k in Warp and install Starship


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?


Solution

  • 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
    
    if [[ $TERM_PROGRAM != "WarpTerminal" ]]; then
        source ~/powerlevel10k/powerlevel10k.zsh-theme
    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