RETURN(1) fish-shell RETURN(1)

# [NAME](#NAME)

return - stop the current inner function

# [SYNOPSIS](#SYNOPSIS)

```
return [N]
```

# [DESCRIPTION](#DESCRIPTION)

**return** halts a currently running function. The exit status is set to *N* if it is given. If **return** is invoked outside of a function or dot script it is equivalent to exit.

It is often added inside of a conditional block such as an if &lt;&gt; statement or a switch &lt;&gt; 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.

If at the top level of a script, it exits with the given status, like exit &lt;&gt;. If at the top level in an interactive session, it will set **status** &lt;#envvar-status&gt;, but not exit the shell.

The **-h** or **--help** option displays help about using this command.

# [EXAMPLE](#EXAMPLE)

An implementation of the false command as a fish function:

```
function false


    return 1
end
```

# [Copyright](#Copyright)

fish-shell developers

October 10, 2026 4.9

---

Document: return(1) from fish 4.9.3-r1 (Chainguard OS)
Source: https://github.com/fish-shell/fish-shell
