warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.45k stars 376 forks source link

oh-my-zsh themes give issues #505

Closed mandel-macaque closed 2 years ago

mandel-macaque commented 2 years ago

Describe the bug

I have the following in my .zsrhc https://gist.github.com/mandel-macaque/074f370e5c13f2fd052f4168b49fa3b2 

The configuration does work fine with other terminal emulators without any issue, in wrap you can see in the screenshots that the prompt gets copied twice. On top of that, the second prompt message is on the right side and editable which means I have to remove it to be able to later type my commands.

To Reproduce

Steps to reproduce:

  1. Instal oh-my-zsh: https://ohmyz.sh
  2. update the .zshrc to https://gist.github.com/mandel-macaque/074f370e5c13f2fd052f4168b49fa3b2
  3. Try to use the terminal.

Expected behaviour

Be able to use the configuration like in kitty and iterm2.

Screenshots

iTerm 2 looks:

Screenshot 2021-12-07 at 11 51 08

Kitty:

Screenshot 2021-12-07 at 11 59 59

Warp:

Screenshot 2021-12-07 at 11 59 14

Operating System

MacOS

OS Version

11.6.1 (20G224)

Additional context

No response

mandel-macaque commented 2 years ago

Looks like the issue comes from the oh-my-zs.sh which can be found here.

elviskahoro commented 2 years ago

@mandel-macaque We're not compatible with some Oh-My-Zsh plugins, particularly themes. We have a GitHub discussion for Custom Prompts:

For now though, the easiest way is to get up and running is to put theme and plugin related lines behind a flag, that disables them for Warp specifically:

if [[ $TERM_PROGRAM != "WarpTerminal" ]]; then
##### WHAT YOU WANT TO DISABLE FOR WARP - BELOW

# POWERLEVEL10K
# OH-MY-ZSH-THEMES
# OH-MY-ZSH-PLUGINS
# FIG
# BIND keys like:
    # bindkey "^j" down-line-or-beginning-search
# [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && 
    # . "/usr/local/etc/profile.d/bash_completion.sh"
    # eval "$(rbenv init -)"

##### WHAT YOU WANT TO DISABLE FOR WARP - ABOVE
fi
mandel-macaque commented 2 years ago

@elviskahoro I did fin that the following line was the culprit:

# gives problems with wrap
#POWERLEVEL9K_PROMPT_ON_NEWLINE=true

which makes sense due to the error.

elviskahoro commented 2 years ago

Gonna close this since the conversation around this is in the link I shared. Please share thoughts there!

elviskahoro commented 2 years ago

@mandel-macaque Thanks for sharing! I'm actually compiling a list of incompatible lines. This helps a lot.