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.26k stars 337 forks source link

Add Support for the Fish Prompt #1776

Open RobbieMcKinstry opened 1 year ago

RobbieMcKinstry commented 1 year ago

Discord username (optional)

RobbieMcKinstry#5296

Describe the solution you'd like?

Warp does not support the fish [prompt](https://fishshell.com/docs/current/cmds/fish_prompt.html) as [per the documentation](https://docs.warp.dev/features/prompt#ps1-compatibility-table).

Support for the `fish_prompt` function would further increase compatibility with other terminals.

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

I know Warp has it's own prompts for git and the like, but I was happy with the customization I had done before switching to Warp.

For example, this is my prompt in iTerm:

function fish_prompt
    # set up local variables
    set -l last_status $status
    set -l red 'FF2D00'
    set -l green '25FA38'
    set -l git_blue '76B3E3'
    set -l dir_pink 'A71FB7'
    # capture the current git branch
    set -l git_branch (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
    # capture the pwd but delete everything until the last slash
    set -l this_dir_name (pwd | sed 's:.*/::')

    # print a check if the last command was successful
    # otherwise print an X
    if [ $last_status -ne 0 ]
      set_color $red
      printf '✘ '
    else
      set_color $green
      printf '✓ ' 
    end

    if set -q this_dir_name
      set_color $dir_pink
      printf '%s ' $this_dir_name
    end

    # now, set the color for the git prompt
    # and print it
    if set -q git_branch
      set_color $git_blue
      printf '%s ' $git_branch
    end
end

Additional context

No response

How important is this feature to you?

4

Warp Internal (ignore) - linear-label:770f6576-d6c0-4e4f-a259-fc64b5156087

No response

dannyneira commented 1 year ago

Thanks for this feature request, please +1 his request as it helps us gauge interest. We will post any updates here.

silouanwright commented 1 year ago

It would be great if we added that Fish Prompt (without enabling custom prompt in settings) is not supported. The reason that's important, is that when that setting is triggered, the prompt wraps, which automatically makes that option a no go for many people who want a more minimalist prompt, so essentially there is no way to customize the prompt unless you'd like the prompt to wrap 4 or 5 lines.

I think this should be listed in the compatibility table as "not supported" as it may take someone quite a long time to figure out.