.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "FISH_PROMPT" "1" "Nov 13, 2025" "4.2" "fish-shell" .SH NAME fish_prompt \- define the appearance of the command line prompt .SH SYNOPSIS .nf \fBfish_prompt\fP .fi .sp .INDENT 0.0 .INDENT 3.5 .sp .EX function fish_prompt ... end .EE .UNINDENT .UNINDENT .SH DESCRIPTION .sp The \fBfish_prompt\fP function is executed when the prompt is to be shown, and the output is used as a prompt. .sp The exit status of commands within \fBfish_prompt\fP will not modify the value of \fI\%$status\fP outside of the \fBfish_prompt\fP function. .sp If \fI\%fish_transient_prompt\fP is set to 1, \fBfish_prompt \-\-final\-rendering\fP is run before executing the commandline. .sp \fBfish\fP ships with a number of example prompts that can be chosen with the \fBfish_config\fP command. .SH EXAMPLE .sp A simple prompt: .INDENT 0.0 .INDENT 3.5 .sp .EX function fish_prompt \-d \(dqWrite out the prompt\(dq # This shows up as USER@HOST /home/user/ >, with the directory colored # $USER and $hostname are set by fish, so you can just use them # instead of using \(gawhoami\(ga and \(gahostname\(ga printf \(aq%s@%s %s%s%s > \(aq $USER $hostname \e (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) end .EE .UNINDENT .UNINDENT .SH COPYRIGHT fish-shell developers .\" Generated by docutils manpage writer. .