.\" Man page generated from reStructuredText .\" by the Docutils 0.23 manpage writer. . . .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 "RETURN" "1" "Oct 26, 2026" "4.9" "fish-shell" .SH NAME return \- stop the current inner function .SH SYNOPSIS .nf \fBreturn\fP [\fIN\fP] .fi .sp .SH DESCRIPTION .sp \fBreturn\fP halts a currently running function. The exit status is set to \fIN\fP if it is given. If \fBreturn\fP is invoked outside of a function or dot script it is equivalent to exit. .sp It is often added inside of a conditional block such as an if \%<> statement or a switch \%<> statement to conditionally stop the executing function and return to the caller; it can also be used to specify the exit status of a function. .sp If at the top level of a script, it exits with the given status, like exit \%<>\&. If at the top level in an interactive session, it will set \fBstatus\fP \%<#\:envvar-status>, but not exit the shell. .sp The \fB\-h\fP or \fB\-\-help\fP option displays help about using this command. .SH EXAMPLE .sp An implementation of the false command as a fish function: .INDENT 0.0 .INDENT 3.5 .sp .EX function false return 1 end .EE .UNINDENT .UNINDENT .SH Copyright fish-shell developers .\" End of generated man page.