Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: container indicator for fish shell #1569

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

RealVishy
Copy link
Contributor

Copies over the fish function from bazzite.

Afaik it's the right folder to be put in but i'll fix it if i'm wrong.

#1491

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Aug 6, 2024
@RealVishy RealVishy changed the title feat: copy bazzite fish container icon feat: container indicator for fish shell Aug 6, 2024
@castrojo
Copy link
Member

castrojo commented Aug 8, 2024

I don't use fish so I can't test this, anyone else out there using fish?

@RealVishy
Copy link
Contributor Author

apparently starship makes it's own function with the same name.

# Defined in /tmp/.psub.Wj8KHNUFnO @ line 1
function fish_prompt
    switch "$fish_key_bindings"
        case fish_hybrid_key_bindings fish_vi_key_bindings
            set STARSHIP_KEYMAP "$fish_bind_mode"
        case '*'
            set STARSHIP_KEYMAP insert
    end
    set STARSHIP_CMD_PIPESTATUS $pipestatus
    set STARSHIP_CMD_STATUS $status
    # Account for changes in variable name between v2.7 and v3.0
    set STARSHIP_DURATION "$CMD_DURATION$cmd_duration"
    set STARSHIP_JOBS (count (jobs -p))
    if test "$TRANSIENT" = "1"
        # Clear from cursor to end of screen as `commandline -f repaint` does not do this
        # See https://github.com/fish-shell/fish-shell/issues/8418
        printf \e\[0J
        if type -q starship_transient_prompt_func
            starship_transient_prompt_func
        else
            printf "\e[1;32m❯\e[0m "
        end
    else
        /usr/bin/starship prompt --terminal-width="$COLUMNS" --status=$STARSHIP_CMD_STATUS --pipestatus="$STARSHIP_CMD_PIPESTATUS" --keymap=$STARSHIP_KEYMAP --cmd-duration=$STARSHIP_DURATION --jobs=$STARSHIP_JOBS
    end
end

@castrojo castrojo merged commit c65a29c into ublue-os:main Aug 9, 2024
52 checks passed
@castrojo
Copy link
Member

It was poor form on my part to merge without giving you a heads up, so whatever changes you need to make it good I'll be standing by, appreciate your help!

@RealVishy
Copy link
Contributor Author

AFAIK just renaming the function should fix it but I'll read up on the fish documentation. No worries about it being merged early, I'll try to get it fixed soon!

@RealVishy RealVishy deleted the vishy-fish-fix branch August 13, 2024 05:31
@RealVishy
Copy link
Contributor Author

One of the reasons it wasn't working for me was that it needs your distrobox to be using the same home dir. I was using a custom home dir, which is why it wasn't loading in the fish function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants