aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/prompt_pwd.txt
blob: 039efabb82af8faa5af72c5145c41835a1de2445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\section prompt_pwd prompt_pwd - Print pwd suitable for prompt

\subsection prompt_pwd-synopsis Synopsis
\fish{synopsis}
prompt_pwd
\endfish

\subsection prompt_pwd-description 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.

\subsection prompt_pwd-example Examples

\fish{cli-dark}
>_ cd ~/
>_ echo $PWD
\outp{/home/alfa}

>_ prompt_pwd
\outp{~}

>_ cd /tmp/banana/sausage/with/mustard
>_ prompt_pwd
\outp{/t/b/s/w/mustard}

>_ set -g fish_prompt_pwd_dir_length 3
>_ prompt_pwd
\outp{/tmp/ban/sau/wit/mustard}
\endfish