PROMPT_PWD(1)

NAME
prompt_pwd - Print pwd suitable for prompt

SYNOPSIS

function fish_prompt
    echo -n (prompt_pwd) '$ '
end

DESCRIPTION

prompt_pwd is a function to print the current working directory in a way suitable for prompts. It will replace the home directory with "~" and shorten every path component but the last to a default of one character.

To change the number of characters per path component, set $fish_prompt_pwd_dir_length to the number of characters. Setting it to 0 or an invalid value will disable shortening entirely.

EXAMPLES

>_ cd ~/
>_ echo $PWD
/home/alfa
>_ prompt_pwd
~
>_ cd /tmp/banana/sausage/with/mustard
>_ prompt_pwd
/t/b/s/w/mustard
>_ set -g fish_prompt_pwd_dir_length 3
>_ prompt_pwd
/tmp/ban/sau/wit/mustard

COPYRIGHT
2020, fish-shell developers