FISH-PROMPT-TUTORIAL(1) fish-shell FISH-PROMPT-TUTORIAL(1) (NAME) fish-prompt-tutorial - () fish (DESCRIPTION) : . (man page) HTML . help custom-prompt . fish fish_config . . fish . fish - fish_prompt. : o fish_prompt . o fish_right_prompt . o fish_mode_prompt vi . ( ). SHELL_PROMPT_PREFIX SHELL_PROMPT_SUFFIX . fish_prompt . (OUR FIRST PROMPT) : function fish_prompt echo $PWD '>' end (PWD) > . > (redirection) . echo ( _ ): /home/tutorial >_ (FORMATTING) echo . string join : function fish_prompt string join '' -- $PWD '>' end -- string - . echo -s printf. (ADDING COLOR) . . fish set_color : echo (set_color red)foo set_color RGB set_color 23b455 (bold) (italic) . : function fish_prompt string join '' -- (set_color green) $PWD (set_color --reset) '>' end "--reset" . set_color (escape sequence) - . set_color red : echo \e\[31m set_color . (SHORTENING THE WORKING DIRECTORY) PWD . prompt_pwd : function fish_prompt string join '' -- (set_color green) (prompt_pwd) (set_color --reset) '>' end prompt_pwd . prompt_pwd --full-length-dirs 2 : function fish_prompt string join '' -- (set_color green) (prompt_pwd --full-length-dirs 2) (set_color --reset) '>' end "/home/tutorial/Music/Lena Raine/Oneknowing" : ~/M/Lena Raine/Oneknowing>_ (STATUS) (status) . 0 255 - 0 1 255 . 0 . ( set) . (local) : set -l last_status $status : # set -l stat if test $last_status -ne 0 set stat (set_color red)"[$last_status]"(set_color --reset) end string join : string join '' -- (set_color green) (prompt_pwd) (set_color --reset) $stat '>' $last_status 0 $stat . : function fish_prompt set -l last_status $status # set -l stat if test $last_status -ne 0 set stat (set_color red)"[$last_status]"(set_color --reset) end string join '' -- (set_color green) (prompt_pwd) (set_color --reset) $stat '>' end false ( 1 ) : ~/M/L/Oneknowing>false ~/M/L/Oneknowing[1]>_ (TRANSIENT PROMPT) (transient prompt) fish_transient_prompt 1 : set -g fish_transient_prompt 1 fish --final-rendering . . : function fish_prompt set -l last_status $status set -l stat set -l pwd # if contains -- --final-rendering $argv set pwd (path basename $PWD) else set pwd (prompt_pwd) # if test $last_status -ne 0 set stat (set_color red)"[$last_status]"(set_color --reset) end end string join '' -- (set_color green) $pwd (set_color --reset) $stat '>' end : Oneknowing>false ~/M/L/Oneknowing[1]>_ (SAVE THE PROMPT) funcsave fish_prompt ( funcsave - ) ~/.config/fish/functions/fish_prompt.fish . funced fish_prompt ( funced - ). (?WHERE TO GO FROM HERE) . o fish : o prompt_login / / prompt_hostname o fish_is_root_user (root). o fish_vcs_prompt ( fish_git_prompt / fish_hg_prompt / fish_svn_prompt ) o fish_right_prompt fish_mode_prompt vi . o : o o (venv) o . fish . fish_config . : fish_config prompt show # <- fish_config prompt choose disco # <- disco funced fish_prompt # <- fish_prompt (AUTHOR) fish-shell (COPYRIGHT) fish-shell 4.9 September 7, 2026 FISH-PROMPT-TUTORIAL(1)