configs  Artifact [be6aa8e75b]

Artifact be6aa8e75b79fcb65e9cdb3ce84cf642de8fe0f9c43e4d1f11e7c2d30873c15e:


function prompt_pwd --description 'Print the current working directory'
    set -l options 'h/help'
    argparse -n prompt_pwd --max-args=0 $options -- $argv
    or return

    if set -q _flag_help
        __fish_print_help prompt_pwd
        return 0
    end

    # Replace $HOME with "~"
    set realhome ~
    set -l tmp (basename (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD))

    test $PWD = "/$tmp"
    and set tmp $PWD

    echo $tmp
end