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
20.86k stars 355 forks source link

Support for Multi-line prompts (oh-my-zsh, omz, starship, PS1) #1015

Closed richburdon closed 1 year ago

richburdon commented 2 years ago

Discord username (optional)

No response

Describe the bug

Multiline prompts are not rendered correctly, e.g., `ZSH_THEME="avit"` (see screenshot).

To Reproduce

Steps to reproduce:

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error '...'

Expected behaviour

No response

Screenshots

Warp next to iTerm

Screen Shot 2022-04-11 at 12 25 42 PM

Operating System

MacOS

OS Version

No response

Additional context

No response

warpdotdev-devx commented 2 years ago

TLDR; Avit is a theme that we've had trouble with. We have a Prompt compatibility table on our docs. Link to the documentation for enabling custom prompt / honoring PS1: https://docs.warp.dev/features/prompt

I recommend starship! (elvis)

Also, have you heard about Context Chips? It's how we're thinking of improving the prompt by supporting dynamic refreshing, mouse supported interactivity, and extended customizability.

We hosted a Twitter space and created a Twitter thread, where we also shared mocks, if you're interested in learning more.

tomashodek commented 2 years ago

TLDR; Avit is a theme that we've had trouble with. We have a Prompt compatibility table on our docs. Link to the documentation for enabling custom prompt / honoring PS1: https://docs.warp.dev/features/prompt​ I recommend starship! (elvis) Also, have you heard about Context Chips? It's how we're thinking of improving the prompt by supporting dynamic refreshing, mouse supported interactivity, and extended customizability. We hosted a Twitter space and created a Twitter thread, where we also shared mocks, if you're interested in learning more.

The link is no longer working. Is there any plan to support other custom prompts?

warpdotdev-devx commented 2 years ago

Can you try it again? We have a table in the docs with the list that are currently supported. https://docs.warp.dev/features/prompt

bzvestey commented 2 years ago

I would like to add a bit more here, as I am seeing similar issues with my custom theme for oh-my-zsh. Multi-line PROPMT show up in a single line, and RPROMPT is not displayed until after the command has been run.

My theme ``` ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹" ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}✗" ZSH_THEME_GIT_PROMPT_CLEAN=" %{$fg[blue]%}✔" if [[ $UID -eq 0 ]]; then local user_host='%{$terminfo[bold]$fg[red]%}%n:%m%{$reset_color%}' local user_symbol='#' else local user_host='%{$terminfo[bold]$fg[magenta]%}%n:%m%{$reset_color%}' local user_symbol='➤' fi local current_dir='%{$terminfo[bold]$fg[red]%}[%{$fg[blue]%}%~%{$terminfo[bold]$fg[red]%}]%{$reset_color%}' local git_branch='$(git_prompt_info)%{$reset_color%}' PROMPT="╭─${user_host} ${current_dir} ╰─${user_symbol} " RPROMPT="${git_branch}" ```

Warp and iTerm Screen Shot 2022-05-16 at 15 27 13

RPROMPT after running command Screen Shot 2022-05-16 at 15 26 18

elviskahoro commented 2 years ago

We don't support multi-line prompts yet (not sure whether this would be on the roadmap). The Input Editor is a completely separate UI element from the terminal grid, this is what enables support for a modern text editing experience.

elviskahoro commented 2 years ago

From @japanese-goblinn via #1523

Discord username (optional)

japanese_goblinn#2202

Describe the solution you'd like?

I'd like to have better support for custom prompts

Is your feature request related to a problem? Please describe.

It'll be nice to have support of multi line prompts. I use pure prompt because it has some nice features like showing is there anything in stash or do i have something to push to remote etc. For now, none of this features exist in Warp and respecting of PS1 also do not work.

Additional context

This how this prompt looks in iTerm

image

This is how it looks in Warp

image

Warp Internal (ignore) - linear-label:efcea52d-0ab4-4a92-a41b-93c3e244f0a0

No response

elviskahoro commented 2 years ago

From @sgiddings-kunzleigh via #1523 I agree. Neither my oh-my-posh prompt or my Starship prompt render correctly in Warp. It is easily my biggest complaint. Starship renders well, except for the second line of the prompt is forced on to the single line. And with the nerdfont elements on my oh my posh prompt, the endings are all discolored.

nerdalytics commented 1 year ago

I switched from Starship to oh-my-posh and find rendering issues. Multiline already mentioned. oh-my-posh doesn't see exits with code >= 1.

CleanShot 2022-10-26 at 19 28 05@2x

iTerm reports the error code and oh-my-posh sees 'em and renders the error meaning or the error code.

CleanShot 2022-10-26 at 19 34 03@2x

I prefer Starship and oh-my-posh over Warp's chips, since Warp isn't portable, while Startship and oh-my-posh are very portable. My Linux shells look the same on macOS and Windows.

Chips could be Warp native if Warp becomes portable too.

shifenis commented 1 year ago

As some guy before me has some problem with pure, someone has any update about this?

dannyneira commented 1 year ago

@shifenis Please see more on our supported prompts here: https://docs.warp.dev/features/prompt#custom-prompt-compatibility-table, unfortunately Pure isn't official one of them, it may work if you disable multi-line and right-side prompts but no guarantee.

JanDeDobbeleer commented 1 year ago

@warpdotdev-dx @dannyneira can you also add oh-my-posh to the supported custom prompts? Everything works AND we now also have multiline support as of 12.26.1 unlike every other prompt tool out there. Someone has to push the bar, right?

image

Same for rprompt in zsh btw, other shells already worked.

image
dannyneira commented 1 year ago

Changing to a feature request for supporting multi-line prompts.

Please add a :+1: to the original post at the top to signal that you want this feature, and then hit the subscribe button if you'd like to be notified.

agluck91 commented 1 year ago

TLDR; Avit is a theme that we've had trouble with. We have a Prompt compatibility table on our docs. Link to the documentation for enabling custom prompt / honoring PS1: https://docs.warp.dev/features/prompt​ I recommend starship! (elvis) Also, have you heard about Context Chips? It's how we're thinking of improving the prompt by supporting dynamic refreshing, mouse supported interactivity, and extended customizability. We hosted a Twitter space and created a Twitter thread, where we also shared mocks, if you're interested in learning more.

I like the Chips idea, but it would be nice to have multiline in the interim while we are waiting for that functionality. The chips have their own problem though, you can not put them on other systems. I install starship on everything, I also use other terminals. So no chips there. If warp decided to offer and ipad shell similar to blink, then I would say chips all the way. This is by no means a deal breaker, just really annoying. All my terminals look great on all my other softwares, then ..... I come to warp... lol

brianzelip commented 1 year ago

Looks like this is fixed now.

prompt
zachbai commented 1 year ago

Yep, this was fixed as part of supporing powerlevel10k (#2851)!

dannyneira commented 1 year ago

Woohoo! This feature is now live in the latest version of Warp. Closing as resolved, but please let us know if any issues with multi-line prompt support.