view dot_config/private_fish/functions/fish_prompt.fish @ 1091:a1fab5298ef6 draft tip

feat: update to bitwarden 25.3 and enable ssh-agent
author Zeger Van de Vannet <zeger@vandevan.net>
date Mon, 21 Apr 2025 20:13:02 +0200
parents 6ab26ddbf78d
children
line wrap: on
line source

set fish_prompt_pwd_dir_length 2
set -g fish_prompt_pwd_full_dirs 5
function fish_prompt
    set -l last_pipestatus $pipestatus
    set -lx __fish_last_status $status # Export for __fish_print_pipestatus.
    set -l normal (set_color normal)
    set -q fish_color_status
    or set -g fish_color_status red

    set -l bold_flag --bold
    set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation
    if test $__fish_prompt_status_generation = $status_generation
        set bold_flag
    end
    set __fish_prompt_status_generation $status_generation
    set -l status_color (set_color $fish_color_status)
    set -l statusb_color (set_color $bold_flag $fish_color_status)
    set -l prompt_status (__fish_print_pipestatus " [" "]" "|" "$status_color" "$statusb_color" $last_pipestatus)

    echo (set_color cyan)(date +%H:%M:%S) (set_color red)(prompt_hostname) (set_color blue)(prompt_pwd)(set_color normal)

    set -l active_jobs (jobs | wc -l)
    echo "$active_jobs$prompt_status -> "
end