mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-12 16:53:37 +08:00
cb6d5d76c8
Closes #2699 Fixes issues with: * 'string' function synopsis * Redirection display issues * Better file & path detection * Rendering of % & @ chars in both html and man * @ symbol in tutorial Improves robustness by implementing an @EOL marker to prevent hold buffer dumping extra chars after the end of an expression. Added new '{{' and '}}' meta-chars for when you want curly braces in a regexp that was previously tripping up the lexicon. Improve man/html presentation consistency for * string * printf * prompt_pwd * type Use cli-styling for 'practical' examples. Add <bs> tag for presenting content with preceding backslash. Signed-off-by: Mark Griffiths <mark@thebespokepixel.com>
32 lines
912 B
Plaintext
32 lines
912 B
Plaintext
\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</outp>
|
|
|
|
>_ prompt_pwd
|
|
<outp>~</outp>
|
|
|
|
>_ cd /tmp/banana/sausage/with/mustard
|
|
>_ prompt_pwd
|
|
<outp>/t/b/s/w/mustard</outp>
|
|
|
|
>_ set -g fish_prompt_pwd_dir_length 3
|
|
>_ prompt_pwd
|
|
<outp>/tmp/ban/sau/wit/mustard</outp>
|
|
\endfish
|