diff --git a/builtin.c b/builtin.c
index 41d460f5a..e896ac916 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1903,6 +1903,7 @@ static int builtin_exit( wchar_t **argv )
{
case 1:
{
+ ec = proc_get_last_status();
break;
}
diff --git a/doc_src/exit.txt b/doc_src/exit.txt
index b71f7b0db..aa96fe95c 100644
--- a/doc_src/exit.txt
+++ b/doc_src/exit.txt
@@ -7,7 +7,7 @@
The exit builtin causes fish to exit. If STATUS is
supplied, it will be converted to an integer and used as the exit
-code. Otherwise the exit code will be 0.
+code. Otherwise the exit code will be that of the last command executed.
If exit is called while sourcing a file (using the . builtin) the rest of the file will be skipped,